Commit graph

1015 commits

Author SHA1 Message Date
Daniel Eklöf
20df360937
module/i3: add option ‘sort’
Possible values: none, ascending, descending. Sorts the workspace list
accordingly. The default value is ‘none’.
2020-12-08 19:03:30 +01:00
Daniel Eklöf
45d9dbcb34
Merge branch 'xcb-fallback-to-non-primary-monitor'
Closes #20
2020-12-04 22:09:05 +01:00
Daniel Eklöf
8249b9c7ea
changelog: fallback to non-primary monitor 2020-12-04 22:08:05 +01:00
Daniel Eklöf
d0f1f762ea
bar/xcb: fallback to non-primary monitor
If the user did *not* configured a specific monitor, we prefer the
primary monitor. However, if that monitor is disconnected, yambar
would exit with:

  no matching monitor

This patch changes this, to use the *last* connected monitor. It also
improves the error message.

Note: if the user did specify a monitor in the configuration, but
perhaps misspelled it, we will *not* fallback to another monitor, but
instead log an error saying that specific monitor could not be found.
2020-12-04 21:16:14 +01:00
Daniel Eklöf
d5fc1074d8
module/i3: revert to old behavior of not sorting workspaces
Sorting workspaces needs a config option.
2020-12-03 19:07:41 +01:00
Daniel Eklöf
678d82e4d4
module/i3: use a tllist for workspaces instead of a dynamic array 2020-12-03 18:31:42 +01:00
Daniel Eklöf
b9fda4482d
changelog: fold long lines 2020-12-02 21:47:16 +01:00
Daniel Eklöf
c9ef44a775
Merge branch 'mpd-volume' 2020-12-02 21:45:04 +01:00
optimus-prime
96d2d057e0 module/mpd: add volume tag 2020-12-03 00:43:47 +05:30
Daniel Eklöf
4dba602bfd
Merge branch 'custom-script'
Closes #11
2020-11-25 20:42:09 +01:00
Daniel Eklöf
9718c6f31e
examples: scripts: cpu: fix idle and total calculation
* include iowait in idle
* guest/guestnice is accounted in user/nice, so need to subtract them
  to not count them twice
2020-11-25 20:41:44 +01:00
Daniel Eklöf
4a9f550069
module/battery: don’t crash if we fail to read from ‘status’ 2020-11-25 20:41:44 +01:00
Daniel Eklöf
f49652130d
config: don’t crash (div-by-zero) if the alpha component is 0 2020-11-25 20:41:41 +01:00
Daniel Eklöf
220e43526c
readme: fix link to configuration examples 2020-11-25 20:41:27 +01:00
Daniel Eklöf
9d37697c4f
readme: add script to list of modules, with link to example scripts 2020-11-25 20:41:27 +01:00
Daniel Eklöf
f735bc5bd9
readme: add link to configuration examples 2020-11-25 20:41:27 +01:00
Daniel Eklöf
ae983b63c2
readme: add river and sway-xkb to list of modules 2020-11-25 20:41:26 +01:00
Daniel Eklöf
b1ee1ba403
examples: script: cpu.sh add missing “‘” 2020-11-25 20:41:26 +01:00
Daniel Eklöf
d5a92cbf5f
examples: script: cpu.sh - measures CPU usage at a configurable interval 2020-11-25 20:41:26 +01:00
Daniel Eklöf
58e53b80a9
changelog: new module: script 2020-11-25 20:41:24 +01:00
Daniel Eklöf
321d1cdc7d
particle/progress-bar: handle tag_for_name() failing 2020-11-25 20:41:10 +01:00
Daniel Eklöf
31c015c680
particle/ramp: handle tag_for_name() failing 2020-11-25 20:41:10 +01:00
Daniel Eklöf
05aa44f1ab
examples: move laptop.conf -> configurations/laptop.conf 2020-11-25 20:41:10 +01:00
Daniel Eklöf
f438ad9b44
module/script: send SIGINT, SIGTERM, SIGKILL, until child has died 2020-11-25 20:41:10 +01:00
Daniel Eklöf
2fe602a6a2
main: no need to block SIGCHLD anymore, we don’t use it 2020-11-25 20:41:10 +01:00
Daniel Eklöf
ba54e709ee
module/script: no need to handle SIGCHLD
Assume that a closed pipe means the child died. Even if it hasn’t, we
can’t read anymore from it. We’ll end up killing it anyway before
returning from run().
2020-11-25 20:41:10 +01:00
Daniel Eklöf
e0169d38f3
module/script: don’t re-direct stderr to /dev/null 2020-11-25 20:41:10 +01:00
Daniel Eklöf
aa34925f54
module/script: close all unrelated FDs
While most FDs are CLOEXEC, not all are. For example, other script
modules’ re-direction pipes.
2020-11-25 20:41:10 +01:00
Daniel Eklöf
31f6a4a6a0
module/script: don’t re-close comm-pipe on failure 2020-11-25 20:41:10 +01:00
Daniel Eklöf
c11a79c98d
bar, module: particles may no longer return NULL in instantiate() 2020-11-25 20:41:10 +01:00
Daniel Eklöf
fef40d18e1
module/sway-xkb: fix name of .so file, fixes load failures when built as shared module 2020-11-25 20:41:09 +01:00
Daniel Eklöf
df2d8fec36
particle/list: assert sub particles where instantiated correctly 2020-11-25 20:41:09 +01:00
Daniel Eklöf
44db9304c5
particle/ramp: assert sub particles where instantiated correctly 2020-11-25 20:41:09 +01:00
Daniel Eklöf
c3cfae13e8
particle/progress-bar: assert sub particles where instantiated correctly 2020-11-25 20:41:09 +01:00
Daniel Eklöf
86ef9dcc02
particle/map: don’t return NULL from instantiate()
Instead return an empty dynlist.
2020-11-25 20:41:09 +01:00
Daniel Eklöf
198a351c7c
meson: particles: data-driven foreach loop, and link map against dynlist 2020-11-25 20:41:09 +01:00
Daniel Eklöf
d0360f2de1
particle: reset signals and signal mask when executing an on-click handler 2020-11-25 20:41:09 +01:00
Daniel Eklöf
074af015fb
module/river: exclude seats while river is starting up
This is mainly to fix a race when river is *not* running; sometimes we
ended up allocating particles for N seats in content(), but then when
iterating the seats, run() had destroyed all, or some of the seats,
causing us to feed NULL pointers to dynlist, which crashed.
2020-11-25 20:41:09 +01:00
Daniel Eklöf
74754b0ab9
module/script: improved verification of tag type parameters and tag values
* Verify int/float/bool values are that, and nothing else
* Verify tag ranges are integers
* Verify a range tag value is inside its range
* Don’t allow anything but false|true for booleans
2020-11-25 20:41:09 +01:00
Daniel Eklöf
d10ad8924b
doc/yambar-modules: document the ‘script’ module 2020-11-25 20:41:07 +01:00
Daniel Eklöf
f0a34d0055
module/script: parse booleans correctly
User is expected to send ‘false’ or ‘true’. But we were parsing the
value using `strtol()`. This caused all bools to be false, since
`strtol()` would always return 0.
2020-11-25 20:36:46 +01:00
Daniel Eklöf
1e5a1d0341
particle/map: return NULL if we neither find a matching tag, nor have a default tag 2020-11-25 20:36:46 +01:00
Daniel Eklöf
4d05947985
bar: deal with NULL exposables
Allow modules to return NULL in begin_expose()
2020-11-25 20:36:46 +01:00
Daniel Eklöf
2bb70c6fcb
module/script: require ‘path’ to be an absolute path 2020-11-25 20:36:46 +01:00
Daniel Eklöf
5c9030129d
module/script: use NULL terminated ‘value’ when converting to int/bool/float 2020-11-25 20:36:46 +01:00
Daniel Eklöf
37447cd955
module/script: initialize string tags from our NULL-terminated ‘value’
`_value` is a pointer into the receive buffer, and may not be NULL
terminated, and may also contain data belonging to the next tag.
2020-11-25 20:36:46 +01:00
Daniel Eklöf
9945fce2d2
module/script: explicitly ignore return value of write(3) 2020-11-25 20:36:45 +01:00
Daniel Eklöf
7f1ffd126b
module/script: close script communication pipe FD on error 2020-11-25 20:36:45 +01:00
Daniel Eklöf
fb0d443e1d
module/script: plug memory leak: free ‘tags’ array 2020-11-25 20:36:45 +01:00
Daniel Eklöf
008235d904
bar/wayland: close command pipe FDs in cleanup 2020-11-25 20:36:45 +01:00