Removed automatic monitor detection, switched to arandr
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user