This patch series adds a new status command to kanshictl, which prints
out the current kanshi state to the standart output as a JSON string.
The feature is motivated by the idea of coupling power management to
the current kanshi profile via external programs (github#54 [1]).
However, kanshi is currently missing a posibility to query the current
profile.
The output is currently limited to {current,pending}_profile. If more
use cases arise in the future, the command can be extended to expose
more fields of the kanshi_state structure.
[1] https://github.com/emersion/kanshi/issues/54
Illia Ostapyshyn (2):
ctl: Pass method to reply handler
ipc: Expose state via fr.emersion.kanshi.Status
ctl.c | 34 +++++++++++++++++++++++++++-------
ipc.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 7 deletions(-)
--
2.47.0
Sorry for the delay! The patch LGTM, I've pushed it. Thanks!
Might be nice to pretty-print the output in kanshictl. (For programmatic
use, it's better to use a generic varlink tool instead.)
kanshi/patches/.build.yml: SUCCESS in 18s
[Expose current state via kanshictl][0] from [Illia Ostapyshyn][1]
[0]: https://lists.sr.ht/~emersion/public-inbox/patches/56357
[1]: mailto:illia@yshyn.com
✓ #1385766 SUCCESS kanshi/patches/.build.yml https://builds.sr.ht/~emersion/job/1385766
Sorry for the delay! The patch LGTM, I've pushed it. Thanks!
Might be nice to pretty-print the output in kanshictl. (For programmatic
use, it's better to use a generic varlink tool instead.)
kanshi/patches/.build.yml: SUCCESS in 18s
[Expose current state via kanshictl][0] from [Illia Ostapyshyn][1]
[0]: https://lists.sr.ht/~emersion/public-inbox/patches/56357
[1]: mailto:illia@yshyn.com
✓ #1385766 SUCCESS kanshi/patches/.build.yml https://builds.sr.ht/~emersion/job/1385766