diff --git a/sway/gammastep.pl b/sway/gammastep.pl index 22b1f58..3d6e80f 100755 --- a/sway/gammastep.pl +++ b/sway/gammastep.pl @@ -17,7 +17,7 @@ unless ($pid) { open STDOUT, '>>/dev/null'; open STDERR, '>>/dev/null'; - `gammastep -l $lat_lon -b 1:0.7`; + `gammastep -l $lat_lon -b 0.7:0.3`; } sub fetch_lat_lon diff --git a/waybar/waybar-gammastep.sh b/waybar/waybar-gammastep.sh new file mode 100755 index 0000000..5d0c16b --- /dev/null +++ b/waybar/waybar-gammastep.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +RUNNING=$(pgrep gammastep) + +if [[ $1 == 'toggle' ]]; then + echo "toggling" + if [ "$RUNNING" ]; then + kill -9 $RUNNING 2&>1 /dev/null + else + $HOME/scripts/sway/gammastep.pl + fi + RUNNING=$(pgrep gammastep) +fi + + +if [ "$RUNNING" ]; then + echo '{"text":"ɣ","icon":"ɣ","tooltip":"Disable Gammastep","class":"enabled"}' +else + echo '{"text":"ɣ","icon":"ɣ","tooltip":"Enable Gammastep","class":"disabled"}' +fi