-
-
Notifications
You must be signed in to change notification settings - Fork 723
Description
Coming from the Debian packaging of polybar.
This feature request is for a little bit more than what the tittle says...
Polybar currently has the following precedence for loading the config file:
Lines 107 to 115 in fab8437
| if (cli->has("config")) { | |
| confpath = cli->get("config"); | |
| } else if (env_util::has("XDG_CONFIG_HOME")) { | |
| confpath = env_util::get("XDG_CONFIG_HOME") + "/polybar/config"; | |
| } else if (env_util::has("HOME")) { | |
| confpath = env_util::get("HOME") + "/.config/polybar/config"; | |
| } else { | |
| throw application_error("Define configuration using --config=PATH"); | |
| } |
-c/--configparameter$XDG_CONFIG_HOME/polybar/config, if the variable is set$HOME/polybar/config, if the variable is set- Throw error
I would like to propose the following behavior instead:
-c/--configparameter$XDG_CONFIG_HOME/polybar/config, if the file exists (variable still needs to be checked)$HOME/polybar/config, if the file exists (variable still needs to be checked)/etc/polybar/config, if the file exists (and the file is installed there by default)- Throw error
So a logic change in the way the config file is handled: check if the file exists instead of if the variables to generate the location are set, and fallback to /etc/polybar/config, while also shipping the file there instead of ${CMAKE_INSTALL_DOCDIR}:
Lines 163 to 165 in fab8437
| install(FILES config | |
| DESTINATION ${CMAKE_INSTALL_DOCDIR} | |
| COMPONENT config) |
The reason is ask this is because that will make it easier to ship polybar working out of the box, so that polybar example will work without the user having to copy the file to their $HOME, and it will work for any user.
Please note that if you agree with this, a change in the README will be needed to reflect it.