From 52cf8a73858df9c5bd447a3de348aa3e9799ba99 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Fri, 20 Aug 2021 12:59:27 +0200 Subject: [PATCH] Support for both displayports for home. --- _suckless/_scripts/rofi_display | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_suckless/_scripts/rofi_display b/_suckless/_scripts/rofi_display index e6dd73d..938c287 100755 --- a/_suckless/_scripts/rofi_display +++ b/_suckless/_scripts/rofi_display @@ -27,7 +27,7 @@ twoscreen() { } home() { - xrandr --output "DisplayPort-0" --mode 2560x1440 $(echo "$allposs" | grep -v "\bDisplayPort-0" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -) + xrandr --output "DisplayPort-${1}" --mode 2560x1440 $(echo "$allposs" | grep -v "\bDisplayPort-${1}" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -) } onescreen() { @@ -50,9 +50,10 @@ screens=$(echo "$allposs" | awk '/ connected/ {print $1}') { onescreen "$screens"; postrun; exit ;} # Get user choice including both and manual selection: -chosen=$(printf -- "home\\n----\\n%s\\n----\\nmulti" "$screens" | rofi -dmenu -i -p "Select display arangement") && +chosen=$(printf -- "home-1\\nhome-2\\n----\\n%s\\n----\\nmulti" "$screens" | rofi -dmenu -i -p "Select display arangement") && case "$chosen" in - "home") home ;; + "home-1") home 0 ;; + "home-2") home 1 ;; "multi") twoscreen ;; "----") exit ;; *) onescreen "$chosen" ;;