yubikey-touch-detector can now properly use Notify widget without helpers.
This commit is contained in:
parent
f340ed7c15
commit
00a2734c84
8 changed files with 5 additions and 20 deletions
|
@ -47,7 +47,7 @@ show_current() {
|
|||
chosen=$(printf "Output: $def_snk\\nInput: $def_src" | dmenu -c -l 2)
|
||||
if [ "$1" = "no_switch" ]; then
|
||||
case "$chosen" in
|
||||
*) notify-send -u critical "婢 no device to switch" ;;
|
||||
*) notify-send -t 2000 -u critical "婢 no device to switch" ;;
|
||||
esac
|
||||
else
|
||||
case "$chosen" in
|
||||
|
|
|
@ -51,7 +51,7 @@ screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
|
|||
|
||||
# If there's only one screen
|
||||
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
|
||||
{ onescreen "$screens" "native"; postrun; notify-send -u critical ' no device to switch'; exit ;}
|
||||
{ onescreen "$screens" "native"; postrun; notify-send -t 2000 -u critical ' no device to switch'; exit ;}
|
||||
|
||||
# Get user choice including both and manual selection:
|
||||
chosen=$(printf -- "%s\\nmulti" "$screens" | dmenu -c -l 5 -i -p "select output") &&
|
||||
|
|
|
@ -7,5 +7,5 @@ if [ -n "$1" ]; then
|
|||
xdotool type "$chosen"
|
||||
else
|
||||
printf "$chosen" | xclip -rmlastnl
|
||||
notify-send "'$chosen' copied to clipboard" &
|
||||
notify-send -t 2000 "'$chosen' copied to clipboard" &
|
||||
fi
|
||||
|
|
|
@ -6,7 +6,7 @@ if [ $1 ]; then
|
|||
dec) pactl set-sink-volume @DEFAULT_SINK@ -5%;;
|
||||
esac
|
||||
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}')
|
||||
notify-send -u low "volume: $volume"
|
||||
notify-send -t 2000 -u low "volume: $volume"
|
||||
else
|
||||
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
|
||||
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micmute="\uf131" || micmute=""
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
case $(cat $XDG_CACHE_HOME/yubikey.status) in
|
||||
*_1) printf "touch the yubikey" ;;
|
||||
*) printf "" ;;
|
||||
esac
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
yubikey-touch-detector --stdout 2>/dev/null| while read cmd; do echo $cmd > $XDG_CACHE_HOME/yubikey.status; done
|
|
@ -127,16 +127,10 @@ screens = [
|
|||
record_history=False,
|
||||
),
|
||||
widget.Spacer(),
|
||||
widget.GenPollCommand(
|
||||
widget.Notify(
|
||||
background='#e8b923',
|
||||
foreground='#000000',
|
||||
font='RobotoMono Nerd Font Bold',
|
||||
update_interval=0.5,
|
||||
cmd="sb-yubikey",
|
||||
),
|
||||
widget.Spacer(),
|
||||
widget.Notify(
|
||||
default_timeout=2,
|
||||
),
|
||||
widget.GenPollCommand(
|
||||
background='#005577',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue