diff options
-rw-r--r-- | _papirus-folders | 56 | ||||
-rw-r--r-- | papirus-folders | 75 |
2 files changed, 0 insertions, 131 deletions
diff --git a/_papirus-folders b/_papirus-folders deleted file mode 100644 index ea572ec66fff..000000000000 --- a/_papirus-folders +++ /dev/null @@ -1,56 +0,0 @@ -#compdef papirus-folders -# -# @author: Sergei Eremenko (https://github.com/SmartFinn) -# @license: MIT license (MIT) -# @link: https://github.com/PapirusDevelopmentTeam/papirus-folders - -_get_colors() { - if ! command -v papirus-folders >/dev/null; then - _message "unable to find papirus-folders script" - return 1 - fi - - local -a colors=( $(papirus-folders -l | tr -d '>\n') ) - _wanted colors exlp 'color' compadd -- "${colors[@]}" - return 0 -} - -_get_themes() { - local data_dir icons_dir icon_theme - local -a data_dirs=() - local -a icons_dirs=( - "$HOME/.icons" - "${XDG_DATA_HOME:-$HOME/.local/share}/icons" - ) - - # Get data directories from XDG_DATA_DIRS variable and - # convert colon-separated list into bash array - IFS=: read -rA data_dirs <<< "${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - - for data_dir in "${data_dirs[@]}"; do - [ -d "$data_dir/icons" ] || continue - icons_dirs=( "${icons_dirs[@]}" "${data_dir:a}/icons" ) - done - - for icons_dir in "${icons_dirs[@]}"; do - for icon_theme in "$icons_dir"/*; do - [ -f "$icon_theme/48x48/places/folder-blue.svg" ] || continue - _wanted icon_theme expl 'icon-theme' compadd -- "${icon_theme:t}" - done - done - return 0 -} - -_arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-V --version)'{-V,--version}'[show version number and exit]' \ - '(-v --verbose)'{-v,--verbose}'[be verbose]' \ - '(-C --color)'{-C,--color}'[change color of folders]:color:_get_colors' \ - '(-D --default)'{-D,--default}'[back to the default color]' \ - '(-R --restore)'{-R,--restore}'[restore the last used color from the config file]' \ - '(-l --list)'{-l,--list}'[show available colors]' \ - '(-o --once)'{-o,--once}'[do not save the changes to the config file]' \ - '(-t --theme)'{-t,--theme}'[make changes to the specified theme]:icon-theme:_get_themes' \ - '(-u --update-caches)'{-u,--update-caches}'[update icon caches]' - -# vim: ft=zsh sw=4 ts=4
\ No newline at end of file diff --git a/papirus-folders b/papirus-folders deleted file mode 100644 index e0b61197a71c..000000000000 --- a/papirus-folders +++ /dev/null @@ -1,75 +0,0 @@ -# papirus-folders completion -# -# @author: Sergei Eremenko (https://github.com/SmartFinn) -# @license: MIT license (MIT) -# @link: https://github.com/PapirusDevelopmentTeam/papirus-folders - -__get_colors() { - if ! command -v papirus-folders >/dev/null; then - return 1 - fi - - papirus-folders -l | tr -d '>\n' -} - -__get_themes() { - local data_dir icons_dir icon_theme - local -a data_dirs=() - local -a icons_dirs=( - "$HOME/.icons" - "${XDG_DATA_HOME:-$HOME/.local/share}/icons" - ) - - # Get data directories from XDG_DATA_DIRS variable and - # convert colon-separated list into bash array - IFS=: read -ra data_dirs <<< "${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - - for data_dir in "${data_dirs[@]}"; do - [ -d "$data_dir/icons" ] || continue - icons_dirs=( "${icons_dirs[@]}" "${data_dir%/}/icons" ) - done - - for icons_dir in "${icons_dirs[@]}"; do - for icon_theme in "$icons_dir"/*; do - [ -f "$icon_theme/48x48/places/folder-blue.svg" ] || continue - printf '%s\n' "${icon_theme##*/}" - done - done - return -} - -_papirus_folders() { - local cur prev - local -a colors=( $(__get_colors) ) - local -a opts=( - -h --help - -V --version - -v --verbose - -C --color - -D --default - -R --restore - -l --list - -o --once - -t --theme - -u --update-caches - ) - - _get_comp_words_by_ref cur prev - - case "$prev" in - -C|--color) - COMPREPLY=( $(compgen -W "${colors[*]}" -- "${cur}") ) - return - ;; - -t|--theme) - COMPREPLY=( $(compgen -W "$(__get_themes)" -- "${cur}") ) - ;; - *) - COMPREPLY=( $(compgen -W "${opts[*]}" -- "${cur}") ) - ;; - esac -} - -complete -F _papirus_folders papirus-folders - -# ex: ts=4 sw=4 filetype=sh
\ No newline at end of file |