From 8d3f9c8a1d5d2890edf4d793b23f569dd8031d8e Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Wed, 13 Feb 2019 00:47:10 +0100 Subject: [PATCH] More config cleanup Signed-off-by: Severin Kaderli --- .gitlab-ci.yml | 4 +-- README.md | 2 +- install.sh | 7 ++--- post-install.sh | 2 +- system/.aliases | 7 +++-- system/.bashrc | 6 +++++ system/.config/X11/xsetup | 2 +- system/.config/npm/config | 4 +++ system/.config/polybar/config | 4 +-- system/.env | 29 ++++++++++++--------- system/{ => .local}/bin/gw2.sh | 0 system/{ => .local}/bin/increase_volume.sh | 0 system/{ => .local}/bin/music.sh | 0 system/{ => .local}/bin/power.sh | 0 system/{ => .local}/bin/resolution.sh | 0 system/{ => .local}/bin/screenlock.sh | 0 system/{ => .local}/bin/server.sh | 0 system/{ => .local}/bin/submodule_update.sh | 0 system/{ => .local}/bin/twitch.sh | 0 system/{ => .local}/bin/upgrade.sh | 0 system/{ => .local}/bin/utils.sh | 4 +-- system/{ => .local}/bin/watch.sh | 0 22 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 system/.config/npm/config rename system/{ => .local}/bin/gw2.sh (100%) rename system/{ => .local}/bin/increase_volume.sh (100%) rename system/{ => .local}/bin/music.sh (100%) rename system/{ => .local}/bin/power.sh (100%) rename system/{ => .local}/bin/resolution.sh (100%) rename system/{ => .local}/bin/screenlock.sh (100%) rename system/{ => .local}/bin/server.sh (100%) rename system/{ => .local}/bin/submodule_update.sh (100%) rename system/{ => .local}/bin/twitch.sh (100%) rename system/{ => .local}/bin/upgrade.sh (100%) rename system/{ => .local}/bin/utils.sh (98%) rename system/{ => .local}/bin/watch.sh (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be4b0d5..a9f49c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,10 +4,10 @@ before_script: - apt-get update && apt-get install -y --no-install-recommends shellcheck - shopt -s expand_aliases - alias shellcheck="shellcheck -x --exclude=SC2034,SC1091,SC1090" - + Lint: script: - - shellcheck ./system/bin/* + - shellcheck ./system/.local/bin/* - shellcheck ./system/.aliases - shellcheck ./system/.bash_logout - shellcheck ./system/.bash_profile diff --git a/README.md b/README.md index bb12342..6d4d8ed 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ This folder contains my configuration for the X-Server. ### `.config/Trolltech.conf` This file contains my QT4 configuration. -### `bin` +### `.local/bin` This folder contains a bunch of scripts that I use. Some of them are used by Polybar or i3 and others are used directly and some like `utils.sh` contain functions that I use in other scripts. diff --git a/install.sh b/install.sh index f5ddd72..dc36a99 100755 --- a/install.sh +++ b/install.sh @@ -13,7 +13,7 @@ # # USAGE: # ./install.sh -. ./system/bin/utils.sh +. ./system/.local/bin/utils.sh ####################################### # Configuration variables @@ -47,6 +47,7 @@ LINKED_FILES_HOME=( ".config/httpie" ".config/i3" ".config/mpv" + ".config/npm" ".config/polybar" ".config/redshift" ".config/streamlink" @@ -57,7 +58,7 @@ LINKED_FILES_HOME=( ".config/wget" ".config/X11" ".env" - "bin" + ".local/bin" ) # Groups the user should be added to @@ -102,7 +103,7 @@ do done print_header "Give permissions" -set_permission severin 744 "${HOME}/bin" +set_permission severin 744 "${XDG_BIN_HOME}" print_header "Add user to groups" for group in "${ADD_GROUPS[@]}" diff --git a/post-install.sh b/post-install.sh index 808f464..0a3aa04 100755 --- a/post-install.sh +++ b/post-install.sh @@ -13,7 +13,7 @@ # # USAGE: # ./post-install.sh -. ./system/bin/utils.sh +. ./system/.local/bin/utils.sh ####################################### # Configuration variables diff --git a/system/.aliases b/system/.aliases index bcf2ea7..35f2b26 100644 --- a/system/.aliases +++ b/system/.aliases @@ -31,7 +31,10 @@ alias pj="cd ~/Projects" alias e="code" # Alias for wget to use XDG directories -alias wget="wget --hsts-file=\"${XDG_CACHE_HOME}/wget-hsts\"" +alias wget='wget --hsts-file="${XDG_CACHE_HOME}/wget-hsts"' # Alias for svn to use XDG directories -alias svn="svn --config-dir \"${XDG_CONFIG_HOME}/subversion\"" \ No newline at end of file +alias svn='svn --config-dir "${XDG_CONFIG_HOME}/subversion"' + +# Alias for gpg2 to use XDG directories +alias gpg2='gpg2 --homedir "${XDG_DATA_HOME}/gnupg"' \ No newline at end of file diff --git a/system/.bashrc b/system/.bashrc index 6c87f89..9e45024 100644 --- a/system/.bashrc +++ b/system/.bashrc @@ -17,6 +17,12 @@ shopt -s histappend shopt -s checkwinsize shopt -s globstar +# XDG_Base_Directories +export XDG_CONFIG_HOME="${HOME}/.config" +export XDG_CACHE_HOME="${HOME}/.cache" +export XDG_DATA_HOME="${HOME}/.local/share" +export XDG_BIN_HOME="${HOME}/.local/bin" + # Sourcing environment variables if [ -f "${HOME}/.env" ]; then . "${HOME}/.env" diff --git a/system/.config/X11/xsetup b/system/.config/X11/xsetup index c425a10..0625114 100644 --- a/system/.config/X11/xsetup +++ b/system/.config/X11/xsetup @@ -31,4 +31,4 @@ xrdb -merge "${XDG_CONFIG_HOME}/X11/xresources" # Start ibus #ibus-daemon -drx -. "${HOME}/bin/resolution.sh" +. "${XDG_BIN_HOME}/resolution.sh" diff --git a/system/.config/npm/config b/system/.config/npm/config new file mode 100644 index 0000000..a598afa --- /dev/null +++ b/system/.config/npm/config @@ -0,0 +1,4 @@ +prefix=${XDG_DATA_HOME}/npm +cache=${XDG_CACHE_HOME}/npm +tmp=${XDG_RUNTIME_DIR}/npm +init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js \ No newline at end of file diff --git a/system/.config/polybar/config b/system/.config/polybar/config index c5997ef..6e467cd 100644 --- a/system/.config/polybar/config +++ b/system/.config/polybar/config @@ -239,7 +239,7 @@ label = %output% interval = 5 -click-left = $HOME/bin/power.sh +click-left = ${XDG_BIN_HOME}/power.sh ####################################### @@ -247,7 +247,7 @@ click-left = $HOME/bin/power.sh ####################################### [module/music] type = custom/script -exec = $HOME/bin/music.sh +exec = ${XDG_BIN_HOME}/music.sh format =