From aa661ce61b9f3ff83615d4da8b6b782a7bbaa3c4 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Tue, 10 Sep 2024 18:25:25 -0700 Subject: Initial gitignore and wlroots session management --- .config/sway/fix_sway.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .config/sway/fix_sway.sh (limited to '.config/sway/fix_sway.sh') diff --git a/.config/sway/fix_sway.sh b/.config/sway/fix_sway.sh new file mode 100755 index 0000000..61a3d72 --- /dev/null +++ b/.config/sway/fix_sway.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +sway "$( + swaymsg -p -t get_outputs \ + | sway-output-parse.sh --mode \ + | sed -ne s/1024x768@.........Hz/1280x1024@60Hz/p \ + | head -n 1 +)" + +# shove the last active unnamed DP monitor downward by a monitor's-worth + +dp_regex="^output +(DP-[0-9]) +mode +--custom +1280x1024@.+Hz +pos +([0-9]+) +([0-9]+)" + +IFS=$'\n' + +line="$( swaymsg -p -t get_outputs | sway-output-parse.sh --basic | egrep " DP-[0-9] +mode " | tail -n 1 )" + +if [[ "$line" =~ $dp_regex ]]; then + sway "output "${BASH_REMATCH[1]}" pos $(( ${BASH_REMATCH[2]} )) $(( ${BASH_REMATCH[3]} + 1024 ))" +fi -- cgit v1.2.3