Rofi screen rotation prompt

This commit is contained in:
John Mertz 2021-12-31 11:04:49 -05:00 committed by John Mertz
parent f13778fe52
commit b17582621b
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
1 changed files with 16 additions and 0 deletions

16
rofi/rofi-sway-rotate.sh Executable file
View File

@ -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