Removed automatic monitor detection, switched to arandr

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-08-23 19:00:23 +02:00
parent 767910406f
commit 09459e602d
15 changed files with 67 additions and 149 deletions

View File

@@ -3,8 +3,6 @@
lower_battery_threshold=10
KBD="";
oldKBD="";
intern="eDP";
extern="HDMI-A-0";
function kb_routine {
oldKBD="$KBD";
@@ -30,29 +28,9 @@ function battery_routine {
fi
}
function monitor {
if xrandr | grep "$extern disconnected"; then
monstats="$intern"
else
monstats="$extern"
fi
if [ "$oldmonstats" != "$monstats" ]; then
oldmonstats="$monstats"
feh --randomize --bg-fill $HOME/Pictures/Wallpaper/basic/*;
dunstify -r 1 "Using $monstats.";
if [ "$monstats" == "$intern" ]; then
xrandr --output "$extern" --off --output "$intern" --auto;
else
xrandr --output "$intern" --off --output "$extern" --auto;
fi
fi
}
while :
do
kb_routine;
battery_routine;
monitor;
sleep 1;
done