Skip to content

Instantly share code, notes, and snippets.

@Bandie
Created October 29, 2016 21:48
Show Gist options
  • Save Bandie/6e3582a14a1f31f7e1674c3704946a46 to your computer and use it in GitHub Desktop.
Save Bandie/6e3582a14a1f31f7e1674c3704946a46 to your computer and use it in GitHub Desktop.
i3status stuff
#!/bin/bash
# Installation:
# Move this script into ~/.i3/
#
# In ~/.i3/config:
# bar {
# status_command ~/.i3/status.sh
# }
#
#
# Feel free to add more stuff.
#
i3status | ( while :
do
read line
## Summer / Wintertime - Set your time to UTC!
st=$(TZ=CET date +%Z)
if [ $st = "CEST" ]
then
st=",{\"full_text\": \"+2\"}"
else
st=",{\"full_text\": \"+1\"}"
fi
## Order
order="${st}"
## Scriptstuff
if [[ "${line}" =~ .*version.* ]] || [ -z "${line}" ] || [[ "${line}" = "[" ]]
then
line=${line}
else
line=$(echo ${line} | sed 's/]//g')
line=${line}${order}
fi
echo "${line}" || exit 1
done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment