From 3b17d4167c59d2fb8e4dd38cafbae373a0d576b9 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Mon, 22 Apr 2024 13:53:51 +0800 Subject: [PATCH] :sparkles: Support gnome-extensions, gdbus, gsettings, dconf --- sources/dconf-dump.zsh | 8 ++++++++ sources/dconf-list.zsh | 7 +++++++ sources/dconf.zsh | 6 ++++++ sources/gdbus.zsh | 4 ++++ sources/gnome-extensions.zsh | 6 ++++++ sources/gsettings-list-children.zsh | 6 ++++++ sources/gsettings-list-keys.zsh | 6 ++++++ sources/gsettings-list-recursively.zsh | 6 ++++++ sources/gsettings.zsh | 6 ++++++ 9 files changed, 55 insertions(+) create mode 100644 sources/dconf-dump.zsh create mode 100644 sources/dconf-list.zsh create mode 100644 sources/dconf.zsh create mode 100644 sources/gdbus.zsh create mode 100644 sources/gnome-extensions.zsh create mode 100644 sources/gsettings-list-children.zsh create mode 100644 sources/gsettings-list-keys.zsh create mode 100644 sources/gsettings-list-recursively.zsh create mode 100644 sources/gsettings.zsh diff --git a/sources/dconf-dump.zsh b/sources/dconf-dump.zsh new file mode 100644 index 0000000..4c138c2 --- /dev/null +++ b/sources/dconf-dump.zsh @@ -0,0 +1,8 @@ +# :fzf-tab:complete:(\\|*/|)dconf-dump: +case $group in + directory) + # https://github.com/Aloxaf/fzf-tab/issues/325 + # no real toml + dconf dump $ctxt[hpre]$word | bat -ltoml + ;; +esac diff --git a/sources/dconf-list.zsh b/sources/dconf-list.zsh new file mode 100644 index 0000000..745a0a4 --- /dev/null +++ b/sources/dconf-list.zsh @@ -0,0 +1,7 @@ +# :fzf-tab:complete:(\\|*/|)dconf-list: +case $group in + directory) + # https://github.com/Aloxaf/fzf-tab/issues/325 + dconf list $ctxt[hpre]$word + ;; +esac diff --git a/sources/dconf.zsh b/sources/dconf.zsh new file mode 100644 index 0000000..6e43326 --- /dev/null +++ b/sources/dconf.zsh @@ -0,0 +1,6 @@ +# :fzf-tab:complete:(\\|*/|)dconf(|-help): +case $group in + command) + dconf help $word | bat -lhelp + ;; +esac diff --git a/sources/gdbus.zsh b/sources/gdbus.zsh new file mode 100644 index 0000000..1eef2a8 --- /dev/null +++ b/sources/gdbus.zsh @@ -0,0 +1,4 @@ +# :fzf-tab:complete:(\\|*/|)gdbus: +# FIXME: strip trailing whitespaces +word=${word%% } +[[ $word != -* ]] && gdbus $word --help diff --git a/sources/gnome-extensions.zsh b/sources/gnome-extensions.zsh new file mode 100644 index 0000000..f748186 --- /dev/null +++ b/sources/gnome-extensions.zsh @@ -0,0 +1,6 @@ +# :fzf-tab:complete:(\\|*/|)gnome-extensions: +if [[ $word == *@* ]]; then + gnome-extensions show $word | bat -lyaml +else + gnome-extensions help $word 2>&1 | bat -lhelp +fi diff --git a/sources/gsettings-list-children.zsh b/sources/gsettings-list-children.zsh new file mode 100644 index 0000000..a28fb21 --- /dev/null +++ b/sources/gsettings-list-children.zsh @@ -0,0 +1,6 @@ +# :fzf-tab:complete:(\\|*/|)gsettings-list-children: +case $group in + schema) + gsettings list-children $word + ;; +esac diff --git a/sources/gsettings-list-keys.zsh b/sources/gsettings-list-keys.zsh new file mode 100644 index 0000000..81b46f5 --- /dev/null +++ b/sources/gsettings-list-keys.zsh @@ -0,0 +1,6 @@ +# :fzf-tab:complete:(\\|*/|)gsettings-list-keys: +case $group in + schema) + gsettings list-keys $word + ;; +esac diff --git a/sources/gsettings-list-recursively.zsh b/sources/gsettings-list-recursively.zsh new file mode 100644 index 0000000..8276619 --- /dev/null +++ b/sources/gsettings-list-recursively.zsh @@ -0,0 +1,6 @@ +# :fzf-tab:complete:(\\|*/|)gsettings-list-recursively: +case $group in + schema) + gsettings list-recursively $word + ;; +esac diff --git a/sources/gsettings.zsh b/sources/gsettings.zsh new file mode 100644 index 0000000..8902772 --- /dev/null +++ b/sources/gsettings.zsh @@ -0,0 +1,6 @@ +# :fzf-tab:complete:(\\|*/|)gsettings(|-help): +case $group in + command) + gsettings help $word | bat -lhelp + ;; +esac