]> arthur.ath.cx Git - ax-zsh.git/blob - plugins/neofetch/neofetch.ax-io
aa40183d3b3d5aca0f7871628767aeb0c668870d
[ax-zsh.git] / plugins / neofetch / neofetch.ax-io
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # neofetch.ax-io: Show neofetch(1) system information.
3
4 # Make sure that "neofetch(1)" is installed.
5 (( $+commands[neofetch] )) || return 1
6
7 # Don't run this plugin on "check-plugins"!
8 [[ -z "$AXZSH_PLUGIN_CHECK" ]] || return 0
9
10 axzsh_neofetch() {
11         neofetch \
12                 --color_blocks off \
13                 --disable packages \
14                 --shell_path on \
15                 --underline_char '~'
16 }
17
18 # Don't show any info when ~/.hushlogin exists ...
19 [[ -r ~/.hushlogin ]] && return 0
20
21 # Check if neofetch(1) infos have been shown during last 60 minutes, and if so,
22 # don't show them now but return.
23 [[ -z $(find "$XDG_CACHE_HOME/axzsh_last_neofetch" -mmin -60 2>/dev/null) ]] || return 0
24
25 axzsh_neofetch
26
27 # Wtite "stamp" file.
28 [[ -w ~/ ]] && touch "$XDG_CACHE_HOME/axzsh_last_neofetch"