aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyush Agarwal <ayushnix@fastmail.com>2023-03-20 05:06:34 +0530
committerAyush Agarwal <ayushnix@fastmail.com>2023-03-20 05:06:34 +0530
commit62d2b13b9163ad88a85250baf5e58ef49340ac8e (patch)
tree2d59704429f1fb9a0db65d4b350dc0f8ecd5ac82
parent9321b9ceae6f40b6d78948261338978058f6baee (diff)
feat: use a custom config file for fuzzel
fuzzel started supporting configuration files in its version 1.8.0 release. https://codeberg.org/dnkl/fuzzel/releases/tag/1.8.0 This was a much awaited release because fuzzel is now the default backend for tessen. It fulfills every purpose that tessen wants to support and doesn't depend on either GTK or Qt.
-rw-r--r--config1
-rwxr-xr-xtessen19
2 files changed, 12 insertions, 8 deletions
diff --git a/config b/config
index 1e67fbf..0594da8 100644
--- a/config
+++ b/config
@@ -18,6 +18,7 @@
# dmenu_backend in this config file
# alternatively, use the command line arguments to specify the dmenu backend
# while running tessen
+# fuzzel_config_file=""
# tofi_config_file=""
# rofi_config_file="$XDG_CONFIG_HOME/rofi/test.rasi"
# wofi_config_file=""
diff --git a/tessen b/tessen
index d12fb30..6e11f95 100755
--- a/tessen
+++ b/tessen
@@ -13,6 +13,7 @@ set +x
# GLOBAL VARIABLES
declare _PASS_BACKEND _DMENU_BACKEND _TSN_ACTION _TSN_CONFIG
declare -a _DMENU_BACKEND_OPTS _TMP_TOFI_OPTS _TMP_ROFI_OPTS _TMP_WOFI_OPTS
+declare -a _TMP_FUZZEL_OPTS
declare _TSN_USERKEY _TSN_URLKEY _TSN_AUTOKEY _TSN_WEB_BROWSER
declare -i _TSN_DELAY
# show both actions, 'autotype' and 'copy', to choose from by default
@@ -630,6 +631,8 @@ parse_config() {
elif [[ $key == "action" ]] && unset -v _TSN_ACTION 2> /dev/null; then
validate_action "$val"
readonly _TSN_ACTION
+ elif [[ $key == "fuzzel_config_file" ]] && [[ -f ${val@P} ]]; then
+ _TMP_FUZZEL_OPTS+=("--config=${val@P}")
elif [[ $key == "tofi_config_file" ]] && [[ -f ${val@P} ]]; then
_TMP_TOFI_OPTS+=("-c" "${val@P}")
elif [[ $key == "rofi_config_file" ]] && [[ -f ${val@P} ]]; then
@@ -687,11 +690,10 @@ main() {
validate_dmenu_backend "$2"
readonly _DMENU_BACKEND
# since there's a possibility that a user may mention config files for
- # rofi and wofi, we will make _DMENU_BACKEND_OPTS readonly only if
- # _DMENU_BACKEND is fuzzel and bemenu, the dmenu programs which don't
- # support configuration files
- if [[ $_DMENU_BACKEND == "fuzzel" ]] || [[ $_DMENU_BACKEND == "bemenu" ]] \
- || [[ $_DMENU_BACKEND == "dmenu" ]]; then
+ # dmenu backends, we will make _DMENU_BACKEND_OPTS readonly only if
+ # _DMENU_BACKEND is bemenu, the only dmenu program which don't support
+ # configuration files
+ if [[ $_DMENU_BACKEND == "bemenu" ]] || [[ $_DMENU_BACKEND == "dmenu" ]]; then
readonly _DMENU_BACKEND_OPTS
fi
shift
@@ -702,8 +704,7 @@ main() {
fi
validate_dmenu_backend "${_opt##--dmenu=}"
readonly _DMENU_BACKEND
- if [[ $_DMENU_BACKEND == "fuzzel" ]] || [[ $_DMENU_BACKEND == "bemenu" ]] \
- || [[ $_DMENU_BACKEND == "dmenu" ]]; then
+ if [[ $_DMENU_BACKEND == "bemenu" ]] || [[ $_DMENU_BACKEND == "dmenu" ]]; then
readonly _DMENU_BACKEND_OPTS
fi
;;
@@ -759,7 +760,9 @@ main() {
# the options which are mutual between the argparse and the config file will
# be considered in the config file only if those options aren't already set
parse_config
- if [[ $_DMENU_BACKEND == "tofi" ]]; then
+ if [[ $_DMENU_BACKEND == "fuzzel" ]]; then
+ _DMENU_BACKEND_OPTS+=("${_TMP_FUZZEL_OPTS[@]}")
+ elif [[ $_DMENU_BACKEND == "tofi" ]]; then
_DMENU_BACKEND_OPTS+=("${_TMP_TOFI_OPTS[@]}")
readonly _DMENU_BACKEND_OPTS
elif [[ $_DMENU_BACKEND == "rofi" ]]; then