Commit graph

87 commits

Author SHA1 Message Date
Simon Ser
fc640d5f6c Define _POSIX_C_SOURCE globally
See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
2024-02-23 17:43:19 +03:00
Manuel Stoeckl
169b90f90b Make command line option lists const 2021-02-04 09:49:06 +01:00
SpizzyCoder
7cf25d3b98 Changed fprintf(stdout,...) to printf(...) for more readable code 2021-01-16 20:24:41 +01:00
Ian Fan
5484f308b9 swaybar: prevent signal handler from firing during termination
This prevents a heap-use-after-free crash when sway terminates.
2019-02-15 14:09:14 +00:00
M Stoeckl
1211a81aad Replace wlr_log with sway_log
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.
2019-01-21 12:59:42 +01:00
Ian Fan
f87628e2ab swaybar: improve tray logging 2019-01-08 16:03:16 +00:00
emersion
3a310f92ab
Replace _XOPEN_SOURCE with _POSIX_C_SOURCE
And make sure we don't define both in the same source file.
2018-11-25 17:19:43 +01:00
Ian Fan
d0b54e932b swaybar: save id upon startup
This adds an id property to the bar, which will be used to filter
barconfig_update events
2018-10-14 13:33:12 +01:00
Ryan Dwyer
fa8959532b Fix program name in version strings
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-10 18:34:50 +10:00
Ian Fan
312d009f65 swaybar: fail if bar id is invalid 2018-09-28 13:48:59 +01:00
emersion
63b4bf5000
Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
Drew DeVault
cab1352801 Start port of swaybar to layer shell
This starts up the event loop and wayland display and shims out the
basic top level rendering concepts. Also includes some changes to
incorporate pango into the 1.x codebase properly.
2018-03-29 22:11:08 -04:00
Sebastian Noack
173b338567 Add -DVERSION flag for release version numbers 2017-04-26 15:56:46 +02:00
Drew DeVault
9aed9d9359 UnGNUify the codebase 2017-03-10 23:41:24 -05:00
Drew DeVault
416417a54c Reorganize includes 2016-09-01 08:18:37 -04:00
Mikkel Oscar Lyderik
6d57f03028 Make single bar handle multiple outputs 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik
5e253fdd9a Correctly exit sway on errors.
Calling `exit` in sway_terminate prevents sway from correctly shutting
down (freeing data, cleanly terminating the ipc server, etc.).

A better way is to exit straight away if the failure occurs before
`wlc_run` and use sway_abort as usual if it occur when wlc is running.
2016-02-26 09:42:21 +01:00
Mikkel Oscar Lyderik
ed227f5664 swaybar: move headers to include/bar 2016-01-24 15:55:58 +01:00
Mikkel Oscar Lyderik
aa6ad09183 swaybar: rename state to bar 2016-01-24 14:22:19 +01:00
Mikkel Oscar Lyderik
c6fc0033e1 swaybar: move core functionality to state.c 2016-01-24 14:22:19 +01:00
Mikkel Oscar Lyderik
6140f9c42c swaybar: Move swaybar_teardown to free_state 2016-01-24 14:22:19 +01:00
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