From 15a83c0eafbcda5ccadf428cd1c42d544299069c Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 18 Feb 2023 16:23:48 +0530 Subject: configs: game profiles can now override soibox configs the proper precedence order is listed below in descending order * command line arguments * game profiles * ~/.config/soibox/soibox.conf * /etc/soibox/soibox.conf --- example/example.sb | 8 ++++---- soibox | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/example/example.sb b/example/example.sb index 87b9956..b3d4bae 100644 --- a/example/example.sb +++ b/example/example.sb @@ -3,8 +3,10 @@ # acording to the game profile location # 2) if an option is specified in the soibox config # its ignored from game profiles unless specified -# 3) soibox config is located at ~/.config/soibox/soibox.conf, this applies -# to all games, game profiles are specific to each game +# 3) soibox config is located at /etc/soibox/soibox.conf and ~/.config/soibox/soibox.conf, +# this applies to all games, game profiles are specific to each game +# 4) command line arguments overrides game profiles overrides ~/.config/soibox/soibox.conf +# overrides /etc/soibox/soibox.conf # use mangohud perfomance overlay, the value can either be on, 1,2,3,4 or path to # a mangohud config. 1 being just the fps and 4 being the most verbose option, @@ -48,8 +50,6 @@ # path to wine prefix # wine_prefix : path/to/wine/prefix -# note: this does not ignore game profile if specified in the soibox config -# but appends game profile version to the config # WINEDLLOVERRIDES # winedll_ovrids : mshtml=d diff --git a/soibox b/soibox index 381be5b..c2ddb83 100755 --- a/soibox +++ b/soibox @@ -108,7 +108,7 @@ parse_config() : "${wine:=$val}" ;; winedll_ovrids) - winedll_ovrids="${winedll_ovrids:+${winedll_ovrids};}${val}" + : "${winedll_ovrids:=$val}" ;; wine_tag) : "${wine_tag:=$val}" @@ -578,9 +578,11 @@ main() # parse input parse_opts "$@" - [ -f "$config_dir/soibox.conf" ] && [ "$ignore_globalconf" != true ] - parse_config "$config_dir/soibox.conf" parse_config "$local_config" + [ -f "$config_dir/soibox.conf" ] && [ "$ignore_globalconf" != true ] && + parse_config "$config_dir/soibox.conf" + [ -f "/etc/soibox/soibox.conf" ] && [ "$ignore_globalconf" != true ] && + parse_config "/etc/soibox/soibox.conf" : "${loglevel:=1}" # validate input -- cgit v1.2.3