aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/rofidisplay
diff options
context:
space:
mode:
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