]> arthur.barton.de Git - ax-zsh.git/commitdiff
Correctly test XDG_CACHE_HOME for writability for "stamp files" master
authorAlexander Barton <alex@barton.de>
Sun, 5 May 2024 12:44:29 +0000 (14:44 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 5 May 2024 12:44:29 +0000 (14:44 +0200)
default_plugins/ls/ls.zprofile
plugins/calendar/calendar.ax-io
plugins/icalbuddy/icalbuddy.ax-io
plugins/neofetch/neofetch.ax-io
plugins/remind/remind.ax-io

index 897b16a66a1400d4f32278b629b0a2b98b3c7868..580b7cd1abc14ed0702184af7d27c8c3af6d374c 100644 (file)
@@ -1,7 +1,11 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # ls.zshrc: Setup ls(1)
 
-# Is dircolors(1) available?
-if (( $+commands[dircolors] )); then
+if [[ -r ~/.local/share/lscolors.sh ]]; then
+       # Read lscolors.sh, which should set LS_COLORS;
+       # see <https://github.com/trapd00r/LS_COLORS>.
+       source ~/.local/share/lscolors.sh
+elif (( $+commands[dircolors] )); then
+       # Use dircolors(1):
        eval $(dircolors)
 fi
index 56c65f784f5fb6dc9f5dfa9151b58bae70bcafea..6d573d210f2d558d83752eeddfcd1ffaed3c6127 100644 (file)
@@ -27,4 +27,4 @@ fi
 rm -f "$tmpfile"
 
 # Wtite "stamp" file.
-[[ -w ~/ ]] && touch "$XDG_CACHE_HOME/axzsh_last_calendar"
+[[ -w "$XDG_CACHE_HOME" ]] && touch "$XDG_CACHE_HOME/axzsh_last_calendar"
index c91ed76f08a54c7974dbf8b7d063769d921decb1..41f58aadf67c7ed96780885dc46dd017215d6ba6 100644 (file)
@@ -38,4 +38,4 @@ rm -f "$tmpfile"
 unset bul bul_imp sep tmpfile
 
 # Wtite "stamp" file.
-[[ -w ~/ ]] && touch "$XDG_CACHE_HOME/axzsh_last_reminder"
+[[ -w "$XDG_CACHE_HOME" ]] && touch "$XDG_CACHE_HOME/axzsh_last_reminder"
index 7a37f6ec12bff7d1b3ed50f37f3a7cd40e7b2970..5798d58d07f662f5376a7798fc83a81736e46fc3 100644 (file)
@@ -23,4 +23,4 @@ else
 fi
 
 # Wtite "stamp" file.
-[[ -w ~/ ]] && touch "$XDG_CACHE_HOME/axzsh_last_neofetch"
+[[ -w "$XDG_CACHE_HOME" ]] && touch "$XDG_CACHE_HOME/axzsh_last_neofetch"
index 519a4264ac1d087583da05979917ce3f1dcad102..457e45aebe39f66b4da9cb791ad589b9dc1beb1b 100644 (file)
@@ -24,4 +24,4 @@ alias remindcal='remind -ccu+3 -m -w$COLUMNS,4,0 $HOME/.remind'
 remind -h -g -t5 ~/.remind && echo
 
 # Wtite "stamp" file.
-[[ -w ~/ ]] && touch "$XDG_CACHE_HOME/axzsh_last_reminder"
+[[ -w "$XDG_CACHE_HOME" ]] && touch "$XDG_CACHE_HOME/axzsh_last_reminder"