scripts/rofi/rofi-sway-rotate.sh

17 lines
738 B
Bash
Raw Permalink Normal View History

2021-12-31 16:04:49 +00:00
#!/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
2023-01-06 19:41:31 +00:00
swaymsg output eDP-1 transform 0
2021-12-31 16:04:49 +00:00
elif [[ $res == "Rotate 90 (Keyboard right)" ]]; then
2023-01-06 19:41:31 +00:00
swaymsg output eDP-1 transform 90
2021-12-31 16:04:49 +00:00
elif [[ $res == "Rotate 180 (Upside-down)" ]]; then
2023-01-06 19:41:31 +00:00
swaymsg output eDP-1 transform 180
2021-12-31 16:04:49 +00:00
elif [[ $res == "Rotate 270 (Keyboard left)" ]]; then
2023-01-06 19:41:31 +00:00
swaymsg output eDP-1 transform 270
2021-12-31 16:04:49 +00:00
else
2023-01-06 19:41:31 +00:00
exit
2021-12-31 16:04:49 +00:00
fi