Skip to content

Instantly share code, notes, and snippets.

@erhan-
Created March 12, 2013 12:54
Show Gist options
  • Save erhan-/5142653 to your computer and use it in GitHub Desktop.
Save erhan-/5142653 to your computer and use it in GitHub Desktop.
My dwmstatus
#!/bin/bash
#while true; do
#statements
# xsetroot -name "$(acpi +d'%d') $(date)"
# sleep 5
#done
while true; do
akku=$(acpi +d'%d' | awk '{gsub("[%,]","");print $4}')
if [[ $akku -eq 5 ]]; then
notify-send -u critical "Achtung! Akku bei $akku %."
fi
# if [[ $akku < 2 ]]; then
# sudo pm-suspend
# fi
xsetroot -name "$(echo -e '\ue00E') $(free -m | grep 'buffers/cache' | awk '{print $3" MB / " $4" MB"}') | $(echo -e '\ue00E') $akku % | $(echo -e '\ue00E') $( date +"%F %R" )"
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment