mirror of
https://github.com/lordmathis/dotfiles.git
synced 2025-11-06 09:44:25 +00:00
Housekeeping
This commit is contained in:
24
bin/xrandr/monitor_setup.sh
Executable file
24
bin/xrandr/monitor_setup.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
intern=eDP-1
|
||||
extern=HDMI-1
|
||||
|
||||
case $1 in
|
||||
"single")
|
||||
if xrandr | grep "$extern disconnected"; then
|
||||
xrandr --output "$extern" --off --output "$intern" --auto
|
||||
else
|
||||
xrandr --output "$intern" --off --output "$extern" --auto
|
||||
fi
|
||||
;;
|
||||
"dual")
|
||||
if xrandr | grep "$extern disconnected"; then
|
||||
xrandr --output "$extern" --off --output "$intern" --auto
|
||||
else
|
||||
xrandr --output $extern --primary
|
||||
xrandr --output $extern --left-of $intern
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
i3-msg restart
|
||||
21
bin/xrandr/switch_monitors.sh
Executable file
21
bin/xrandr/switch_monitors.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
intern=eDP-1
|
||||
extern=HDMI-1
|
||||
|
||||
case $1 in
|
||||
"-i")
|
||||
m=$intern
|
||||
;;
|
||||
"-e")
|
||||
m=$extern
|
||||
;;
|
||||
*)
|
||||
echo "Wrong option"
|
||||
esac
|
||||
|
||||
if xrandr --listactivemonitors | grep "$m"; then
|
||||
xrandr --output "$m" --off
|
||||
else
|
||||
xrandr --output "$m" --auto
|
||||
fi
|
||||
Reference in New Issue
Block a user