aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag
Commit message (Collapse)AuthorAge
* swaynag: adds option to set wayland shell layerLibravatar James Edwards-Jones2021-06-17
| | | | Uses --layer/-y set to overlay|top|bottom|background
* details-gackground typo fixLibravatar sergio2021-05-28
|
* cairo: Replace <cairo/cairo.h> by <cairo.h>Libravatar Issam E. Maghni2021-05-10
| | | | | | | For full context, read https://gitlab.freedesktop.org/cairo/cairo/-/issues/479 TL;DR, cairo’s pc file adds `/cairo` to CFLAGS. So namespace cairo shouldn’t be used.
* Use execlp("sh") instead of execl("/bin/sh")Libravatar Simon Ser2021-04-22
| | | | This stops assuming the POSIX shell command is located in /bin.
* swaynag: Use position from wl_pointer.enterLibravatar Kenny Levinsen2021-02-07
| | | | | | | | | | Only wl_pointer.motion was used to update pointer position, which would cause issues if the pointer was not moved prior to wl_pointer.button. This also fixes touch input through wl_pointer emulation, which fires wl_pointer.button immediately after wl_pointer.enter. Closes: https://github.com/swaywm/sway/issues/5991
* Make command line option lists constLibravatar Manuel Stoeckl2021-02-04
|
* Make Wayland request listeners static const when possibleLibravatar 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
|
* Fix incorrect format specifiersLibravatar Antonin Décimo2020-07-30
|
* swaynag: sway_abort on failure to properly registerLibravatar Luke Drummond2020-06-10
| | | | | | | | | In case `wl_display_roundtrip` returns an error after registering for events, print a more user-friendly error message and exit. Previously, if the build did not have assertions enabled, this would likely result in a segfault. With assertions enabled, it's not user friendly to terminate with internal implementation information.
* 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.
* swaynag: exit on wl_display_roundtrip errorLibravatar Dominique Martinet2020-04-02
| | | | | fixes loop when sway closes the socket in the middle of querying outputs, see #5138.
* swaynag: fix segfault on exit when arguments are not correctLibravatar Dominique Martinet2020-03-29
| | | | | swaynag_destroy is called on all cleanup cases and needs the lists to be valid, just init them early
* swaynag: Add multi-seat supportLibravatar Andri Yngvason2020-01-05
| | | | This also adds cleanup for all seat resources
* 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.
* Fix markup syntax in man pagesLibravatar Martin Michlmayr2019-08-31
|
* check for empty string before calling strtoul() and check errnoLibravatar Daniel Eklöf2019-06-05
| | | | | | Note: since strtoul() has no real error return code (both 0 and ULONG_MAX may be returned on both success and failure), set errno=0 before calling strtoul().
* swaybar/nag: use xcursor theme defined by XCURSOR_THEME/SIZELibravatar Daniel Eklöf2019-06-05
| | | | | | | | If the XCURSOR_THEME and/or XCURSOR_SIZE environment variables are set, use the theme and size they define. If they're not set, use the same defaults as before (system default theme, size=24).
* swaybg: split into standalone projectLibravatar Drew DeVault2019-04-25
| | | | | | | The new upstream is https://github.com/swaywm/swaybg This commit also refactors our use of gdk-pixbuf a bit, since the only remaining reverse dependency is swaybar tray support.
* 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.
* Spawn swaynag as a wayland clientLibravatar Brian Ashworth2019-04-14
| | | | | This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done
* swaynag: fix pointer managementLibravatar Brian Ashworth2019-04-14
| | | | | | | | | | | Currently on master, swaynag will retrieve a pointer instance whenever the capabilities change and WL_SEAT_CAPBILITY_POINTER is set. The pointer instances were never being destroyed so swaynag received events multiple times due to having several instances of the pointer. This fixes it so if there is already a pointer instance, swaynag does not attempt to retrieve another. Additionally, if the pointer capability is removed, the pointer instance is destroyed.
* 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
|
* Fix dead stores found by scan-buildLibravatar M Stoeckl2019-01-22
| | | | | | | | In addition to removing unused code, two minor problems are fixed: (1) `resize set` and `resize adjust` did not error when given too many arguments. (2) `orientation` was incorrectly overridden to be 'U' for scroll events in the swaybar tray `handle_click` function.
* swaynag: Small graphical fix, add offset of +1 to X/Y.Libravatar Connor E2019-01-22
|
* Removed unused wlroots dependency for sway(bg|bar|msg|nag)Libravatar M Stoeckl2019-01-21
| | | | Also remove direct libm dependency where unused.
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* swaynag: fix XDG_CONFIG_HOME handlingLibravatar emersion2019-01-19
|
* meson: remove rpath optionsLibravatar emersion2019-01-18
|
* Fixes for small existing bugs.Libravatar Connor E2019-01-16
|
* 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.
* swaynag: remove double free of details buttonLibravatar Brian Ashworth2018-12-17
| | | | | | | | | | | | | | If there are no arguments or invalid arguments given, swaynag will free `swaynag.details.button_details` under the `cleanup` label in main. It then called `swaynag_destroy`, which would attempt to free it again. Since `swaynag.details.button_details` is either freed on line 106 of main (when there is no detailed message) or added to `swaynag.buttons` on line 103 of main, there is no reason to manually free it in `swaynag_destroy`. Although I cannot reproduce a double free on my system, for some reason, it should have actually resulted in a double free in all code paths.
* swaynag: damage the cursor surface on updateLibravatar Brian Ashworth2018-12-15
| | | | | | | When the cursor surface gets updated, it should be damaged. This also bumps up `wl_compositor` to version 4 to be able to use `wl_surface_damage_buffer`.
* Cleanup list codeLibravatar Ian Fan2018-12-09
|
* 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.
* More frees.Libravatar Connor E2018-11-13
|
* Sway clients: Exit gracefully when compositor is unavailableLibravatar Ryan Dwyer2018-10-15
|
* swaynag: s/Toggle Details/Toggle details/Libravatar Drew DeVault2018-10-07
|
* swaynag: fix use-after-free in wl_display_dispatchLibravatar Dominique Martinet2018-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When destroying swaynag from within wl_display_dispatch, we cannot disconnect the display as that will free the queue's event_list. Free it after running the loop instead. Fixes this use-after-free: ==7312==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000000110 at pc 0x000000412a9f bp 0x7ffd4e811760 sp 0x7ffd4e811750 READ of size 8 at 0x612000000110 thread T0 #0 0x412a9e in wl_list_empty ../common/list.c:206 #1 0x7f5b58f0d42f in dispatch_queue src/wayland-client.c:1572 #2 0x7f5b58f0d42f in wl_display_dispatch_queue_pending src/wayland-client.c:1815 #3 0x40f465 in swaynag_run ../swaynag/swaynag.c:390 #4 0x407576 in main ../swaynag/main.c:123 #5 0x7f5b58bb9412 in __libc_start_main ../csu/libc-start.c:308 #6 0x404a3d in _start (/opt/wayland/bin/swaynag+0x404a3d) 0x612000000110 is located 208 bytes inside of 320-byte region [0x612000000040,0x612000000180) freed by thread T0 here: #0 0x7f5b594ab480 in free (/lib64/libasan.so.5+0xef480) #1 0x40faff in swaynag_destroy ../swaynag/swaynag.c:454 #2 0x40cbb4 in layer_surface_closed ../swaynag/swaynag.c:82 #3 0x7f5b583e1acd in ffi_call_unix64 (/lib64/libffi.so.6+0x6acd) previously allocated by thread T0 here: #0 0x7f5b594aba50 in __interceptor_calloc (/lib64/libasan.so.5+0xefa50) #1 0x7f5b58f0c902 in wl_display_connect_to_fd src/wayland-private.h:236 (you need a wayland compiled with asan, my wl_list hack, or running with valgrind to see this trace)
* Add support for installing binaries with DT_RPATHLibravatar Arkadiusz Hiler2018-09-30
| | | | | | | | | | | | | | It's better to use DT_RPATH dynamic section of the elf binary to store the paths of libraries to load instead of overwriting LD_LIBRARY_PATH for the whole environment, causing surprises. This solution is much more transparent and perfectly suitable for running contained installations of wayland/wlroots/sway. The code unsetting the LD_LIBRARY_PATH/LD_PRELOAD was also deleted as it's a placebo security at best - we should trust the execution path that leads us to running sway, and it's way too late to care about those variables since we already started executing our compositor, thus we would be compromised anyway.
* Turn funcs() into funcs(void)Libravatar Arkadiusz Hiler2018-09-30
| | | | If they really do not take undefined number of arguments.
* Align titles to baselineLibravatar Ryan Dwyer2018-09-08
| | | | | | | | | | | | | This does the following: * Adds a baseline argument to get_text_size (the baseline is the distance from the top of the texture to the baseline). * Stores the baseline in the container when calculating the title height. * Takes the baseline into account when calculating the config's max font height. * When rendering, pads the textures according to the baseline so they line up.
* Fix bad-free in swaynagLibravatar Brian Ashworth2018-08-20
|