From 1ad481be138e92213bc237bfbdbb31e60573fe21 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Fri, 31 Dec 2021 11:04:49 -0500 Subject: [PATCH] Rofi screen rotation prompt --- rofi/rofi-sway-rotate.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 rofi/rofi-sway-rotate.sh 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