diff --git a/rofi/rofi-sway-rotate.sh b/rofi/rofi-sway-rotate.sh new file mode 100755 index 0000000..4e617f9 --- /dev/null +++ b/rofi/rofi-sway-rotate.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Passwordless sudo required + +res=$(echo "Rotate 0 (Normal)|Rotate 90 (Keyboard right)|Rotate 180 (Upside-down)|Rotate 270 (Keyborad left)" | rofi -sep "|" -dmenu -i -p 'P ' "" -columns 9 -width 45 -l 1 -config /home/jpm/.config/rofi/config.rasi -theme /home/jpm/.config/rofi/sidebar.rasi -hide-scrollbar -eh 1 -location 0 -auto-select -no-fullscreen) +if [[ $res == "Rotate 0 (Normal)" ]]; then + swaymsg output eDP-1 transform 0 +elif [[ $res == "Rotate 90 (Keyboard right)" ]]; then + swaymsg output eDP-1 transform 90 +elif [[ $res == "Rotate 180 (Upside-down)" ]]; then + swaymsg output eDP-1 transform 180 +elif [[ $res == "Rotate 270 (Keyboard left)" ]]; then + swaymsg output eDP-1 transform 270 +else + exit +fi