From bb1b8bc7ca7c647fc34205225597f160d4aaf74c Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Thu, 7 Jan 2021 22:21:07 +0300 Subject: [PATCH] Add fish completion --- CHANGELOG.md | 3 +++ completions/fish/foot.fish | 19 +++++++++++++++++++ completions/fish/footclient.fish | 14 ++++++++++++++ completions/meson.build | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 completions/fish/foot.fish create mode 100644 completions/fish/footclient.fish diff --git a/CHANGELOG.md b/CHANGELOG.md index de632cc8..c5d23a39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ (e.g. `pad=5x5 center`), causing the grid to be centered in the window, with equal amount of padding of the left/right and top/bottom side (https://codeberg.org/dnkl/foot/issues/273). +* Completions for fish shell + (https://codeberg.org/dnkl/foot/issues/11) ### Changed @@ -66,6 +68,7 @@ * [craigbarnes](https://codeberg.org/craigbarnes) * [birger](https://codeberg.org/birger) * [pc](https://codeberg.org/pc) +* [FollieHiyuki](https://codeberg.org/FollieHiyuki) ## 1.6.2 diff --git a/completions/fish/foot.fish b/completions/fish/foot.fish new file mode 100644 index 00000000..ab59fb75 --- /dev/null +++ b/completions/fish/foot.fish @@ -0,0 +1,19 @@ +complete -c foot -x -a "(__fish_complete_subcommand)" +complete -c foot -r -s c -l config -d "path to configuration file (XDG_CONFIG_HOME/foot/foot.ini)" +complete -c foot -s C -l check-config -d "verify configuration and exit with 0 if ok, otherwise exit with 1" +complete -c foot -x -s f -l font -a "(fc-list : family | sed 's/,/\n/g' | sort | uniq)" -d "font name and style in fontconfig format (monospace)" +complete -c foot -x -s t -l term -a '(find /usr/share/terminfo -type f -printf "%f\n")' -d "value to set the environment variable TERM to (foot)" +complete -c foot -x -s T -l title -d "initial window title" +complete -c foot -x -s a -l app-id -d "value to set the app-id property on the Wayland window to (foot)" +complete -c foot -s m -l maximized -d "start in maximized mode" +complete -c foot -s F -l fullscreen -d "start in fullscreen mode" +complete -c foot -s L -l login-shell -d "start shell as a login shell" +complete -c foot -x -s w -l window-size-pixels -d "window WIDTHxHEIGHT, in pixels (700x500)" +complete -c foot -x -s W -l window-size-chars -d "window WIDTHxHEIGHT, in characters (not set)" +complete -c foot -F -s s -l server -d "run as server; open terminals by running footclient" +complete -c foot -s H -l hold -d "remain open after child process exits" +complete -c foot -r -s p -l print-pid -d "print PID to this file or FD when up and running (server mode only)" +complete -c foot -x -s l -l log-colorize -a "always never auto" -d "enable or disable colorization of log output on stderr" +complete -c foot -s S -l log-no-syslog -d "disable syslog logging (server mode only)" +complete -c foot -s v -l version -d "show the version number and quit" +complete -c foot -s h -l help -d "show help message and quit" diff --git a/completions/fish/footclient.fish b/completions/fish/footclient.fish new file mode 100644 index 00000000..9ffeeff5 --- /dev/null +++ b/completions/fish/footclient.fish @@ -0,0 +1,14 @@ +complete -c footclient -x -a "(__fish_complete_subcommand)" +complete -c footclient -x -s t -l term -a '(find /usr/share/terminfo -type f -printf "%f\n")' -d "value to set the environment variable TERM to (foot)" +complete -c footclient -x -s T -l title -d "initial window title" +complete -c footclient -x -s a -l app-id -d "value to set the app-id property on the Wayland window to (foot)" +complete -c footclient -s m -l maximized -d "start in maximized mode" +complete -c footclient -s F -l fullscreen -d "start in fullscreen mode" +complete -c footclient -s L -l login-shell -d "start shell as a login shell" +complete -c footclient -x -s w -l window-size-pixels -d "window WIDTHxHEIGHT, in pixels (700x500)" +complete -c footclient -x -s W -l window-size-chars -d "window WIDTHxHEIGHT, in characters (not set)" +complete -c footclient -F -s s -l server-socket -d "override the default path to the foot server socket ($XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock)" +complete -c footclient -s H -l hold -d "remain open after child process exits" +complete -c footclient -x -s l -l log-colorize -a "always never auto" -d "enable or disable colorization of log output on stderr" +complete -c footclient -s v -l version -d "show the version number and quit" +complete -c footclient -s h -l help -d "show help message and quit" diff --git a/completions/meson.build b/completions/meson.build index 213241c6..82198d0b 100644 --- a/completions/meson.build +++ b/completions/meson.build @@ -1,3 +1,6 @@ zsh_install_dir = join_paths(get_option('datadir'), 'zsh', 'site-functions') +fish_install_dir = join_paths(get_option('datadir'), 'fish', 'vendor_completions.d') install_data('zsh/_foot', install_dir: zsh_install_dir) install_data('zsh/_footclient', install_dir: zsh_install_dir) +install_data('fish/foot.fish', install_dir: fish_install_dir) +install_data('fish/footclient.fish', install_dir: fish_install_dir)