Skip to content

Instantly share code, notes, and snippets.

@smlb
Created July 23, 2017 15:34
Show Gist options
  • Save smlb/9e07caca52a20ef87f810eff7d6e0181 to your computer and use it in GitHub Desktop.
Save smlb/9e07caca52a20ef87f810eff7d6e0181 to your computer and use it in GitHub Desktop.
i3status | (read line && echo $line && read line && echo $line && while :
do
read line
vars=`echo -e "$([[ -z $(mpc current) ]] && echo -e "" || echo -e " $(mpc current)|")$(free -m | awk '/Mem/ {print $3}')Mb"`
text="[{ \"full_text\": \"${vars}\" },"
echo "${line/[/$text}" || exit 1
done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment