Commit Graph

73 Commits

Author SHA1 Message Date
Mikkel Oscar Lyderik
fcc47cb3bd swaybar: move ipc stuff to ipc.{h,c} 2016-01-24 14:22:19 +01:00
Mikkel Oscar Lyderik
a6349a2444 swaybar: feactor render, statusline 2016-01-24 14:22:19 +01:00
Mikkel Oscar Lyderik
bb986cb336 swaybar: Separate config 2016-01-24 14:22:17 +01:00
Christoph Gysin
ac3f36c091 swaybar: add --help option 2016-01-23 21:32:33 +02:00
Christoph Gysin
bba72fb21a swaybar: debug option takes no argument 2016-01-23 21:23:00 +02:00
Mikkel Oscar Lyderik
364e37a1eb Fix whitespace issues. 2016-01-05 23:42:40 +01:00
crondog
7f7e06d4c9 swaybar: fix logging
Optionally turn on debugging in swaybar. I acidentally introduced
persistent logging in a previous commit
2016-01-04 11:22:20 +11:00
Mikkel Oscar Lyderik
576181ec09 swaybar: Implement workspace_buttons yes|no 2016-01-03 22:40:43 +01:00
Mikkel Oscar Lyderik
aa2f754c64 swaybar: Implement binding_mode_indicator 2016-01-03 22:16:36 +01:00
Drew DeVault
f2d519d0ba Merge pull request #427 from mikkeloscar/ipc-update
Refactor IPC server/client
2016-01-03 15:37:35 -05:00
Mikkel Oscar Lyderik
7298a9c67a Add type to returned response.
Makes `ipc_recv_response` return a struct with size, type and payload
rather than just the payload string.

This is useful if the type has to be checked on the client.
2016-01-03 20:40:50 +01:00
Mikkel Oscar Lyderik
a20226772e swaybar: rename ipc_listen_sock.. to ipc_event_sock.. 2016-01-03 18:52:53 +01:00
Mikkel Oscar Lyderik
c2f3530fab Only strip when starting with a num
This makes sure the `:` isn't striped if you have a workspace named:
`:something`.
2016-01-03 17:48:47 +01:00
Mikkel Oscar Lyderik
ccdcdc3396 swaybar: Implement strip_workspace_numbers 2016-01-03 17:37:32 +01:00
Mikkel Oscar Lyderik
14dd358a55 saybar: remove stray logline 2015-12-29 12:01:26 +01:00
Mikkel Oscar Lyderik
d72be6c0d5 swaybar: Add support for custom separator symbol 2015-12-28 22:45:13 +01:00
Drew DeVault
97a4f7ceac Merge pull request #409 from mikkeloscar/bar-airblade-features
swaybar: Add support for Airblade i3bar extensions
2015-12-27 11:10:41 -05:00
Mikkel Oscar Lyderik
8955e5f1ad swaybar: Free unused IPC response 2015-12-27 13:45:22 +01:00
Mikkel Oscar Lyderik
e7aef1e23c swaybar: if-else style fixes 2015-12-27 13:26:37 +01:00
Mikkel Oscar Lyderik
d21b15a4be swaybar: Add support for Airblade i3bar extensions
This extends the i3bar protocol implementation with the following
features from @Airblade/i3:

* background
* border
* border_top, border_bottom, border_left, border_right

A block will now be rendered like this:

```
(border_left + margin) + width + (margin + border_right) + sep
```

Where `border_left/border_right` and their related margin is only drawn
if the `border` is specified and the border has a width > 0 (default is
1).

`border_top` and `border_bottom` does not affect the height of the bar
(no margin is added), thus it will be drawn behind the text if it is too
big. The user should specify a bar height if more space between
top/bottom borders are required.
2015-12-27 13:18:55 +01:00
Mikkel Oscar Lyderik
26d2381040 swaybar: remove random whitespaces 2015-12-25 15:59:00 +01:00
Mikkel Oscar Lyderik
e370187394 swaybar: Fix json related crash.
This should fix the random json related crashes in swaybar.

The crashes occured because the same socket was used for listening on
workspace events and requesting workspace info, resulting in a
unreliable message queue on the socket.

The solution is to use one socket for the events and one socket for
reliably requesting workspace/output info.
2015-12-25 15:57:04 +01:00
crondog
8e8ec6d92b Merge branch 'master' of https://github.com/SirCmpwn/sway 2015-12-25 08:59:01 +11:00
progandy
21541e9e64 swaybar: Replace fgets with read and own buffer 2015-12-24 13:20:37 +01:00
crondog
edd93b5b55 swaybar: min_width and align 2015-12-24 13:55:17 +11:00
progandy
b66c51ea2c swaybar: fix array indices in i3json_handle 2015-12-24 01:21:29 +01:00
crondog
bd74320da9 Stop swaybar from not rendering after the first go around
I am not sure if this is a correct issue/fix but on my system at least
after an i3bar protocol is detected this while loop never goes back
around meaning it doesnt process the status line anymore.
2015-12-23 10:49:21 +11:00
progandy
8fefdb3c64 swaybar: fix memory leaks 2015-12-22 17:54:47 +01:00
progandy
d060d0a39f swaybar: add a visible separator between elements 2015-12-22 17:54:38 +01:00
progandy
aa5930c966 swaybar: Improve i3bar proto implementation
Also reintroduce plaintext fallback for simple status lines.
2015-12-22 17:34:37 +01:00
progandy
d37169a927 swaybar: fix whitespace 2015-12-22 17:26:40 +01:00
crondog
70b24fbb1f Clean up a bit 2015-12-22 22:49:41 +11:00
crondog
d1f6f45cb3 Make start on i3bar json parsing 2015-12-22 22:36:57 +11:00
Mikkel Oscar Lyderik
5c8a3afff9 swaybar: Correct handling of SIGTERM.
Swaybar did not correctly handle the SIGTERM sent from sway when
exiting, ultimately leaving the child status_command behind.
This should correctly handle the SIGTERM signal and terminate the
status_command.

Fix #386
2015-12-21 11:50:56 +01:00
Mikkel Oscar Lyderik
83eb8d16aa swaybar: Add font support 2015-12-20 18:32:54 +01:00
Mikkel Oscar Lyderik
d373a193ac swaybar: pixel perfect layout
This should make the bar workspace button layout identical to the layout
used in i3.
2015-12-20 17:52:33 +01:00
crondog
da6cd3cef7 swaybar: use height from config 2015-12-20 15:47:32 +11:00
Mikkel Oscar Lyderik
bc9b93f597 swaybar: use select instead of busyloop
Use of busyloop caused high cpu usage for sway because swaybar had to be
redrawn all the time. By using select instead the bar only has to be
redrawn when the status_command changes (i.e. every second) or when the
workspaces are updated.

Fix #345
2015-12-19 16:33:58 +01:00
crondog
c8555f5813 swaybar: use position from config 2015-12-19 12:15:12 +11:00
Drew DeVault
859f2fea0c Just bail if ws_json is fucked up 2015-12-18 19:45:16 -05:00
Drew DeVault
de2f3b393a Wow that was stupid 2015-12-18 19:38:36 -05:00
Drew DeVault
d1e031025d I'm still getting crashes without this line 2015-12-18 19:35:27 -05:00
S. Christoffer Eliesen
de219f6bec swaybar: ipc_update_ws: Fix memory corruption.
json_object_object_get_ex does not require json_object_put according to
docs, this should fix the random crashes.
2015-12-18 15:30:46 +01:00
Drew DeVault
a116eafaa4 Fix possible segfault in swaybar 2015-12-18 09:03:45 -05:00
S. Christoffer Eliesen
8a6e05d7a1 swaybar: Remove stropts.h, fixes build for fedora.
Turns out that fedora killed off stropts.h some time ago [1] and
removing it seems to work just fine. (Tested on Fedora 23)

[1] https://bugzilla.redhat.com/show_bug.cgi?id=439403
2015-12-18 13:18:35 +01:00
Mikkel Oscar Lyderik
529ee83ef6 swaybar: terminate status_command process
Fix #346

Send SIGTERM to the `status_command` process before swaybar exits.
2015-12-18 03:15:49 +01:00
Drew DeVault
d91185d67b Fix null dereference in swaybar 2015-12-17 08:30:45 -05:00
Mikkel Oscar Lyderik
0f7614306d swaybar: Check that registry is set before teardown 2015-12-17 02:45:14 +01:00
Drew DeVault
adadb109a7 Only re-render swaybar when it has changed
Fixes #345
2015-12-16 20:09:23 -05:00
Drew DeVault
5a9cc96446 Make swaybar a little quieter 2015-12-16 19:37:03 -05:00