mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 07:26:55 +01:00
completion: use jq instead of sed for swaybar completion
This commit is contained in:
parent
cf00fb2ccc
commit
1450a9e9f9
2 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ _swaybar()
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
-b|--bar_id)
|
-b|--bar_id)
|
||||||
bars=($(swaymsg -t get_bar_config | sed -e '/^\[/,/\]$/{//d;s/^ *"\(.*\)",\?.*$/\1/}'))
|
bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
|
||||||
COMPREPLY=($(compgen -W "${bars[*]}" -- "$cur"))
|
COMPREPLY=($(compgen -W "${bars[*]}" -- "$cur"))
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Completion script for swaybar
|
# Completion script for swaybar
|
||||||
#
|
#
|
||||||
|
|
||||||
local bars=($(swaymsg -t get_bar_config | sed -e '/^\[/,/\]$/{//d;s/^ *"\(.*\)",\?.*$/\1/}'))
|
local bars=($(swaymsg -t get_bar_config | jq -r '.[]'))
|
||||||
|
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
'(-h --help)'{-h,--help}'[Show help message and quit]' \
|
'(-h --help)'{-h,--help}'[Show help message and quit]' \
|
||||||
|
|
Loading…
Reference in a new issue