scripts/rofi/rofi-sway-rotate.sh

17 lines
738 B
Bash
Executable File

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