Commit Graph

30 Commits

Author SHA1 Message Date
282b0f4e73 Create default config (#2511)
* Create default config and install to /etc/polybar

Closes #2405

* Search for config in /etc

We search in XDG_CONFIG_DIRS, /etc/xdg, and /etc but only for config.ini

Closes #2016

* Remove config installation from build.sh

* Remove userconfig cmake file

* Cleanup

* Cleanup default config

* Update CHANGELOG.md

Co-authored-by: dvermd <315743+dvermd@users.noreply.github.com>

* Update src/main.cpp

Co-authored-by: dvermd <315743+dvermd@users.noreply.github.com>

* Add tests for string functions

* Support loading bars from fallbacks in /etc

* Combine duplicate string_util::contains test

Co-authored-by: dvermd <315743+dvermd@users.noreply.github.com>
2021-10-05 13:07:19 +02:00
444120e664 script: Fix concurrency issues (#2518)
Fixes #1978

* Move tail and non-tail handler to method

Defining them in the constructor is ugly.

* script: Iterate over defined actions instead of fixed list

* Separate running logic and lock m_output

* Include POLYBAR_FLAGS in linker flags

* Stop using m_prev in script_runner

* Join module threads in stop function

Joining in the destructor may lead to UB because the subclass is already
deconstructed but the threads may still require it to be around (e.g.
for calling any functions on the instance)

* Cleanup script module

* Update changelog

* Remove AfterReturn class

* Remove m_stopping from script module

* Fix polybar not reading the entire line from child process.

For every `readline` call we created a new fd_streambuf. This means once
`readline` returns, the streambuf is destructed and and pending data in
its temporary buffer discarded and we never actually read it.

* Remove unused includes
2021-10-03 01:27:11 +02:00
fa1240f4b6 Remove unused file_ptr 2021-09-21 21:43:27 +02:00
3b6a950380 Remove unused factory.hpp imports 2021-09-21 21:43:27 +02:00
3cc17a0e57 Move signal handling to eventloop class 2021-09-21 20:36:23 +02:00
89a723a4d9 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
2020-12-23 17:52:30 +01:00
75eb41f5ad config: Better error messages when opening files
If a config file is a directory, ifstream would just read it as an empty
file without any errors.

Failing early here is a good idea.
2020-11-26 21:06:35 +01:00
8dbd1740a7 feat(config): include-directory directive (#2196)
Closes #1946
2020-10-08 17:44:29 +02:00
512c519f25 config: Check if config path exists (#2026)
Closes: #2016

* update: Checks if the configuration file exists

* Update: Removing the logic of the config file search from main.cpp
2020-03-01 22:03:17 +01:00
068bf5a311 feat(backlight): Add enable-scroll (#1957)
* backlight: enable changing via scroll

* squash! feedback

* Update src/modules/backlight.cpp

Co-Authored-By: Jérôme BOULMIER <jerome.boulmier@outlook.fr>

Co-authored-by: Jérôme BOULMIER <jerome.boulmier@outlook.fr>
2020-01-15 16:32:17 +01:00
99e823bd0a fix(file): Don't add slash to relative path
This fixes a regression introduced in
56e24992df where relative config file
paths weren't recognized because file_util::expand just added a slash
to the beginning.

That is calling `polybar -c config example` would try to load the config
file at `/config` instead of using the relative path as before.

In all other cases where expand is used this change shouldn't matter
because polybar only accepts absolute paths everyhwere else.
Theoretically this would now allow relative paths (relative to the cwd
where polybar was called) but this shouldn't used (or documented)
because that behavior will change when merging #1523 which would make
paths relative to the polybar config.

Ref #1523
Ref 56e24992df
2019-09-27 16:58:03 +02:00
e329a8150a fix(config): Expand all environment variables and file references (#724) 2017-09-04 14:00:35 -07:00
d3b0670f30 fix(config): Perform tilde expansion on include-file #603 2017-06-02 18:34:49 +02:00
874e6b0d6c feat(config): Add directive for file inclusion 2017-01-26 20:10:33 +01:00
95d5b03fa2 refactor(file_util): Expand tilde manually 2017-01-25 17:07:55 +01:00
a5d6670121 refactor(clang-tidy): Apply fixes 2017-01-24 08:01:04 +01:00
6250a2b746 fix(streambuf): Buffer size 2017-01-14 09:57:09 +01:00
79856d7ed2 feat(ipc): Add polybar-msg to facilitate ipc messaging 2017-01-10 02:09:33 +01:00
ccddf052ec refactor(script): Split non-/tail logic
Split the script module into one tailing output module and
one exec once module.

Refs #281
2017-01-01 09:05:18 +01:00
cc5a5ef25c fix(file_util): Type specification
Fixes #290
2017-01-01 01:23:50 +01:00
dd960cc5b5 refactor(fd_streambuf): Cleanup 2016-12-31 15:42:46 +01:00
ad0af86a7b refactor(battery): Abstract value readers
Refs #263, #245
2016-12-31 04:20:48 +01:00
f80d8ebf5b file_util: File descriptor streams 2016-12-26 10:29:32 +01:00
3681247dc1 refactor(file_util): Move block mode helpers 2016-12-25 19:58:52 +01:00
a89c4ef2dd refactor: Move all event handling to the controller 2016-12-20 05:16:04 +01:00
a0d485f79d refactor: Initialize data 2016-12-15 09:30:31 +01:00
1a2a6e5fab refactor: Construction methods 2016-12-14 11:01:44 +01:00
ff9be848c7 refactor(clang-tidy): Apply fixes 2016-11-25 21:58:49 +01:00
fd57ab0f3d fix: project rename 2016-11-19 06:26:07 +01:00
e7cb345cec wip: Separate source from definitions 2016-11-03 12:54:32 +01:00