-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added ZSH completions * Fixed single quote ending string * Added Bash completions * Added bash to meson.build * Added bash variable to meson_options.txt * Added fish shell completions
- Loading branch information
1 parent
bf9309b
commit e85c2f5
Showing
9 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,8 @@ | |
pkg | ||
build | ||
SwayNotificationCenter | ||
swaync | ||
swaync* | ||
./swaync | ||
./swaync* | ||
./src/swaync | ||
./src/swaync* | ||
swaync-git* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
_swaync() { | ||
local cur prev | ||
_get_comp_words_by_ref cur prev | ||
|
||
short=( | ||
-h | ||
-s | ||
-c | ||
) | ||
|
||
long=( | ||
--help | ||
--style | ||
--config | ||
) | ||
case $prev in | ||
-s | --style) | ||
_filedir | ||
return | ||
;; | ||
-c | --config) | ||
_filedir | ||
return | ||
;; | ||
esac | ||
|
||
if [[ $cur == --* ]]; then | ||
COMPREPLY=($(compgen -W "${long[*]}" -- "$cur")) | ||
elif [[ $cur == -* ]]; then | ||
COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) | ||
COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) | ||
else | ||
COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) | ||
COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) | ||
COMPREPLY+=($(compgen -c -- "$cur")) | ||
fi | ||
|
||
} && complete -F _swaync swaync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
_swaync-client() { | ||
local cur prev | ||
_get_comp_words_by_ref cur prev | ||
|
||
short=( | ||
-h | ||
-R | ||
-rs | ||
-t | ||
-d | ||
-D | ||
-c | ||
-C | ||
-sw | ||
-s | ||
) | ||
|
||
long=( | ||
--help | ||
--reload-config | ||
--reload-css | ||
--toggle-panel | ||
--toggle-dnd | ||
--get-dnd | ||
--count | ||
--close-all | ||
--skip-wait | ||
--subscribe | ||
) | ||
case $prev in | ||
-s | --style) | ||
_filedir | ||
return | ||
;; | ||
-c | --config) | ||
_filedir | ||
return | ||
;; | ||
esac | ||
|
||
if [[ $cur == --* ]]; then | ||
COMPREPLY=($(compgen -W "${long[*]}" -- "$cur")) | ||
elif [[ $cur == -* ]]; then | ||
COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) | ||
COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) | ||
else | ||
COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) | ||
COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) | ||
COMPREPLY+=($(compgen -c -- "$cur")) | ||
fi | ||
|
||
} && complete -F _swaync-client swaync-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
complete -f -c swaync-client | ||
complete -c swaync-client -s h -l help --description "Show help options" | ||
complete -c swaync-client -s R -l reload-config --description "Reload the config file" -r | ||
complete -c swaync-client -s rs -l reload-css --description "Reload the css file. Location change requires restart" -r | ||
complete -c swaync-client -s t -l toggle-panel --description "Toggle the notificaion panel" -r | ||
complete -c swaync-client -s d -l toggle-dnd --description "Toggle and print the current dnd state" -r | ||
complete -c swaync-client -s D -l get-dnd --description "Print the current dnd state" -r | ||
complete -c swaync-client -s c -l count --description "Print the current notificaion count" -r | ||
complete -c swaync-client -s C -l close-all --description "Closes all notifications" -r | ||
complete -c swaync-client -s sw -l skip-wait --description "Doesn't wait when swaync hasn't been started" -r | ||
complete -c swaync-client -s s -l subscribe --description "Subscribe to notificaion add and close events" -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
complete -f -c swaync | ||
complete -c swaync -s h -l help --description "Show help options" | ||
complete -c swaync -s s -l style --description "Use a custom Stylesheet file" -r | ||
complete -c swaync -s c -l config --description "Use a custom config file" -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#compdef swaync | ||
|
||
_arguments -s \ | ||
'(-h --help)'{-h,--help}'[Show help options]' \ | ||
'(-s --style)'{-s,--style}'[Use a custom Stylesheet file]:files:_files' \ | ||
'(-c --config)'{-c,--config}'[Use a custom config file]:files:_files' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#compdef swaync-client | ||
|
||
_arguments -s \ | ||
'(-h --help)'{-h,--help}'[Show help options]' \ | ||
'(-R --reload-config)'{-R --reload-config}'[Reload the config file]' \ | ||
'(-rs --reload-css)'{-rs --reload-css}'[Reload the css file. Location change requires restart]' \ | ||
'(-t --toggle-panel)'{-t --toggle-panel}'[Toggle the notificaion panel]' \ | ||
'(-d --toggle-dnd)'{-d --toggle-dnd}'[Toggle and print the current dnd state]' \ | ||
'(-D --get-dnd)'{-D --get-dnd}'[Print the current dnd state]' \ | ||
'(-c --count)'{-c --count}'[Print the current notificaion count]' \ | ||
'(-C --close-all)'{-C --close-all}'[Closes all notifications]' \ | ||
'(-sw --skip-wait)'{-sw --skip-wait}"[Doesn't wait when swaync hasn't been started]" \ | ||
'(-s --subscribe)'{-s --subscribe}'[Subscribe to notificaion add and close events]' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') | ||
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') | ||
option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters