From c42bd33b8cd09106868d3be6fab3d5c74b3242e0 Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Thu, 13 Dec 2018 23:11:10 +0100 Subject: [PATCH] Document bash files in system/ Signed-off-by: Severin Kaderli --- .gitlab-ci.yml | 1 + install.sh | 1 + system/.aliases | 22 +++++++++++++++++----- system/.bash_logout | 16 +++++++++++++--- system/.bash_profile | 14 +++++++++++--- system/.bashrc | 12 ++++++++++++ system/.env | 13 ++++++++++++- system/.keyleds | 13 ++++++++++++- system/.xinitrc | 30 +++++++++++++----------------- system/.xprofile | 30 ++++++++++++++++-------------- system/.xsetup | 25 +++++++++++++++++++++++++ 11 files changed, 133 insertions(+), 44 deletions(-) create mode 100644 system/.xsetup diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9c358d..856af5f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,5 +15,6 @@ Lint: - shellcheck ./system/.keyleds - shellcheck ./system/.xinitrc - shellcheck ./system/.xprofile + - shellcheck ./system/.xsetup - shellcheck ./install.sh - shellcheck ./post-install.sh diff --git a/install.sh b/install.sh index 437e6b9..38528c2 100755 --- a/install.sh +++ b/install.sh @@ -50,6 +50,7 @@ LINKED_FILES_HOME=( ".xinitrc" ".xprofile" ".Xresources" + ".xsetup" "bin" "dconf" ) diff --git a/system/.aliases b/system/.aliases index 130d8d7..09cf0e5 100644 --- a/system/.aliases +++ b/system/.aliases @@ -1,20 +1,32 @@ #!/bin/bash +# +# SCRIPT NAME: +# .aliases # -# Author: Severin Kaderli +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This script is used to define aliases for commands. +# +# USAGE: +# This script is sourced by .bashrc -# Shortcut for clear because I sometimes type the DOS command instead +# Alias for clear because I sometimes type the DOS command instead alias cls="clear" -# Use exa as ls replacement +# Alias for using exa as ls replacement alias ls="exa -al" alias ll="exa -al" -# Use ripgrep as grep replacement +# Alias for using ripgrep as grep replacement alias grep="rg -n" -# cd shortcut to get to my Projects folder +# Alias to get to my Projects folder alias pj="cd ~/Projects" +# Alias for opening my code editor alias e="code" +# Alias for starting Guild Wars 2 using bumblebee and wine alias gw2="primusrun wine64 ~/.wine/drive_c/Program\ Files/Guild\ Wars\ 2/Gw2-64.exe -dx9single -autologin -mapLoadinfo" diff --git a/system/.bash_logout b/system/.bash_logout index dc482a5..32ebbf0 100644 --- a/system/.bash_logout +++ b/system/.bash_logout @@ -1,8 +1,18 @@ #!/bin/bash -# ~/.bash_logout: executed by bash(1) when login shell exits. - -# when leaving the console clear the screen to increase privacy +# +# SCRIPT NAME: +# .bash_logout +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This script is executed when the login shell exits. +# +# USAGE: +# This script is automatically executed when the login shell exits. +# Clear console output if [ "$SHLVL" = 1 ]; then [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q fi diff --git a/system/.bash_profile b/system/.bash_profile index 10f96cc..2109ffa 100644 --- a/system/.bash_profile +++ b/system/.bash_profile @@ -1,12 +1,20 @@ #!/bin/bash +# +# SCRIPT NAME: +# .bash_profile # -# Author: Severin Kaderli -# We just source .bashrc so we don't need to manage two files. +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This script is called when you start a login shell. +# +# USAGE: +# This script is automatically executed when you start a login shell. if [[ -f "${HOME}/.bashrc" ]]; then . "${HOME}/.bashrc" fi -# Setting keyboard colors if [[ -f "${HOME}/.keyleds" ]]; then . "${HOME}/.keyleds" fi diff --git a/system/.bashrc b/system/.bashrc index 882e1b4..83dd500 100644 --- a/system/.bashrc +++ b/system/.bashrc @@ -1,4 +1,16 @@ #!/bin/bash +# +# SCRIPT NAME: +# .bashrc +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This script is called when you start a new shell. +# +# USAGE: +# This script is automatically executed when you start a new shell. # Bash configuration shopt -s histappend diff --git a/system/.env b/system/.env index 8727584..6e475c2 100644 --- a/system/.env +++ b/system/.env @@ -1,7 +1,18 @@ #!/bin/bash +# +# SCRIPT NAME: +# .env +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This file contains declarations of environment variables. +# +# USAGE: +# This script is sourced by .bashrc . "${HOME}/bin/utils.sh" - # Bash export HISTCONTROL=ignoreboth export HISTSIZE=1000 diff --git a/system/.keyleds b/system/.keyleds index a4544ed..a730a76 100644 --- a/system/.keyleds +++ b/system/.keyleds @@ -1,6 +1,17 @@ #!/bin/bash +# +# SCRIPT NAME: +# .keyleds # -# Author: Severin Kaderli +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This file contains configurations for my keyboard backlight. +# +# USAGE: +# This script is sourced by .bash_profile + # Key groups g810-led -g keys FF4500 g810-led -g fkeys FF00FF diff --git a/system/.xinitrc b/system/.xinitrc index a96b2cd..5bca6a3 100644 --- a/system/.xinitrc +++ b/system/.xinitrc @@ -1,19 +1,15 @@ #!/bin/bash -# Disable screen saver -xset s off -xset -dpms -xset s noblank - -# Set keyboard layout -setxkbmap -model pc105 -layout ch - -# Start ibus -ibus-daemon -drx - - -. "${HOME}/bin/resolution.sh" -xrandr --setprovideroutputsource modesetting NVIDIA -0 -xrandr --auto - -# Start i3 +# +# SCRIPT NAME: +# .xinitrc +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This is the startup script when you start the x-server. +# +# USAGE: +# This script is executed when you start the x-server. +. "${HOME}/.xsetup" i3 \ No newline at end of file diff --git a/system/.xprofile b/system/.xprofile index 34368f9..96a0277 100644 --- a/system/.xprofile +++ b/system/.xprofile @@ -1,15 +1,17 @@ #!/bin/bash -# Disable screen saver -xset s off -xset -dpms -xset s noblank - -# Set keyboard layout -setxkbmap -model pc105 -layout ch - -# Start ibus -ibus-daemon -drx - -if [[ -f "${HOME}/.bash_profile" ]]; then - . "${HOME}/.bash_profile" -fi +# +# SCRIPT NAME: +# .xprofile +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This is the startup script when LightDM starts. Currently it sources .xsetup +# and .bash_profile so it's almost the same as if you start the x-server +# manually. +# +# USAGE: +# This script is executed when LightDM starts. +. "${HOME}/.xsetup" +. "${HOME}/.bash_profile" diff --git a/system/.xsetup b/system/.xsetup new file mode 100644 index 0000000..f1680e2 --- /dev/null +++ b/system/.xsetup @@ -0,0 +1,25 @@ +#!/bin/bash +# +# SCRIPT NAME: +# .xsetup +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# This file setups things that should by started by the x-server like the +# ibus-daemon and the keyboard layout. +# +# USAGE: +# This script is sourced by both .xinitrc and .xprofile +xset s off +xset -dpms +xset s noblank + +# Set keyboard layout +setxkbmap -model pc105 -layout ch + +# Start ibus +ibus-daemon -drx + +. "${HOME}/bin/resolution.sh" \ No newline at end of file