]> arthur.barton.de Git - ax-zsh.git/commitdiff
neofetch: Implement axzsh_neofetch() function
authorAlexander Barton <alex@barton.de>
Sat, 4 Dec 2021 13:01:02 +0000 (14:01 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 4 Dec 2021 13:01:05 +0000 (14:01 +0100)
This function can be used to call neofetch(1) exactly as the plugin does.

plugins/neofetch/neofetch.ax-io

index 825a9ff3995272a0474e7d153e9c91823e41df35..aa40183d3b3d5aca0f7871628767aeb0c668870d 100644 (file)
@@ -7,18 +7,22 @@
 # Don't run this plugin on "check-plugins"!
 [[ -z "$AXZSH_PLUGIN_CHECK" ]] || return 0
 
+axzsh_neofetch() {
+       neofetch \
+               --color_blocks off \
+               --disable packages \
+               --shell_path on \
+               --underline_char '~'
+}
+
 # Don't show any info when ~/.hushlogin exists ...
 [[ -r ~/.hushlogin ]] && return 0
 
 # Check if neofetch(1) infos have been shown during last 60 minutes, and if so,
 # don't show them now but return.
-[[ -z `find "$XDG_CACHE_HOME/axzsh_last_neofetch" -mmin -60 2>/dev/null` ]] || return 0
+[[ -z $(find "$XDG_CACHE_HOME/axzsh_last_neofetch" -mmin -60 2>/dev/null) ]] || return 0
 
-neofetch \
-       --color_blocks off \
-       --disable packages \
-       --shell_path on \
-       --underline_char '~'
+axzsh_neofetch
 
 # Wtite "stamp" file.
 [[ -w ~/ ]] && touch "$XDG_CACHE_HOME/axzsh_last_neofetch"