From fcb146929792701bef161216038c2df41d4b82d9 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Tue, 21 Nov 2023 13:57:28 +0100 Subject: [PATCH] Update screen temperature script --- .bin/screen-temperature | 3 +++ .xmonad/xmonad.hs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.bin/screen-temperature b/.bin/screen-temperature index a613db4..ebc339e 100755 --- a/.bin/screen-temperature +++ b/.bin/screen-temperature @@ -43,6 +43,9 @@ try: subprocess.run(["redshift", "-O", str(new_temperature), "-P"], check=True) with open('/tmp/temperature', 'w') as temp_file: temp_file.write(str(new_temperature) + '\n') + # Send notification + subprocess.run( + ["notify-send", str(new_temperature) + "K"]) except subprocess.CalledProcessError: print("Error: could not set screen temperature.") sys.exit(1) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index b633ee9..0110923 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -256,8 +256,8 @@ pause = spawn "playerctl pause" brighten, dim, warm, cool, resetTemp :: X () brighten = spawn "brightnessctl set 20+" dim = spawn "brightnessctl set 20-" -warm = spawn "screen-temperature +50 && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything" -cool = spawn "screen-temperature -50 && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything" +warm = spawn "screen-temperature +50" +cool = spawn "screen-temperature -50" resetTemp = spawn "screen-temperature 3000" -- }}}