From cf108f0037219b89f7cd2282da00bbb8c8d54648 Mon Sep 17 00:00:00 2001 From: tiynger Date: Mon, 28 Oct 2019 00:55:13 +0100 Subject: [PATCH] adding togglemonitor script --- .config/sxhkd/sxhkdrc | 2 ++ .local/bin/tools/togglemonitor | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100755 .local/bin/tools/togglemonitor diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 9c94cf3..007742f 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -45,6 +45,8 @@ super + x xournalpp #super + shift + z taken by i3 +super + F4 + togglemonitor super + F5 toggletouchpad super + F6 diff --git a/.local/bin/tools/togglemonitor b/.local/bin/tools/togglemonitor new file mode 100755 index 0000000..7861009 --- /dev/null +++ b/.local/bin/tools/togglemonitor @@ -0,0 +1,7 @@ +#!/bin/sh +# toggle external monitor +intern=LVDS-1 +extern=HDMI-1 +(xrandr | grep "$extern disconnected") && exit +(xrandr --listactivemonitors | grep $extern) || (xrandr --output $extern --right-of $intern --auto & exit) +(xrandr --listactivemonitors | grep $extern) && xrandr --output $extern --off