summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hdmi10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/hdmi b/bin/hdmi
new file mode 100755
index 0000000..f5f7b1f
--- /dev/null
+++ b/bin/hdmi
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Toggle auxiliary HDMI screen on/off when connected/disconnected.
+opt="--auto --right-of eDP-1"
+
+# Also add the following rule to /etc/udev/rules.d/hdmi.rules
+# KERNEL=="card0", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/marc/.Xauthority", RUN+="/home/marc/bin/hdmi"
+
+xrandr | grep -q 'HDMI-1 connected' || opt="--off"
+xrandr --output HDMI-1 $opt