Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added .ini extension check to default config #2324

Merged
merged 7 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
[`#1871`](https://github.com/polybar/polybar/issues/1871),
[`#2141`](https://github.com/polybar/polybar/issues/2141))
- `internal/battery`: `format-low`, `label-low`, `animation-low`, `low-at =
10`.
- `internal/battery`: `format-low`, `label-low`, `animation-low`, `low-at = 10`.
- `internal/cpu`: `format-warn`, `label-warn`, `warn-percentage = 80`
- `internal/fs`: `format-warn`, `label-warn`, `warn-percentage = 90`
- `internal/memory`: `format-warn`, `label-warn`, `warn-percentage = 90`
Expand All @@ -35,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
speeds are displayed.
- `internal/xkeyboard`: `%variant%` can be used to parse the layout variant
([`#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
- Slight changes to the value ranges the different ramp levels are responsible
Expand Down Expand Up @@ -62,4 +63,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Empty color values are no longer treated as invalid and no longer produce an error.

[Unreleased]: https://github.com/polybar/polybar/compare/3.5.3...HEAD
[3.5.3]: https://github.com/polybar/polybar/releases/tag/3.5.3
[3.5.3]: https://github.com/polybar/polybar/releases/tag/3.5.3
2 changes: 2 additions & 0 deletions doc/man/polybar.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ places in the following order:
* If the ``-c`` or ``--config`` command line argument is specified, it will use
the path given there.
* ``$XDG_CONFIG_HOME/polybar/config``
* ``$XDG_CONFIG_HOME/polybar/config.ini``
* ``$HOME/.config/polybar/config``
* ``$HOME/.config/polybar/config.ini``

Syntax
------
Expand Down
11 changes: 11 additions & 0 deletions src/utils/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,23 @@ namespace file_util {
if (exists(confpath)) {
return confpath;
}

string iniConfPath = confpath.append(".ini");
if (exists(iniConfPath)) {
return iniConfPath;
}
}

if (env_util::has("HOME")) {
confpath = env_util::get("HOME") + "/.config/polybar/config";
if (exists(confpath)) {
return confpath;
}

string iniConfPath = confpath.append(".ini");
if (exists(iniConfPath)) {
return iniConfPath;
}
}
return "";
}
Expand Down