feat(config): Try to load config.ini (#2324)
* Added .ini extension check to default config * Added change to changelog and man page * Added change to changelog and man page * removed .vscode folder * removed new lines in changelog
This commit is contained in:
parent
218911c463
commit
89a723a4d9
@ -24,8 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[`#956`](https://github.com/polybar/polybar/issues/956),
|
[`#956`](https://github.com/polybar/polybar/issues/956),
|
||||||
[`#1871`](https://github.com/polybar/polybar/issues/1871),
|
[`#1871`](https://github.com/polybar/polybar/issues/1871),
|
||||||
[`#2141`](https://github.com/polybar/polybar/issues/2141))
|
[`#2141`](https://github.com/polybar/polybar/issues/2141))
|
||||||
- `internal/battery`: `format-low`, `label-low`, `animation-low`, `low-at =
|
- `internal/battery`: `format-low`, `label-low`, `animation-low`, `low-at = 10`.
|
||||||
10`.
|
|
||||||
- `internal/cpu`: `format-warn`, `label-warn`, `warn-percentage = 80`
|
- `internal/cpu`: `format-warn`, `label-warn`, `warn-percentage = 80`
|
||||||
- `internal/fs`: `format-warn`, `label-warn`, `warn-percentage = 90`
|
- `internal/fs`: `format-warn`, `label-warn`, `warn-percentage = 90`
|
||||||
- `internal/memory`: `format-warn`, `label-warn`, `warn-percentage = 90`
|
- `internal/memory`: `format-warn`, `label-warn`, `warn-percentage = 90`
|
||||||
@ -35,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
speeds are displayed.
|
speeds are displayed.
|
||||||
- `internal/xkeyboard`: `%variant%` can be used to parse the layout variant
|
- `internal/xkeyboard`: `%variant%` can be used to parse the layout variant
|
||||||
([`#316`](https://github.com/polybar/polybar/issues/316))
|
([`#316`](https://github.com/polybar/polybar/issues/316))
|
||||||
|
- Added .ini extension check to the default config search.
|
||||||
|
([`#2323`](https://github.com/polybar/polybar/issues/2323))
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Slight changes to the value ranges the different ramp levels are responsible
|
- Slight changes to the value ranges the different ramp levels are responsible
|
||||||
|
@ -32,7 +32,9 @@ places in the following order:
|
|||||||
* If the ``-c`` or ``--config`` command line argument is specified, it will use
|
* If the ``-c`` or ``--config`` command line argument is specified, it will use
|
||||||
the path given there.
|
the path given there.
|
||||||
* ``$XDG_CONFIG_HOME/polybar/config``
|
* ``$XDG_CONFIG_HOME/polybar/config``
|
||||||
|
* ``$XDG_CONFIG_HOME/polybar/config.ini``
|
||||||
* ``$HOME/.config/polybar/config``
|
* ``$HOME/.config/polybar/config``
|
||||||
|
* ``$HOME/.config/polybar/config.ini``
|
||||||
|
|
||||||
Syntax
|
Syntax
|
||||||
------
|
------
|
||||||
|
@ -303,12 +303,23 @@ namespace file_util {
|
|||||||
if (exists(confpath)) {
|
if (exists(confpath)) {
|
||||||
return confpath;
|
return confpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string iniConfPath = confpath.append(".ini");
|
||||||
|
if (exists(iniConfPath)) {
|
||||||
|
return iniConfPath;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (env_util::has("HOME")) {
|
if (env_util::has("HOME")) {
|
||||||
confpath = env_util::get("HOME") + "/.config/polybar/config";
|
confpath = env_util::get("HOME") + "/.config/polybar/config";
|
||||||
if (exists(confpath)) {
|
if (exists(confpath)) {
|
||||||
return confpath;
|
return confpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string iniConfPath = confpath.append(".ini");
|
||||||
|
if (exists(iniConfPath)) {
|
||||||
|
return iniConfPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user