Fix some issues
This commit is contained in:
parent
b827471e6d
commit
fb1e41ddc4
4 changed files with 10 additions and 15 deletions
11
ts-control
11
ts-control
|
@ -46,12 +46,16 @@ _ts_control_fetch() {
|
|||
}
|
||||
|
||||
_ts_control_single_or_dmenu() {
|
||||
options=$(echo "$1" | grep "$2")
|
||||
filter="$2"
|
||||
if [ "$filter" == "^$" ]; then
|
||||
filter=""
|
||||
fi
|
||||
options=$(echo "$1" | grep "$filter")
|
||||
count=$(echo "$options" | wc -l)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
echo "$options"
|
||||
else
|
||||
echo "$options" | $DMENU
|
||||
echo "$1" | $DMENU
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -90,8 +94,7 @@ handle_ntfy_events() {
|
|||
done
|
||||
}
|
||||
|
||||
# Add '$' to $1 to add 'End of line' to the regex for grep
|
||||
action=$(_ts_control_single_or_dmenu "$actions" "$1$")
|
||||
action=$(_ts_control_single_or_dmenu "$actions" "^$1$")
|
||||
|
||||
case $action in
|
||||
"quick")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue