Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- RES="$1"
- #p.e. RES=640x480@60Hz
- CMD=${@:2}
- ACTIVE_OUTPUT=$(swaymsg -t get_outputs -r | egrep "name|focused" | grep -C 1 '"focused": true' | head -n 1 | sed 's/.*name": "\(.*\)".$/\1/g' )
- #RESOLUTION=$(xdpyinfo | awk '/dimensions:/ { print $2 }')
- CUR_RESOLUTION=$(swaymsg -t get_outputs --pretty | grep 'focused' -C 2 | grep "Current mode" | sed "s/.*:\(.*\)$/\1/"| tr -d ' ')
- wlr-randr --output $ACTIVE_OUTPUT --custom-mode $RES
- $CMD &
- PID=$!
- sleep 1
- WID=$(xdotool search -all --pid $PID)
- xdotool set_window --class "fullscreenapp" $WID
- swaymsg "[class=\"fullscreenapp\"]" fullscreen enable
- wait "$PID"
- wlr-randr --output $ACTIVE_OUTPUT --custom-mode $CUR_RESOLUTION
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement