Tech Stack
Displays the current song playing on cmus (if running) in the format: "Artist - Song Title ▶️ 0:00-0:00".
'Herms Niel - Erika.flac.'
static const char unknown_str[] = "";
in config.h
to remove slstatus' 'n/a' thing, so that nothing is displayed if cmus isn't running{ run_command, "%4s ", "pgrep -x cmus > /dev/null && (cmus-remote -C status | grep -q 'tag artist' && echo \"$(cmus-remote -C status | grep -oP '(?<=tag artist ).*') - $(cmus-remote -C status | grep -oP '(?<=tag title ).*') $(cmus-remote -Q | grep 'status ' | awk '{print $2}' | grep -q 'paused' && echo \"II \" || echo \"▶️\") $(cmus-remote -Q | awk '/position/ {pos=$2} /duration/ {dur=$2} END {printf \"%d:%02d-%d:%02d\\n\", pos/60, pos%60, dur/60, dur%60}')\" || echo \"$(cmus-remote -C status | grep -oP '(?<=file ).*' | sed 's|.*/||; s|\\.[^.]*$||') $(cmus-remote -Q | grep 'status ' | awk '{print $2}' | grep -q 'paused' && echo \"II \" || echo \"▶️\") $(cmus-remote -Q | awk '/position/ {pos=$2} /duration/ {dur=$2} END {printf \"%d:%02d-%d:%02d\\n\", pos/60, pos%60, dur/60, dur%60}')\")" }
Uses a seperator instead of the playback status and time, as shown in this page's screenshots.
{ run_command, "%4s ", "pgrep -x cmus > /dev/null && (cmus-remote -C status | grep -q 'tag artist' && echo \"$(cmus-remote -C status | grep -oP '(?<=tag artist ).*') - $(cmus-remote -C status | grep -oP '(?<=tag title ).*') |\" || echo \"$(cmus-remote -C status | grep -oP '(?<=file ).*' | sed 's|.*/||; s|\\.[^.]*$||') |\")" },
Displays network status as:
{ run_command, "%4s ", "nmcli general status | grep -q -w \"connected\" && echo Online || (nmcli general status | grep -q \"connecting\" && echo ... || echo Offline)" },
Gets volume percentage from amixer
{ run_command, "Vol: %4s ", "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" },
Gets package count from pacman
{ run_command, "Pkg:%4s " , "pacman -Qq | wc -l"},
Default commented-out reference examples redacted.
By default .zshrc
is located at ~/.zshrc
along with other zsh configuration files, this command will set ~/.config/zsh
as the default directory for zsh configuration: export ZDOTDIR=$HOME/.config/zsh