aboutsummaryrefslogtreecommitdiff
path: root/swaybar
AgeCommit message (Collapse)Author
2018-10-20swaybar: disallow left and right position and print error on defaultRouven Czerwinski
The positions "left" and "right" are not allowed by the man page, remove them from the allowed positions. Also print an error to stderr if we default to the bottom position. Fixes #2878
2018-10-19missing headers for swaybar/input.cossi.ahosalmi
2018-10-18swaybar: separate input code to new fileIan Fan
2018-10-15Sway clients: Exit gracefully when compositor is unavailableRyan Dwyer
2018-10-15Remove timerfd from loop implementationRyan Dwyer
timerfd doesn't work on the BSDs, so this replaces it with a timespec for the expiry and uses a poll timeout to check the timers when needed.
2018-10-15Move swaybar's event loop to common directory and refactorRyan Dwyer
* The loop functions are now prefixed with `loop_`. * It is now easy to add timers to the loop. * Timers are implemented using pollfd and timerfd, rather than manually checking them when any other event happens to arrive.
2018-10-14swaybar: when hiding bar, save old height to be restored upon reshowIan Fan
Previously, when the bar was hidden, the height would be set to 0. This meant that if the bar was empty upon reshow, it would not render since the height was still 0, which made it seem there was a problem. Now, the height is not reset, but the width is, to indicate upon reshow that the layer surface needed reconfiguring.
2018-10-14swaybar: send signal to status when hiding or showing barIan Fan
2018-10-14swaybar: show hidden bar on urgencyIan Fan
2018-10-14swaybar: show hidden bar on key eventIan Fan
Since wayland does not currently allow swaybar to create global keybinds, this is handled within sway and sent to the bar using a custom event, so as not to pollute existing events, called bar_state_update.
2018-10-14swaybar: handle mode/hidden_state changesIan Fan
As well as adding the hidden_state property to the bar config struct, this commit handles barconfig_update events when the mode or hidden_state changes, and uses a new function determine_bar_visibility to hide or show the bar as required, using, respectively, destroy_layer_surface, which is also newly added, and add_layer_surface, which has been changed to allow dynamically adding the surface.
2018-10-14swaybar: streamline ipc handlingIan Fan
The received json is handled outside of the case statement, which will allow better extensibility. This commit also introduces the variable bar_is_dirty, the return value signifying whether the bar requires rendering.
2018-10-14swaybar: move mode & mode_pango_markup to bar structIan Fan
This distinguishes the binding mode from the distinct config mode, as well as removing mode_pango_markup from the config struct where it should not be present.
2018-10-14swaybar: only send initial workspace request if workspace buttons are enabledIan Fan
2018-10-14swaybar: add free_hotspots helper functionIan Fan
2018-10-14swaybar: only subscribe to required eventsIan Fan
This adds barconfig_update to the list of subscribed events, as well as checking when the other events need to be subscribed to.
2018-10-14swaybar: save id upon startupIan Fan
This adds an id property to the bar, which will be used to filter barconfig_update events
2018-10-10Merge branch 'master' into bar-bindsymIan Fan
2018-10-10Fix program name in version stringsRyan Dwyer
When running swaymsg -v, the version returned is actually the version of swaymsg itself, yet the message displayed was "sway version <version>". This can create confusion if users update sway and swaymsg but don't restart sway, then use swaymsg to check the version. This patch changes the wording to be "swaymsg version <version>" instead, and likewise for swaybar. To get the version of a running sway instance, users should run swaymsg -t get_version.
2018-10-09bar-bindsym: address ianyfan's commentsBrian Ashworth
2018-10-09Implement bar bindsymBrian Ashworth
2018-10-08swaybar: allow null status_commandRyan Dwyer
Sway sets a default status_command which runs date every second. This patch removes this behaviour so the user can have a NULL status bar if desired. I had to swap swaybar's event_loop_poll and wl_display_flush so that it would map the initial surface.
2018-10-06swaybar: fix binding to wl_pointer multiple timesemersion
2018-10-02swaybar: add leading comma to click event JSONIan Fan
2018-09-30Add support for installing binaries with DT_RPATHArkadiusz Hiler
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.
2018-09-30Turn funcs() into funcs(void)Arkadiusz Hiler
If they really do not take undefined number of arguments.
2018-09-30swaybar: synchronize rendering to output framesIan Fan
2018-09-28swaybar: trim function prototypesIan Fan
2018-09-28swaybar: move i3bar definitions into separate fileIan Fan
2018-09-28swaybar: remove unused focused_output propertyIan Fan
2018-09-28swaybar: fail if bar id is invalidIan Fan
2018-09-26Replace getdelim to make swaybar work on FreeBSDsghctoma
This commit fixes a segfault in swaybar on FreeBSD that was caused by using getdelim with EOF as delimiter on an infinite stream. The FreeBSD implementation handles the "no more data, delimiter not found, and EOF not reached" scenario as an error, so it can't be used to read the output of status command. This commit replaces the getline/getdelim calls with reading all available data from the stream in one go.
2018-09-22swaybar, swaylock, & tree/container: Set cairo font options to render text ↵Geoff Greer
and lines with subpixel hinting (if available).
2018-09-22swaybar: explicitly check return value of getdelimIan Fan
This prevents an signed-to-unsigned conversion error on buffer_index if getdelim fails and returns -1, which caused swaybar to try to search the header for the array and immediately failing
2018-09-21Merge branch 'master' into swaybar-hotplugBrian Ashworth
2018-09-21swaybar: log invalid i3bar jsonIan Fan
2018-09-21swaybar: reset tokener if json is incompleteIan Fan
If the tokener parses incomplete json, it sets its error value to json_tokener_continue. This means that extra json should be provided, but the code was providing the entire object again. In the interest of simplicity, the tokener is reset so that buffer_pos always points to the start of the current object.
2018-09-21swaybar: update buffer_pos when moving object to start of bufferIan Fan
2018-09-20swaybar: don't wl_display_roundtrip on each frameemersion
This was the source of numerous bugs, from hotplug events not being received to segfaults because wl_display_roundtrip was making the bar process unplug events while blocking in an iteration over all outputs.
2018-09-20swaybar: handle hotpluggingemersion
Don't kill and respawn swaybars on hotplug.
2018-09-18swaybar: only free tokener when using i3bar protocolIan Fan
2018-09-18swaybar: add debugging statements for handling i3bar jsonIan Fan
2018-09-18swaybar: rewrite i3bar protocol handlingIan Fan
This now correctly handles an incoming json infinite array by shifting most of the heavy listing to the json-c parser, as well as sending multiple statuses at once. It also removes the struct i3bar_protocol_state and moves its members into the status_line struct, allowing the same buffer to be used for both protocols.
2018-09-18swaybar: rewrite protocol determinationIan Fan
This now uses the getline function to receive the header, replacing read_line_buffer, which has been deleted since it is otherwise unused. Furthermore, once the protocol has been determined, the current status is handled immediately to be shown (though this has not been added for the i3bar protocol since it has not yet been rewritten to handle this).
2018-09-18swaybar: rewrite text protocol handlingIan Fan
This now uses getline to correctly handle multiple or long statuses. It also removes the struct text_protocol_state and moves its members into the status_line struct.
2018-09-18swaybar: only create i3bar block hotspot if click events are enabledIan Fan
2018-09-18swaybar: send trailing comma with click event jsonIan Fan
2018-09-18swaybar: fix empty function prototypesIan Fan
2018-09-18swaybar: invalidate file descriptors upon closingIan Fan
2018-09-18swaybar: remove block links upon exitIan Fan