aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/rofidisplay
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-05-17 06:10:02 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-05-17 06:10:02 +0300
commit484181c25cba61469254e24bff578cff5189c8a7 (patch)
tree6bb3b33b3c710467a6f0463912b929f2e039cd90 /dotfiles/.local/bin/rofidisplay
parent0b065dc2c0cae46c4f6151483249a682db122eb6 (diff)
downloadswayrice-484181c25cba61469254e24bff578cff5189c8a7.tar.gz
swayrice-484181c25cba61469254e24bff578cff5189c8a7.zip
WIP: move to rofi
Diffstat (limited to 'dotfiles/.local/bin/rofidisplay')
-rwxr-xr-xdotfiles/.local/bin/rofidisplay13
1 files changed, 13 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/rofidisplay b/dotfiles/.local/bin/rofidisplay
new file mode 100755
index 0000000..26f0f1a
--- /dev/null
+++ b/dotfiles/.local/bin/rofidisplay
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+if [ "$ROFI_RETV" != 0 ]; then
+ swaymsg output $1 toggle > /dev/null
+fi
+
+displays="$(swaymsg -t get_outputs | grep -E "name" |
+ sed "s/^.*\"name\": \"//g;s/\",$//g;")"
+
+echo -ne "\0prompt\x1fToggle display\n"
+for d in $displays; do
+ echo -ne "$d\0icon\x1fdisplay\n"
+done