summaryrefslogtreecommitdiffstats
path: root/disconnect-screen
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2024-10-14 21:34:04 +0200
committerFlorian Pritz <bluewind@xinu.at>2024-10-14 21:54:03 +0200
commitd5ffb01d87852eb74f6b17ae06ac0c476010065b (patch)
tree1ac6a86d874f30c968ba26bf0f8a5954fa0c67a6 /disconnect-screen
parentd10ee7703e20ef844907e90797ad66bf0fb984da (diff)
downloadbin-d5ffb01d87852eb74f6b17ae06ac0c476010065b.tar.gz
bin-d5ffb01d87852eb74f6b17ae06ac0c476010065b.tar.xz
Add new scripts
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'disconnect-screen')
-rwxr-xr-xdisconnect-screen15
1 files changed, 15 insertions, 0 deletions
diff --git a/disconnect-screen b/disconnect-screen
new file mode 100755
index 0000000..2ec148e
--- /dev/null
+++ b/disconnect-screen
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+
+displays=(
+ $(xrandr | sed -rn 's#^([^ ]+) connected.*#\1#p' | grep -v '^eDP-1$')
+ $(xrandr | sed -rn 's#^([^ ]+) disconnected primary [0-9].*#\1#p' | grep -v '^eDP-1$')
+ $(xrandr | sed -rn 's#^([^ ]+) disconnected [0-9].*#\1#p' | grep -v '^eDP-1$')
+)
+
+for display in "${displays[@]}"; do
+ xrandr --output "$display" --off
+done
+
+xrandr --output eDP1 --primary
+xrandr --output eDP-1 --primary