Consistency of dmenu scripts.

This commit is contained in:
Bartek Stalewski 2021-08-24 23:38:44 +02:00
parent b8958a9aad
commit 5002db57b2
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ set_input() {
sinks=$(pactl list sinks | awk -F':' '/Description:/ {print $2}')
sources=$(pactl list sources | grep -v 'Monitor of ' | awk -F':' '/Description:/ {print $2}')
[ "$(echo "$sinks" | wc -l)" -lt 2 ] &&
{ notify-send "🔊 Nothing to switch to."; exit; }
{ notify-send "🔊 nothing to switch"; exit; }
chosen=$(printf "output\\ninput" | dmenu -i -p "change")
case "$chosen" in

View File

@ -48,7 +48,7 @@ screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
# If there's only one screen
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
{ onescreen "$screens"; postrun; notify-send "💻 Nothing to switch to."; exit ;}
{ onescreen "$screens"; postrun; notify-send "💻 nothing to switch"; exit ;}
# Get user choice including both and manual selection:
chosen=$(printf -- "home-1\\nhome-2\\n----\\n%s\\n----\\nmulti" "$screens" | dmenu -l 20 -i -p "display") &&

View File

@ -1,12 +1,12 @@
#!/bin/sh
chosen=$(cut -d ';' -f1 ~/.local/share/emoji | dmenu -i -l 30 | sed "s/ .*//")
chosen=$(cut -d ';' -f1 ~/.local/share/emoji | dmenu -l 30 -p emoji | sed "s/ .*//")
[ -z "$chosen" ] && exit
if [ -n "$1" ]; then
xdotool type "$chosen"
else
printf "$chosen" | xsel -l /dev/null
notify-send "'$chosen' copied to clipboard." &
notify-send "'$chosen' copied to clipboard" &
fi