aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag/config.c
Commit message (Collapse)AuthorAge
* Make command line option lists constLibravatar Manuel Stoeckl2021-02-04
|
* Changed fprintf(stdout,...) to printf(...) for more readable codeLibravatar SpizzyCoder2021-01-16
|
* swaynag: add details background optionLibravatar Mustafa Abdul-Kader2020-09-14
| | | | | | Adds a new config option for details background for swaynag issue/#5673
* swaynag: adds option to separately specify the text color for buttonsLibravatar oliver-giersch2020-09-04
|
* swaynag: allow specifying more buttons which execute and dismissLibravatar Graham Christensen2020-06-09
| | | | | I don't love -z / -Z, but I figure this patch is far from being accepted for other reasons too.
* parse_color: return success + drop fallback colorLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | This is the first in a series of commits to refactor the color handling in sway. This changes parse_color to return whether it was success and no longer uses 0xFFFFFFFF as the fallback color. This also verifies that the string actually contains a valid hexadecimal number along with the length checks. In the process of altering the calls to parse_color, I also took the opportunity to heavily refactor swaybar's ipc_parse_colors function. This allowed for several lines of duplicated code to be removed.
* swaynag: revamp type configsLibravatar Brian Ashworth2019-04-20
| | | | | | | | | | | | | This revamps the type configs for swaynag. All sizing attributes for swaynag are now `ssize_t` instead of `uint32_t` to allow for a default value of `-1`, which allows for `0` to be a valid value. Additionally, the initialization of the type configs has been changed from a simple calloc to use a new function `swaynag_type_new`. `swaynag_type_new` calloc's the memory, checks for an allocation failure, sets the name, and all sizes to -1. The layering order has also been changed to default, general config, type config, and as highest priority command line arguments. Finally, `swaynag_type_merge` has been modified to handle the layering and sizing changes.
* Repair swaynag crash reading message from stdinLibravatar Peter Grayson2019-03-11
| | | | | | | | | | | | | | | | | When swaynag is run with the -l/--detailed-message option, a crash may occur if the detailed message read from stdin is large enough. E.g.: swaynag -m hello -l < ~/.config/sway/config The root cause is that the read_from_stdin() function under-allocates memory for the destination buffer which causes that buffer to be overflowed when copying line data to it with snprintf(). The repair is to allocate one more byte for the terminating null byte. N.B. although getline() returns the number of bytes read excluding a terminating null byte, the line buffer is terminated with a null byte. Thus we have a guarantee that the line buffer will be null terminated (which is important when copying with snprintf()).
* swaynag: remove trailing newlines in configLibravatar Brian Ashworth2019-02-05
| | | | | Now that swaynag uses getline (instead of the old readline), the trailing newline characters have to be removed when reading the config
* Fix build failure in config.cLibravatar unraised2019-01-23
|
* swaynag: fix XDG_CONFIG_HOME handlingLibravatar emersion2019-01-19
|
* Remove usage of VLAs.Libravatar Connor E2019-01-16
|
* swaynag: handle empty $XDG_CONFIG_HOME betterLibravatar Ian Fan2019-01-14
| | | | Set config path to fallback instead of setting $XDG_CONFIG_HOME
* Remove readline.cLibravatar Ian Fan2019-01-01
| | | | | All occurrences of read_line have been replaced by getline. peek_line has been absorbed into detect_brace.
* Implement swaynag -B/--button-no-terminalLibravatar Brian Ashworth2018-11-27
| | | | | | | | | | In `i3 4.16`, `i3-nagbar` introduces the flags `-B/--button-no-terminal` to run the action directly instead of inside a terminal. This implements the flags for swaynag for compatibility. Since swaynag does not use an equivalent to `i3-sensible-terminal`, the flags `-b/--button` only uses a terminal when the environment variable `TERMINAL` is set, otherwise it acts the same as these new flags.
* Replace _XOPEN_SOURCE with _POSIX_C_SOURCELibravatar emersion2018-11-25
| | | | And make sure we don't define both in the same source file.
* Turn funcs() into funcs(void)Libravatar Arkadiusz Hiler2018-09-30
| | | | If they really do not take undefined number of arguments.
* Fix bad-free in swaynagLibravatar Brian Ashworth2018-08-20
|
* swaynag: don't drop \n for first lineLibravatar Brian Ashworth2018-08-01
|
* swaynag: allow more config optionsLibravatar Brian Ashworth2018-08-01
|
* swaynag: refactor {sway_,}nagbar to swaynagLibravatar Brian Ashworth2018-08-01
|
* swaynag: split config into own file and fix optindLibravatar Brian Ashworth2018-08-01