Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] add completion for xfce's xfconf-query(1)
- X-seq: zsh-workers 52168
- From: Eric Cook <llua@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] add completion for xfce's xfconf-query(1)
- Date: Wed, 20 Sep 2023 20:50:49 -0400
- Archived-at: <https://zsh.org/workers/52168>
- List-id: <zsh-workers.zsh.org>
- Ui-outboundreport: notjunk:1;M01:P0:LQnZM/qk3u0=;tFCCTKATQFWFoEqEVlL7SCYCHsF g1xijvy3EPIfnkThXDjwtsHSoy91LLZ7APwLZok5FMQfkdhBMT3ieQ0CuVaASzw3GDJb+s4xK RvTCeZ6M6vRrPIb3ZsRfDinGvSEda5hffXRq8zq066QvZcZhaTzmWceNboL9A6z3uTyIG91eI dFo21RSzhBLAJCC0O4HS3d6GtNqkHS++2pcfQ/mATELC2YUP4OB1n8xhVHCSbf5RxvEdIlaUC zULzM3HvlzqrkOXBYjuyKuO4CpDCpKm6pG93HjEWp3LG5V6lT01lYp97303a0Qyd/iBHSAixr TPOa/7sB/9efy7zESkbt993vrO9eB5+D6w4o4p+c4UdttWAdeg+r2zuyLVTQ1ntoowLOX9X69 ptgCMlHoHCi6yCQKJLXtaJD9wHFp1r2tKxEsCKa0KqtW/gPlrhsqWsoVBy2RdIMLuGtImkGyZ XJPjfbYmMAB/llrn4TJOslSMG14V3IbqpTNU/N4GOBuKthjja5QqiWZOV0bCXarUL7mfvekiS cIfn+5vk+qj2vX+ucL3G72ySYbsUnE0p2VwtKowrPe2dokmrsk0IdlzlHiyGexOrmz1ZE8jPr NxO8wJGS6zk4m0qcPzD+lyY2CcAsqGxx97LqvTMFFo37vYmkO7pImBkO9PSDXK6JcH1noS7J8 8I1/E0JiuVvcUNKrB5XBKWNEt49ab83VCb+bLeKDhnTzuuZHQqhgQH9fcpALVWVof7VKIE8jD 3gp9gNBM3YyE93VQgNkkkXz0+o9JvcE2RkZamSLPOOkbnOupFOUsX3hwoOdfFuBbGRtlLLZVw 0YNtT+yp9HwWG3TWbQw8aIbckf1c8mAQ0xp6khuwne5ejssNJxdvE/pagEJoMEh8vUjsxfHxq XB8aiws0oCB0WF9Kl8wFw3becvpFfX6oRV8HBFBSYjhFCF5sGWO6NBC69qrwOkJ16Hg/57sHX f4J5tRF+HOl80qAp0wHcohmfzT0=
Since _gsettings exists, i thought adding it here would be acceptable
(and easy for me to do).
If not i can try to contribute it to xfce's gitlab.
---
Completion/Unix/Command/_xfconf-query | 33 +++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 Completion/Unix/Command/_xfconf-query
diff --git a/Completion/Unix/Command/_xfconf-query b/Completion/Unix/Command/_xfconf-query
new file mode 100644
index 000000000..4c727cfe3
--- /dev/null
+++ b/Completion/Unix/Command/_xfconf-query
@@ -0,0 +1,33 @@
+#compdef xfconf-query
+local curcontext="$curcontext" state state_descr line ret=1
+typeset -A opt_args
+
+_arguments -C -s -w : \
+ '(-c --channel)'{-c,--channel}'[select channel to query/modify]:channel:( ${$(xfconf-query -l)\:#Channels\:} )' \
+ '(-p --property)'{-p,--property}'[select property to query/modify]:property:->property' \
+ '(-v --verbose)'{-v,--verbose}'[print property and value (with -l/-m)]' \
+ '(-t --type)'{-t,--type}'[specify the property value type]:type:(empty string bool {,u}int{,16,64} double array {,u}char float)' \
+ '(-R --recursive)'{-R,--recursive}'[recursively reset properties (with -r)]' \
+ + '(operations)' \
+ {-h,--help}'[show help options]' \
+ {-V,--version}'[show version information]' \
+ {-s,--set}'[define the value of a property]:value' \
+ {-l,--list}'[list properties or channels]' \
+ {-n,--create}'[create a new property]:new property name' \
+ {-r,--reset}'[reset property]' \
+ {-T,--toggle}'[invert boolean property]' \
+ {-m,--monitor}'[monitor a channel for property changes]' && return
+
+case $state in
+ property)
+ # if -c/--channel is currently on the line, use it to complete an property.
+ if [[ -v opt_args[(i)-(c|-channel)] ]]; then
+ local expl
+ _wanted properties expl property compadd "$@" -- ${(f)"$(xfconf-query -c ${(v)opt_args[(i)-(c|-channel)]} -l)"} && ret=0
+ else # just display a message
+ _message property && ret=0
+ fi
+ ;;
+esac
+
+return $ret
--
2.41.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author