From b2314f658192ee567ca3a8a937cd1cccb08ad254 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sat, 15 Sep 2018 17:24:15 +0200 Subject: [PATCH] Add script to switch screens --- .config/i3/config | 3 +++ bin/switch_monitors.sh | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100755 bin/switch_monitors.sh diff --git a/.config/i3/config b/.config/i3/config index 6c8d267..f5c3fee 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -157,6 +157,9 @@ exec --no-startup-id $HOME/bin/startconky.sh # Redshift exec --no-startup-id redshift || redshift -l 48.15:17.10 +# Switch display output +exec --no-startup-id $HOME/bin/switch_monitors.sh + # Launch Nemo bindsym $mod+n exec nemo diff --git a/bin/switch_monitors.sh b/bin/switch_monitors.sh new file mode 100755 index 0000000..5308395 --- /dev/null +++ b/bin/switch_monitors.sh @@ -0,0 +1,9 @@ +#!/bin/bash +intern=eDP-1 +extern=HDMI-1 + +if xrandr | grep "$extern disconnected"; then + xrandr --output "$extern" --off --output "$intern" --auto +else + xrandr --output "$intern" --off --output "$extern" --auto +fi