aboutsummaryrefslogtreecommitdiff
path: root/tessen
diff options
context:
space:
mode:
authorAyush Agarwal <ayush@fastmail.in>2022-02-18 22:19:44 +0530
committerAyush Agarwal <ayush@fastmail.in>2022-02-18 22:19:44 +0530
commiteb63fd55470eafd62bc245f61dd5fae1757c60b6 (patch)
tree1124a812a553168781610feb5649ca5c07d2a20a /tessen
parent7bd619819171ed42ddddd138d3e8219ddd01ea8c (diff)
fix: parse config file options conditionally
the pass and dmenu backends mentioned in the config file will be accepted only if they're not already set by the argparse menu which will be modified to run before the config file is parsed
Diffstat (limited to 'tessen')
-rwxr-xr-xtessen10
1 files changed, 7 insertions, 3 deletions
diff --git a/tessen b/tessen
index b6f006e..a6b5317 100755
--- a/tessen
+++ b/tessen
@@ -730,11 +730,15 @@ parse_config() {
val="${idx#*\"}"
val="${val%*\"}"
# here comes the ladder
- if [[ $key == "pass_backend" ]]; then
+ # the -p, -d, and -a options will be parsed and set only if they're not
+ # already set, i.e., from the argparse
+ if [[ $key == "pass_backend" ]] && [[ -z $pass_backend ]]; then
validate_pass_backend "$val"
- elif [[ $key == "dmenu_backend" ]]; then
+ readonly pass_backend
+ elif [[ $key == "dmenu_backend" ]] && [[ -z $dmenu_backend ]]; then
validate_dmenu_backend "$val"
- elif [[ $key == "action" ]]; then
+ readonly dmenu_backend
+ elif [[ $key == "action" ]] && [[ -z $tsn_action ]]; then
validate_action "$val"
readonly tsn_action
elif [[ $key == "rofi_config_file" ]] && [[ -f ${val@P} ]]; then