diff options
-rw-r--r-- | completions/bash/swaybar | 2 | ||||
-rw-r--r-- | completions/zsh/_swaybar | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/completions/bash/swaybar b/completions/bash/swaybar index 504588f1..1e085c65 100644 --- a/completions/bash/swaybar +++ b/completions/bash/swaybar @@ -27,7 +27,7 @@ _swaybar() return ;; -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")) return ;; diff --git a/completions/zsh/_swaybar b/completions/zsh/_swaybar index 4fdfdd8a..af2cee95 100644 --- a/completions/zsh/_swaybar +++ b/completions/zsh/_swaybar @@ -3,7 +3,7 @@ # 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 \ '(-h --help)'{-h,--help}'[Show help message and quit]' \ |