mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 23:09:27 -05:00
completions: update for rework
This commit is contained in:
+30
-60
@@ -1,38 +1,35 @@
|
||||
set -l seen '__fish_seen_subcommand_from'
|
||||
set -l has_opt '__fish_contains_opt'
|
||||
set -l commands help install shell toggle workspace-action scheme variant screenshot record clipboard clipboard-delete emoji-picker wallpaper pip
|
||||
|
||||
set -l commands shell toggle workspace-action scheme screenshot record clipboard emoji-picker wallpaper pip
|
||||
set -l not_seen "not $seen $commands"
|
||||
|
||||
# Disable file completions
|
||||
complete -c caelestia -f
|
||||
|
||||
# Add help for any command
|
||||
complete -c caelestia -s 'h' -l 'help' -d 'Show help'
|
||||
|
||||
# Subcommands
|
||||
complete -c caelestia -n $not_seen -a 'help' -d 'Show help'
|
||||
complete -c caelestia -n $not_seen -a 'install' -d 'Install a module'
|
||||
complete -c caelestia -n $not_seen -a 'shell' -d 'Start the shell or message it'
|
||||
complete -c caelestia -n $not_seen -a 'toggle' -d 'Toggle a special workspace'
|
||||
complete -c caelestia -n $not_seen -a 'workspace-action' -d 'Exec a dispatcher in the current group'
|
||||
complete -c caelestia -n $not_seen -a 'scheme' -d 'Switch the current colour scheme'
|
||||
complete -c caelestia -n $not_seen -a 'variant' -d 'Switch the current scheme variant'
|
||||
complete -c caelestia -n $not_seen -a 'scheme' -d 'Manage the colour scheme'
|
||||
complete -c caelestia -n $not_seen -a 'screenshot' -d 'Take a screenshot'
|
||||
complete -c caelestia -n $not_seen -a 'record' -d 'Take a screen recording'
|
||||
complete -c caelestia -n $not_seen -a 'record' -d 'Start a screen recording'
|
||||
complete -c caelestia -n $not_seen -a 'clipboard' -d 'Open clipboard history'
|
||||
complete -c caelestia -n $not_seen -a 'clipboard-delete' -d 'Delete from clipboard history'
|
||||
complete -c caelestia -n $not_seen -a 'emoji-picker' -d 'Open the emoji picker'
|
||||
complete -c caelestia -n $not_seen -a 'wallpaper' -d 'Change the wallpaper'
|
||||
complete -c caelestia -n $not_seen -a 'emoji-picker' -d 'Toggle the emoji picker'
|
||||
complete -c caelestia -n $not_seen -a 'wallpaper' -d 'Manage the wallpaper'
|
||||
complete -c caelestia -n $not_seen -a 'pip' -d 'Picture in picture utilities'
|
||||
|
||||
# Install
|
||||
set -l commands all btop discord firefox fish foot fuzzel hypr safeeyes scripts shell slurp spicetify gtk qt vscode
|
||||
complete -c caelestia -n "$seen install && not $seen $commands" -a "$commands"
|
||||
|
||||
# Shell
|
||||
set -l commands help mpris drawers wallpaper notifs
|
||||
set -l commands mpris drawers wallpaper notifs
|
||||
set -l not_seen "$seen shell && not $seen $commands"
|
||||
complete -c caelestia -n $not_seen -a 'help' -d 'Show IPC commands'
|
||||
complete -c caelestia -n $not_seen -s 's' -l 'show' -d 'Print all IPC commands'
|
||||
complete -c caelestia -n $not_seen -s 'l' -l 'log' -d 'Print the shell log'
|
||||
complete -c caelestia -n $not_seen -a 'mpris' -d 'Mpris control'
|
||||
complete -c caelestia -n $not_seen -a 'drawers' -d 'Toggle drawers'
|
||||
complete -c caelestia -n $not_seen -a 'wallpaper' -d 'Wallpaper control'
|
||||
complete -c caelestia -n $not_seen -a 'wallpaper' -d 'Wallpaper control (for internal use)'
|
||||
complete -c caelestia -n $not_seen -a 'notifs' -d 'Notification control'
|
||||
|
||||
set -l commands getActive play pause playPause stop next previous list
|
||||
@@ -81,53 +78,26 @@ set -l commands workspace workspacegroup movetoworkspace movetoworkspacegroup
|
||||
complete -c caelestia -n "$seen workspace-action && not $seen $commands" -a "$commands" -d 'action'
|
||||
|
||||
# Scheme
|
||||
set -q XDG_DATA_HOME && set -l data_dir $XDG_DATA_HOME || set -l data_dir $HOME/.local/share
|
||||
set -l scheme_dir $data_dir/caelestia/scripts/data/schemes
|
||||
set -l schemes (basename -a (find $scheme_dir/ -mindepth 1 -maxdepth 1 -type d))
|
||||
set -l commands 'print' $schemes
|
||||
complete -c caelestia -n "$seen scheme && not $seen $commands" -a 'print' -d 'Generate and print a colour scheme for an image'
|
||||
complete -c caelestia -n "$seen scheme && not $seen $commands" -a "$schemes" -d 'scheme'
|
||||
for scheme in $schemes
|
||||
set -l flavours (basename -a (find $scheme_dir/$scheme/ -mindepth 1 -maxdepth 1 -type d) 2> /dev/null)
|
||||
set -l modes (basename -s .txt (find $scheme_dir/$scheme/ -mindepth 1 -maxdepth 1 -type f) 2> /dev/null)
|
||||
if test -n "$modes"
|
||||
complete -c caelestia -n "$seen scheme && $seen $scheme && not $seen $modes" -a "$modes" -d 'mode'
|
||||
else
|
||||
complete -c caelestia -n "$seen scheme && $seen $scheme && not $seen $flavours" -a "$flavours" -d 'flavour'
|
||||
for flavour in $flavours
|
||||
set -l modes (basename -s .txt (find $scheme_dir/$scheme/$flavour/ -mindepth 1 -maxdepth 1 -type f))
|
||||
complete -c caelestia -n "$seen scheme && $seen $scheme && $seen $flavour && not $seen $modes" -a "$modes" -d 'mode'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Variant
|
||||
set -l commands vibrant tonalspot expressive fidelity fruitsalad rainbow neutral content monochrome
|
||||
complete -c caelestia -n "$seen variant && not $seen $commands" -a "$commands" -d 'variant'
|
||||
complete -c caelestia -n "$seen scheme" -s 'r' -l 'random' -d 'Switch to a random scheme'
|
||||
complete -c caelestia -n "$seen scheme" -s 'n' -l 'name' -d 'Set scheme name'
|
||||
complete -c caelestia -n "$seen scheme" -s 'f' -l 'flavour' -d 'Set scheme flavour'
|
||||
complete -c caelestia -n "$seen scheme" -s 'm' -l 'mode' -d 'Set scheme mode' -a 'light dark'
|
||||
complete -c caelestia -n "$seen scheme" -s 'v' -l 'variant' -d 'Set scheme variant' -a 'vibrant tonalspot expressive fidelity fruitsalad rainbow neutral content monochrome'
|
||||
|
||||
# Record
|
||||
set -l not_seen "$seen record && not $has_opt -s h help"
|
||||
complete -c caelestia -n "$not_seen && not $has_opt -s s sound && not $has_opt -s r region && not $has_opt -s c compression && not $has_opt -s H hwaccel" \
|
||||
-s 'h' -l 'help' -d 'Show help'
|
||||
complete -c caelestia -n "$not_seen && not $has_opt -s s sound" -s 's' -l 'sound' -d 'Capture sound'
|
||||
complete -c caelestia -n "$not_seen && not $has_opt -s r region" -s 'r' -l 'region' -d 'Capture region'
|
||||
complete -c caelestia -n "$not_seen && not $has_opt -s c compression" -s 'c' -l 'compression' -d 'Compression level of file' -r
|
||||
complete -c caelestia -n "$not_seen && not $has_opt -s H hwaccel" -s 'H' -l 'hwaccel' -d 'Use hardware acceleration'
|
||||
complete -c caelestia -n "$seen record" -s 'r' -l 'region' -d 'Capture region'
|
||||
complete -c caelestia -n "$seen record" -s 's' -l 'sound' -d 'Capture sound'
|
||||
|
||||
# Clipboard
|
||||
complete -c caelestia -n "$seen clipboard" -s 'd' -l 'delete' -d 'Delete from cliboard history'
|
||||
|
||||
# Wallpaper
|
||||
set -l not_seen "$seen wallpaper && not $has_opt -s h help && not $has_opt -s f file && not $has_opt -s d directory"
|
||||
complete -c caelestia -n $not_seen -s 'h' -l 'help' -d 'Show help'
|
||||
complete -c caelestia -n $not_seen -s 'f' -l 'file' -d 'The file to switch to' -r
|
||||
complete -c caelestia -n $not_seen -s 'd' -l 'directory' -d 'The directory to select from' -r
|
||||
|
||||
complete -c caelestia -n "$seen wallpaper && $has_opt -s f file" -F
|
||||
complete -c caelestia -n "$seen wallpaper && $has_opt -s d directory" -F
|
||||
|
||||
set -l not_seen "$seen wallpaper && $has_opt -s d directory && not $has_opt -s F no-filter && not $has_opt -s t threshold"
|
||||
complete -c caelestia -n $not_seen -s 'F' -l 'no-filter' -d 'Do not filter by size'
|
||||
complete -c caelestia -n $not_seen -s 't' -l 'threshold' -d 'The threshold to filter by' -r
|
||||
complete -c caelestia -n "$seen wallpaper" -s 'p' -l 'print' -d 'Print the scheme for a wallpaper' -rF
|
||||
complete -c caelestia -n "$seen wallpaper" -s 'r' -l 'random' -d 'Switch to a random wallpaper' -rF
|
||||
complete -c caelestia -n "$seen wallpaper" -s 'f' -l 'file' -d 'The file to switch to' -rF
|
||||
complete -c caelestia -n "$seen wallpaper" -s 'n' -l 'no-filter' -d 'Do not filter by size'
|
||||
complete -c caelestia -n "$seen wallpaper" -s 't' -l 'threshold' -d 'The threshold to filter by' -r
|
||||
complete -c caelestia -n "$seen wallpaper" -s 'N' -l 'no-smart' -d 'Disable smart mode switching'
|
||||
|
||||
# Pip
|
||||
set -l not_seen "$seen pip && not $has_opt -s h help && not $has_opt -s d daemon"
|
||||
complete -c caelestia -n $not_seen -s 'h' -l 'help' -d 'Show help'
|
||||
complete -c caelestia -n $not_seen -s 'd' -l 'daemon' -d 'Start in daemon mode'
|
||||
complete -c caelestia -n "$seen pip" -s 'd' -l 'daemon' -d 'Start in daemon mode'
|
||||
|
||||
Reference in New Issue
Block a user