Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szos/swmipc
An IPC client for StumpWM
https://github.com/szos/swmipc
Last synced: 10 days ago
JSON representation
An IPC client for StumpWM
- Host: GitHub
- URL: https://github.com/szos/swmipc
- Owner: szos
- Created: 2022-05-17T05:55:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-05-17T06:21:00.000Z (over 2 years ago)
- Last Synced: 2024-11-08T04:38:29.351Z (3 months ago)
- Language: C
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
- awesome-stumpwm - StumpWM IPC - A simple IPC server for StumpWM (Tools)
README
#+TITLE: StumpWM IPC
A simple IPC server for StumpWM
* Description
This is a simple IPC server for StumpWM, with an accompanying C client. This
was written mainly to make myself familiar with unix domain sockets; StumpWM
already has an IPC method based upon X11 atoms.* Building
The lisp server can be quickloaded, and the server started with the function
~#'simple-ipc-server:start-server~. The client can be built by the usual
~./autogen.sh~ ~./configure~ ~make~ ~make install~. After building, run
~swmipc --help~ for a list of options and their descriptions.
* Usage
The ~swmipc~ executable can send commands to be executed as well as lisp forms
to be evaluated. To evaluate lisp forms the variable
~simple-ipc-server:*allow-evaluation*~ must be ~T~. There is also an
interactive mode which reads input from the user and sends the appropriate
request.When reading commands from stdin every line is treated as a single command
invocation.During evaluation, standard output is bound to the socket stream, and printing
to standard output will print back to swmipc.** Examples
#+begin_src sh
$ swmipc -c echo-date "gnew mygroup"
Tue May 17 2022 7:18:05
$ swmipc -fi
swmipc> echo-windows
0*St
swmipc> echo ^1Hi
Hi
swmipc> ^D
$ swmipc -fi
swmipc> swmipc quit
$ cat forms.lisp | swmipc -e -
...
$ cat one-cmd-per-line.txt | swmipc -c "echo Running commands from file" -
#+end_src
** Notification Script
An example notification script:
#+begin_src sh
#!/bin/sh
txt="^[^3NOTIFICATION:^] $@"
swmipc -fc "echo $txt"
#+end_src