#!/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