]> arthur.barton.de Git - ax-zsh.git/commitdiff
neofetch: Get rid of the axzsh_neofetch() function
authorAlexander Barton <alex@barton.de>
Fri, 8 Dec 2023 16:38:25 +0000 (17:38 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 8 Dec 2023 16:38:25 +0000 (17:38 +0100)
plugins/neofetch/neofetch.ax-io

index ed4f197bed9204da91269f6ae8d965144405ae39..7a37f6ec12bff7d1b3ed50f37f3a7cd40e7b2970 100644 (file)
@@ -7,17 +7,6 @@
 # Don't run this plugin on "check-plugins"!
 [[ -z "$AXZSH_PLUGIN_CHECK" ]] || return 0
 
-axzsh_neofetch() {
-       if (( $+commands[fastfetch] )); then
-               fastfetch
-       elif (( $+commands[neofetch] )); then
-               neofetch
-       else
-               echo "Neither fastfetch(1) nor neofetch(1) was found!" >&2
-               return 1
-       fi
-}
-
 # Don't show any info when ~/.hushlogin exists ...
 [[ -r ~/.hushlogin ]] && return 0
 
@@ -25,7 +14,13 @@ axzsh_neofetch() {
 # don't show them now but return.
 [[ -z $(find "$XDG_CACHE_HOME/axzsh_last_neofetch" -mmin -60 2>/dev/null) ]] || return 0
 
-axzsh_neofetch
+if (( $+commands[fastfetch] )); then
+       fastfetch
+elif (( $+commands[neofetch] )); then
+       neofetch
+else
+       return 0
+fi
 
 # Wtite "stamp" file.
 [[ -w ~/ ]] && touch "$XDG_CACHE_HOME/axzsh_last_neofetch"