diff options
author | Christian Duerr <contact@christianduerr.com> | 2022-08-31 22:48:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 01:48:38 +0300 |
commit | 4ddb608563d985060d69594d1004550a680ae3bd (patch) | |
tree | 0b02a330b3e59300cff80a147f3c1bdab7f9ea57 /extra/completions/alacritty.bash | |
parent | 18f9c2793924aec91c80a69ccb45f529adaffae5 (diff) | |
download | alacritty-4ddb608563d985060d69594d1004550a680ae3bd.tar.gz alacritty-4ddb608563d985060d69594d1004550a680ae3bd.zip |
Add IPC config subcommand
This patch adds a new mechanism for changing configuration options
without editing the configuration file, by sending options to running
instances through `alacritty msg`.
Each window will load Alacritty's configuration file by default and then
accept IPC messages for config updates using the `alacritty msg config`
subcommand. By default all windows will be updated, individual windows
can be addressed using `alacritty msg config --window-id
"$ALACRITTY_WINDOW_ID"`.
Each option will replace the config's current value and cannot be reset
until Alacritty is restarted or the option is overwritten with a new
value.
Configuration options are passed in the format `field.subfield=value`,
where `value` is interpreted as yaml.
Closes #472.
Diffstat (limited to 'extra/completions/alacritty.bash')
-rw-r--r-- | extra/completions/alacritty.bash | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash index 428e9583..5cca6466 100644 --- a/extra/completions/alacritty.bash +++ b/extra/completions/alacritty.bash @@ -12,6 +12,9 @@ _alacritty() { "$1") cmd="alacritty" ;; + config) + cmd+="__config" + ;; create-window) cmd+="__create__window" ;; @@ -100,7 +103,7 @@ _alacritty() { return 0 ;; alacritty__msg) - opts="-s -h --socket --help create-window help" + opts="-s -h --socket --help create-window config help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -121,6 +124,28 @@ _alacritty() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; + alacritty__msg__config) + opts="-w -r -h --window-id --reset --help <CONFIG_OPTIONS>..." + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --window-id) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -w) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; alacritty__msg__create__window) opts="-e -t -h --working-directory --hold --command --title --class --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then |