forked from enlightenment/enlightenment
118 lines
5.5 KiB
Plaintext
118 lines
5.5 KiB
Plaintext
#compdef enlightenment_remote
|
|
|
|
# zshcompsys function for enlightenment_remote
|
|
# written by Oliver Burnett-Hall <olly@burnett-hall.co.uk>
|
|
|
|
# TODO:
|
|
# . -module-load produces completions for all available modules; it should
|
|
# just complete unloaded ones
|
|
# . I'm not sure if completions for arguments to -lang-set are correct
|
|
# . produces completions for keys argument to -binding-key-(add|del)
|
|
# . produces completions for buttons argument to -binding-mouse-(add|del)
|
|
# . produce completions for actions argument to -binding-*
|
|
# . possibly produce completions for parameters argument to -binding-*
|
|
# . completions for -binding-(key|mouse)-del should be based on existing
|
|
# bindings
|
|
|
|
local allopts="-bg-dirs-list -bg-get -bg-set -binding-key-add -binding-key-del \
|
|
-binding-key-list -binding-mouse-add -binding-mouse-del \
|
|
-binding-mouse-list -font-apply -font-available-list \
|
|
-font-default-get -font-default-list -font-default-remove \
|
|
-font-default-set -font-fallback-append -font-fallback-clear \
|
|
-font-fallback-list -font-fallback-prepend -font-fallback-remove \
|
|
-lang-get -lang-list -lang-set -module-dirs-list -module-disable \
|
|
-module-enable -module-list -module-load -module-unload -restart \
|
|
-shutdown -help"
|
|
|
|
local text_classes="default title_bar"
|
|
local contexts="NONE UNKNOWN BORDER ZONE MANAGER ANY"
|
|
local modifiers="SHIFT CTRL ALT WIN"
|
|
|
|
local context line state
|
|
typeset -A opt_args
|
|
|
|
_arguments : \
|
|
"($allopts)-help[Show usage]" \
|
|
"($allopts)-module-load[Load module into memory]:module name:->unloaded-module" \
|
|
"($allopts)-module-unload[Unload (and disable) module]:module name:->loaded-module" \
|
|
"($allopts)-module-enable[Enable module if not enabled]:module name:->disabled-module" \
|
|
"($allopts)-module-disable[Disable module if not disabled]:module name:->enabled-module" \
|
|
"($allopts)-module-list[List all loaded modules and their states]" \
|
|
"($allopts)-module-dirs-list[List all modules directories]" \
|
|
"($allopts)-bg-set[Set the background edje file]:background edje:_files -g \*.edj" \
|
|
"($allopts)-bg-get[Get the background edje file]" \
|
|
"($allopts)-bg-dirs-list[Get the background directories]" \
|
|
"($allopts)-font-fallback-remove[Remove a font from the fontset]:font name:->fallback-font" \
|
|
"($allopts)-font-fallback-prepend[Prepend a font to the fontset]:font name:->available-font" \
|
|
"($allopts)-font-fallback-append[Append a font to the fontset]:font name:->available-font" \
|
|
"($allopts)-font-apply[Apply changes made to the font system]" \
|
|
"($allopts)-font-fallback-list[List the fallback fonts in order]" \
|
|
"($allopts)-font-available-list[List available fonts]" \
|
|
"($allopts)-font-fallback-clear[Clear font fallback list]" \
|
|
"($allopts)-font-default-get[List the default font associated with OPT1]:text class:($text_classes)" \
|
|
"($allopts)-font-default-remove[Remove the default text class OPT1]:text class:($text_classes)" \
|
|
"($allopts)-font-default-list[List all configured text classes]" \
|
|
"($allopts)-font-default-set[Set textclass, font, and size]:text class:($text_classes):font name:->available-font:font size:" \
|
|
"($allopts)-restart[Restart E17]" \
|
|
"($allopts)-shutdown[Shutdown E17]" \
|
|
"($allopts)-lang-get[Get the current language]" \
|
|
"($allopts)-lang-list[List all available languages]" \
|
|
"($allopts)-lang-set[Set the current language]:language:->language" \
|
|
"($allopts)-binding-mouse-list[List all mouse bindings]" \
|
|
"($allopts)-binding-mouse-add[Add or replace an existing mouse binding]:context:($contexts):button::modifiers:_values -s \| modifiers $modifiers:'any modifiers' flag:(0 1):action::action parameters:" \
|
|
"($allopts)-binding-mouse-del[Delete an existing mouse binding]:context:($contexts):button::modifiers:_values -s \| modifiers $modifiers:'any modifiers' flag:(0 1):action::action parameters:" \
|
|
"($allopts)-binding-key-list[List all key bindings]" \
|
|
"($allopts)-binding-key-add[Add or replace an existing key binding]:context:($contexts):key::modifiers:_values -s \| modifiers $modifiers:'any modifiers' flag:(0 1):action::action parameters:" \
|
|
"($allopts)-binding-key-del[Delete an existing key binding]:context:($contexts):key::modifiers:_values -s \| modifiers $modifiers:'any modifiers' flag:(0 1):action::action parameters:" \
|
|
"-display[Specify X display]:display::" \
|
|
&& return 0
|
|
|
|
local tag description cmd=enlightenment_remote
|
|
local -a opts
|
|
|
|
case $state in
|
|
available-font)
|
|
opts=($($cmd -font-available-list | sed 's/.*"\([^"]*\)"/\1/gp;d'))
|
|
description="font name"
|
|
tag=fonts
|
|
;;
|
|
fallback-font)
|
|
opts=($($cmd -font-fallback-list | sed 's/.*"\([^"]*\)"/\1/gp;d'))
|
|
description="font name"
|
|
tag=fonts
|
|
;;
|
|
language)
|
|
opts=($($cmd -lang-list | sed 's/.*"\([^"]*\)"/\1/gp;d'))
|
|
description="language"
|
|
tag=languages
|
|
;;
|
|
enabled-module)
|
|
opts=($($cmd -module-list | sed 's/.*"\([^"]*\)" ENABLED=1.*/\1/gp;d'))
|
|
description="enabled module"
|
|
tag=modules
|
|
;;
|
|
disabled-module)
|
|
opts=($($cmd -module-list | sed 's/.*"\([^"]*\)" ENABLED=0/\1/gp;d'))
|
|
description="disabled module"
|
|
tag=modules
|
|
;;
|
|
unloaded-module)
|
|
# FIXME: matches all available modules, not just unloaded ones
|
|
opts=(${^$($cmd -module-dirs-list | sed 's/REPLY: MODULE DIR=\(.*\)/\1/gp;d')}/*(N/:t))
|
|
description="module name"
|
|
tag=modules
|
|
;;
|
|
loaded-module)
|
|
opts=($($cmd -module-list | sed 's/.*"\([^"]*\)" ENABLED=./\1/gp;d'))
|
|
description="loaded module"
|
|
tag=modules
|
|
;;
|
|
*)
|
|
# we should never get here
|
|
return 1
|
|
;;
|
|
esac
|
|
|
|
_wanted $tag expl $description compadd -a opts && return 0
|
|
|