From b8d9ff90aa40abfa4875625747e239504c18ba1f Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Sun, 26 Jun 2022 07:43:41 +0800 Subject: [PATCH] Added script that sets the primary monitor using xrandr. --- .config/scripts/sway/set-correct-monitor | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 .config/scripts/sway/set-correct-monitor diff --git a/.config/scripts/sway/set-correct-monitor b/.config/scripts/sway/set-correct-monitor new file mode 100755 index 0000000..6ecfbe1 --- /dev/null +++ b/.config/scripts/sway/set-correct-monitor @@ -0,0 +1,8 @@ +#!/bin/sh + +display=$(xrandr --listactivemonitors | grep "$1" | head -n1 | cut -d' ' -f6) + +if [ -n "$display" ]; then + xrandr --output $display --primary +fi +