mirror of https://github.com/tiyn/dotfiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
602 B
24 lines
602 B
#!/bin/sh
|
|
|
|
# toggle external monitor
|
|
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
|
|
|
intern=LVDS1
|
|
extern=HDMI2
|
|
|
|
case "$1" in
|
|
toggle) (xrandr | grep "$extern disconnected")
|
|
(xrandr --listactivemonitors | grep $extern) || ((xrandr --output $extern --right-of $intern --auto && wallpaper desktop) & exit)
|
|
(xrandr --listactivemonitors | grep $extern) && xrandr --output $extern --off
|
|
wallpaper desktop
|
|
;;
|
|
*) cat << EOF
|
|
monitor: cli script to enable and disable monitors.
|
|
|
|
Allowed options:
|
|
toggle Toggle the set monitor on and off
|
|
all else Print this message
|
|
|
|
EOF
|
|
esac
|