summaryrefslogtreecommitdiffstats
path: root/swaybar
Commit message (Collapse)AuthorAge
* swaybar: when hiding bar, save old height to be restored upon reshowLibravatar Ian Fan2018-10-14
| | | | | | | | 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.
* swaybar: send signal to status when hiding or showing barLibravatar Ian Fan2018-10-14
|
* swaybar: show hidden bar on urgencyLibravatar Ian Fan2018-10-14
|
* swaybar: show hidden bar on key eventLibravatar Ian Fan2018-10-14
| | | | | | 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.
* swaybar: handle mode/hidden_state changesLibravatar Ian Fan2018-10-14
| | | | | | | | | 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.
* swaybar: streamline ipc handlingLibravatar Ian Fan2018-10-14
| | | | | | | 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.
* swaybar: move mode & mode_pango_markup to bar structLibravatar Ian Fan2018-10-14
| | | | | | 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.
* swaybar: only send initial workspace request if workspace buttons are enabledLibravatar Ian Fan2018-10-14
|
* swaybar: add free_hotspots helper functionLibravatar Ian Fan2018-10-14
|
* swaybar: only subscribe to required eventsLibravatar Ian Fan2018-10-14
| | | | | This adds barconfig_update to the list of subscribed events, as well as checking when the other events need to be subscribed to.
* swaybar: save id upon startupLibravatar Ian Fan2018-10-14
| | | | | This adds an id property to the bar, which will be used to filter barconfig_update events
* Merge branch 'master' into bar-bindsymLibravatar Ian Fan2018-10-10
|\
| * Fix program name in version stringsLibravatar Ryan Dwyer2018-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | bar-bindsym: address ianyfan's commentsLibravatar Brian Ashworth2018-10-09
| |
* | Implement bar bindsymLibravatar Brian Ashworth2018-10-09
|/
* swaybar: allow null status_commandLibravatar Ryan Dwyer2018-10-08
| | | | | | | | | 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.
* swaybar: fix binding to wl_pointer multiple timesLibravatar emersion2018-10-06
|
* swaybar: add leading comma to click event JSONLibravatar Ian Fan2018-10-02
|
* 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.
* swaybar: synchronize rendering to output framesLibravatar Ian Fan2018-09-30
|
* swaybar: trim function prototypesLibravatar Ian Fan2018-09-28
|
* swaybar: move i3bar definitions into separate fileLibravatar Ian Fan2018-09-28
|
* swaybar: remove unused focused_output propertyLibravatar Ian Fan2018-09-28
|
* swaybar: fail if bar id is invalidLibravatar Ian Fan2018-09-28
|
* Replace getdelim to make swaybar work on FreeBSDLibravatar sghctoma2018-09-26
| | | | | | | | | 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.
* swaybar, swaylock, & tree/container: Set cairo font options to render text ↵Libravatar Geoff Greer2018-09-22
| | | | and lines with subpixel hinting (if available).
* swaybar: explicitly check return value of getdelimLibravatar Ian Fan2018-09-22
| | | | | | 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
* Merge branch 'master' into swaybar-hotplugLibravatar Brian Ashworth2018-09-21
|\
| * swaybar: log invalid i3bar jsonLibravatar Ian Fan2018-09-21
| |
| * swaybar: reset tokener if json is incompleteLibravatar Ian Fan2018-09-21
| | | | | | | | | | | | | | | | 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.
| * swaybar: update buffer_pos when moving object to start of bufferLibravatar Ian Fan2018-09-21
| |
* | swaybar: don't wl_display_roundtrip on each frameLibravatar emersion2018-09-20
| | | | | | | | | | | | | | 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.
* | swaybar: handle hotpluggingLibravatar emersion2018-09-20
|/ | | | Don't kill and respawn swaybars on hotplug.
* swaybar: only free tokener when using i3bar protocolLibravatar Ian Fan2018-09-18
|
* swaybar: add debugging statements for handling i3bar jsonLibravatar Ian Fan2018-09-18
|
* swaybar: rewrite i3bar protocol handlingLibravatar Ian Fan2018-09-18
| | | | | | | | 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.
* swaybar: rewrite protocol determinationLibravatar Ian Fan2018-09-18
| | | | | | | | 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).
* swaybar: rewrite text protocol handlingLibravatar Ian Fan2018-09-18
| | | | | | 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.
* swaybar: only create i3bar block hotspot if click events are enabledLibravatar Ian Fan2018-09-18
|
* swaybar: send trailing comma with click event jsonLibravatar Ian Fan2018-09-18
|
* swaybar: fix empty function prototypesLibravatar Ian Fan2018-09-18
|
* swaybar: invalidate file descriptors upon closingLibravatar Ian Fan2018-09-18
|
* swaybar: remove block links upon exitLibravatar Ian Fan2018-09-18
|
* swaybar: use output names instead of output indexesLibravatar emersion2018-09-17
|
* bar: remove i3bar_block_free in favour of i3bar_block_unrefLibravatar Ian Fan2018-09-14
|
* i3bar: count references to blocksLibravatar Ian Fan2018-09-12
| | | | | | | | | This prevents blocks from being destroyed before their hotspots are destroyed, in case it is used for a pending click event that fires between the bar receiving a new status, which destroys the block, and the bar rendering the new status, which destroys the hotspot; this problem can be easily produced by scrolling on a block that immediately causes a new status to be sent, with multiple outputs
* 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 swaybar block background fill logicLibravatar Jason2018-09-05
| | | Same as #2571 but for 1.0.
* Change _XOPEN_SOURCE defines to _POSIX_C_SOURCELibravatar sghctoma2018-09-03
|