aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/rofidisplay
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin/rofidisplay')
-rwxr-xr-xdotfiles/.local/bin/rofidisplay14
1 files changed, 14 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/rofidisplay b/dotfiles/.local/bin/rofidisplay
new file mode 100755
index 0000000..9d1e5ec
--- /dev/null
+++ b/dotfiles/.local/bin/rofidisplay
@@ -0,0 +1,14 @@
+#!/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 "\0no-custom\x1ftrue\n"
+echo -ne "\0prompt\x1fToggle display\n"
+for d in $displays; do
+ echo -ne "$d\0icon\x1fdisplay\n"
+done