From 9e1089e6a398a437d132baef11b619e75476c23d Mon Sep 17 00:00:00 2001 From: Eric Phillips Date: Fri, 26 Oct 2018 09:55:10 -0600 Subject: [PATCH] multi display script --- hdmi-plug.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 hdmi-plug.sh diff --git a/hdmi-plug.sh b/hdmi-plug.sh new file mode 100755 index 0000000..5dd7d3a --- /dev/null +++ b/hdmi-plug.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +status=$(cat /sys/class/drm/card0-HDMI-A-1/status) + +if [ $status = 'connected' ]; then + xrandr --output eDP-1 --auto --output HDMI-1 --auto --scale 2x2 --right-of eDP-1 + twmnc -t 'display' -c 'HDMI plugged' +else + xrandr --output HDMI-1 --off + twmnc -t 'display' -c 'HDMI unplugged' +fi