From 8c4f6bdbad532127a687f2fefb5392266f4d617e Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 4 Dec 2021 14:01:02 +0100 Subject: [PATCH] neofetch: Implement axzsh_neofetch() function This function can be used to call neofetch(1) exactly as the plugin does. --- plugins/neofetch/neofetch.ax-io | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/neofetch/neofetch.ax-io b/plugins/neofetch/neofetch.ax-io index 825a9ff..aa40183 100644 --- a/plugins/neofetch/neofetch.ax-io +++ b/plugins/neofetch/neofetch.ax-io @@ -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" -- 2.39.2