Files
dotfiles/dwm/dwmblocks/status-bar/redshift.sh
T
2022-06-03 14:33:21 +02:00

22 lines
409 B
Bash
Executable File

#!/bin/bash
pid=$(pidof redshift)
case $BUTTON in
1)
if [ ! "$pid" = "" ]; then
kill -9 $pid
redshift -x > /dev/null 2> /dev/null &
pid=""
else
redshift -l $(curl -s "https://location.services.mozilla.com/v1/geolocate?key=geoclue" | awk 'OFS=":" {print $3,$5}' | tr -d ',}') > /dev/null 2> /dev/null &
pid="1"
fi;;
esac
if [ "$pid" = "" ]; then
echo "^C11^^d^"
else
echo "^C11^^d^"
fi