]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: Also display fortune every 4 hours.
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index ad641b9b3fbab962e721846d8d240b125e59af7d..aa195f28b167da25b030ec5e20aef1cc1dfec0ad 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -672,20 +672,22 @@ fi
     command tree -C "$@" | less
 }
 
-# Choose the "best" PDF viewer available: zathura, then xpdf. Also setup
-# completion for `pdf`.
-if (( $+commands[zathura] )); then
+# Choose the "best" PDF viewer available: xpdf, then zathura (in the past
+# zathura was preferred, but recent versions are completely broken: still no
+# working search and no page-wise scrolling anymore). Also setup completion
+# for `pdf`.
+if (( $+commands[xpdf] )); then
     pdf() {
-        command zathura "$@" 2>/dev/null &
+        command xpdf "$@" 2>/dev/null &
         disown %command
     }
-    # No completion for zathura yet.
     compdef _xpdf pdf
-elif (( $+commands[xpdf] )); then
+elif (( $+commands[zathura] )); then
     pdf() {
-        command xpdf "$@" 2>/dev/null &
+        command zathura "$@" 2>/dev/null &
         disown %command
     }
+    # No completion for zathura yet.
     compdef _xpdf pdf
 fi
 
@@ -771,9 +773,12 @@ exec 2>>(while read -r -k -u 0 line; do
     print -n $'\0';
 done &)
 
-# Run reminder and redisplay it every four hours (if it's available).
+# Run the following programs every 4 hours.
 PERIOD=14400
 periodic() {
+    # Display fortunes.
+    (( $+commands[fortune] )) && fortune -ac
+    # Display reminders.
     (( $+commands[rem] )) && [ -f ~/.reminders ] && rem -h
 }