Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 51 lines (46 sloc) 893 Bytes
#!/bin/sh
#
# Switch between light and dark mode.
#
# set -e
golight() {
rm -f ~/.config/darkmode
if [ $(which hsetroot) ]; then
hsetroot -tile ~/.config-xmonad/bgbitmap-light.png
else
xsetroot -bitmap ~/.config-xmonad/bgbitmap -bg '#fdf6e3' -fg '#93a1a1'
fi
panels
xrdb ~/.config-xmonad/xresources/light
xmonad --restart
}
godark() {
[ ! $(id -u) -eq 0 ] && touch ~/.config/darkmode
if [ $(which hsetroot) ]; then
hsetroot -tile ~/.config-xmonad/bgbitmap-dark.png
else
xsetroot -bitmap ~/.config-xmonad/bgbitmap -bg '#002b36' -fg '#586e75'
fi
panels
xrdb ~/.config-xmonad/xresources/dark
xmonad --restart
}
cmd=${1}
case $cmd in
l|light)
golight
;;
d|dark)
godark
;;
t|toggle|*)
if [ -e ~/.config/darkmode ]; then
golight
else
godark
fi
;;
esac
# Local Variables:
# eval: (rainbow-mode)
# End: