From db211c7f310a5de18c7803a1ebfbb7ab2b1e3f0d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 29 Jul 2016 20:06:28 +0200 Subject: make my dotfiles location independent This is achieved by storing the absolute path to the dotfile directory in the variable $DOTFILES_LOCATION. And change every hardcoded location into the dotfiles with this var. The Variable $DOTFILES_LOCATION populated with the output of get_dotfiles_location.sh at 3 places: 1) config.fish | zshrc 2) xinitrc (should be allready exported) get_dotfiles_location uses the assumption that it is symlinked into the dotfiles directory. offlineimap: * include patch for offlineimap * change config to the small one * include environment file in systemd unit setup.py: * handle offlineimap situation * print a warning and prompt for proceeding * write the environment file for the systemd unit * add pseudo dependency (get_dotfiles_location) to [fish-config, offlineimap, i3] * print errors on stderr * don't exit if a function fails config.fish: * export $DOTFILES_LOCATION * change hardcoded links * add perl tools to path * export some yaourt specific vars if yaourt is available zshrc: export $DOTFILES_LOCATION xinitrc: export $DOTFILES_LOCATION i3/*: change hardcoded links scripts/* change hardcoded links README.md: mention $DOTFILES_LOCATION --- scripts/media_control.sh | 2 +- scripts/media_status.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/media_control.sh b/scripts/media_control.sh index d8f7f79..ae883db 100755 --- a/scripts/media_control.sh +++ b/scripts/media_control.sh @@ -53,7 +53,7 @@ then exit fi - spotify_playing=$($HOME/.dotfiles/scripts/media_is_spotify_playing.sh) + spotify_playing=$($DOTFILES_LOCATION/scripts/media_is_spotify_playing.sh) if mpc | grep "\[playing\]" &> /dev/null then mpd_playing=true diff --git a/scripts/media_status.sh b/scripts/media_status.sh index a7218ee..a2a7530 100755 --- a/scripts/media_status.sh +++ b/scripts/media_status.sh @@ -1,6 +1,6 @@ #!/bin/bash mpd_playing=$(mpc 2>/dev/null | grep "\[playing\]") -spotify_playing=$($HOME/.dotfiles/scripts/media_is_spotify_playing.sh) +spotify_playing=$($DOTFILES_LOCATION/scripts/media_is_spotify_playing.sh) if [[ $spotify_playing == "true" ]] then @@ -14,7 +14,7 @@ then then echo "Spotify: ad :/" else - echo Spotify: "▶" $($HOME/.dotfiles/scripts/media_print_spotify_info.sh) + echo Spotify: "▶" $($DOTFILES_LOCATION/scripts/media_print_spotify_info.sh) fi fi elif [[ $mpd_playing != "" ]] @@ -27,7 +27,7 @@ then fi elif pgrep spotify &>/dev/null then - echo Spotify: "▐▐" $($HOME/.dotfiles/scripts/media_print_spotify_info.sh) + echo Spotify: "▐▐" $($DOTFILES_LOCATION/scripts/media_print_spotify_info.sh) elif pgrep mpd &>/dev/null then if type mpc &>/dev/null -- cgit v1.2.3