Skip to content

Instantly share code, notes, and snippets.

@hauleth
Created December 25, 2013 23:25
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hauleth/8127857 to your computer and use it in GitHub Desktop.
Save hauleth/8127857 to your computer and use it in GitHub Desktop.
#!/bin/sh
SEP=
SEPE=
CLOCK=⌚
CALENDAR=☼
MUSIC=♫
WIDTH=${1}
SMALL=80
MEDIUM=140
if [ "$WIDTH" -gt "$MEDIUM" ]; then
if type mpc >/dev/null; then
MPD="#[fg=colour252,bg=default,nobold,noitalics,nounderscore]$SEP#[fg=colour16,bg=colour252,bold,noitalics,nounderscore] $MUSIC $(mpc current)"
date_colour='colour252'
fi
fi
if [ "$WIDTH" -ge "$SMALL" ]; then
UNAME="#[fg=colour252,bg=colour236,nobold,noitalics,nounderscore]$SEP#[fg=colour16,bg=colour252,bold,noitalics,nounderscore] $(uname -n)"
fi
DATE="#[fg=colour236,bg=${date_colour:-default},nobold,noitalics,nounderscore]$SEP#[fg=colour247,bg=colour236,nobold,noitalics,nounderscore] $CALENDAR $(date +'%D')"
TIME="#[fg=colour241,bg=colour236,nobold,noitalics,nounderscore]$SEPE#[fg=colour252,bg=colour236,bold,noitalics,nounderscore] $CLOCK $(date +'%H:%M')"
echo "$MPD $DATE $TIME $UNAME " | sed 's/ *$/ /g'
@Dan1jel
Copy link

Dan1jel commented Feb 6, 2021

This needs to be updated because it gives an error. Awesome work otherwise. Would like to have something highlighted when PREFIX key is pressed. But other then that, great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment