This commit is contained in:
2021-04-19 14:21:56 +02:00
parent 7122968b55
commit dc7a8d4aef
12 changed files with 74 additions and 25 deletions
+1 -2
View File
@@ -6,9 +6,8 @@ output eDP-1
off
output DP-2
crtc 1
gamma 0.909:0.833:0.769
mode 3840x2160
pos 0x0
rate 60.00
scale 1.7x1.7
scale 0.7x0.7
transform 1.699997,0.000000,0.000000,0.000000,1.699997,0.000000,0.000000,0.000000,1.000000
@@ -1,5 +0,0 @@
# /bin/bash
xset s noblank
xset s 300
xset -dpms
xset s on
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
polybar_auto_hide_timer_name=polybar_auto_hide.timer
function auto_hide_polybar() {
if [[ $1 == "true" ]]; then
systemd-run --user --on-calendar="*:0/1" --unit=$polybar_auto_hide_timer_name /usr/bin/polybar-msg cmd show || true
else
systemctl --user stop $polybar_auto_hide_timer_name || true
fi
}
current_profile=$(autorandr | grep '1st match' | awk '{print $1;}')
echo "Switching to $current_profile"
if [[ "$current_profile" == *'oled'* ]]; then
echo "OLED Display detected"
# setup screen saver
xset s noblank
xset s 300
xset -dpms
xset s on
# add timer to auto hide polybar
auto_hide_polybar "true"
else
# remote auto hide of polybar timer
auto_hide_polybar "false"
fi
xmonad --restart
echo "Done!"