From 540dc564788d370294631b2bc69b9a967c8e1611 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Thu, 25 Aug 2022 23:05:14 -0600 Subject: [PATCH] Gammastep waybar --- sway/gammastep.pl | 2 +- waybar/waybar-gammastep.sh | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 waybar/waybar-gammastep.sh 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