mirror of
https://github.com/rileyrg/linux-init.git
synced 2024-09-29 05:37:29 +02:00
modified sway-screen-menu to use variables unlikely to clash
This commit is contained in:
parent
ee6a13375d
commit
264b385f1c
3 changed files with 18 additions and 18 deletions
12
README.md
12
README.md
|
@ -1627,12 +1627,12 @@ swaymsg "output ${m} ${1:-enable}"
|
|||
```bash
|
||||
#!/usr/bin/bash
|
||||
# Maintained in linux-config.org
|
||||
SCREEN=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled")
|
||||
if [ ! -z "$SCREEN" ]; then
|
||||
ENABLED="$(zenity --list --title "Enable ${SCREEN}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)"
|
||||
if [ ! -z "$ENABLED" ]; then
|
||||
swaymsg "output $SCREEN $ENABLED"
|
||||
command -v notify-send &> /dev/null && (sleep 0.5 && notify-send -t 3000 "$SCREEN:$ENABLED") &
|
||||
s=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled")
|
||||
if [ ! -z "$s" ]; then
|
||||
e="$(zenity --list --title "Enable ${SCREEN}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)"
|
||||
if [ ! -z "$e" ]; then
|
||||
swaymsg "output $s $e"
|
||||
command -v notify-send &> /dev/null && (sleep 0.5 && notify-send -t 3000 "$s:$e") &
|
||||
fi
|
||||
fi
|
||||
```
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#!/usr/bin/bash
|
||||
# Maintained in linux-config.org
|
||||
SCREEN=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled")
|
||||
if [ ! -z "$SCREEN" ]; then
|
||||
ENABLED="$(zenity --list --title "Enable ${SCREEN}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)"
|
||||
if [ ! -z "$ENABLED" ]; then
|
||||
swaymsg "output $SCREEN $ENABLED"
|
||||
command -v notify-send &> /dev/null && (sleep 0.5 && notify-send -t 3000 "$SCREEN:$ENABLED") &
|
||||
s=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled")
|
||||
if [ ! -z "$s" ]; then
|
||||
e="$(zenity --list --title "Enable ${SCREEN}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)"
|
||||
if [ ! -z "$e" ]; then
|
||||
swaymsg "output $s $e"
|
||||
command -v notify-send &> /dev/null && (sleep 0.5 && notify-send -t 3000 "$s:$e") &
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -2071,12 +2071,12 @@ Just a gathering place of locky/suspendy type things...
|
|||
#+begin_src bash :tangle "~/bin/sway/sway-screen-menu"
|
||||
#!/usr/bin/bash
|
||||
# Maintained in linux-config.org
|
||||
SCREEN=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled")
|
||||
if [ ! -z "$SCREEN" ]; then
|
||||
ENABLED="$(zenity --list --title "Enable ${SCREEN}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)"
|
||||
if [ ! -z "$ENABLED" ]; then
|
||||
swaymsg "output $SCREEN $ENABLED"
|
||||
command -v notify-send &> /dev/null && (sleep 0.5 && notify-send -t 3000 "$SCREEN:$ENABLED") &
|
||||
s=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled")
|
||||
if [ ! -z "$s" ]; then
|
||||
e="$(zenity --list --title "Enable ${SCREEN}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)"
|
||||
if [ ! -z "$e" ]; then
|
||||
swaymsg "output $s $e"
|
||||
command -v notify-send &> /dev/null && (sleep 0.5 && notify-send -t 3000 "$s:$e") &
|
||||
fi
|
||||
fi
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in a new issue