Renamed to kiwmi and seed
This commit is contained in:
parent
f369e1d8c5
commit
8396d5a35e
5 changed files with 45 additions and 45 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
|||
/syrup
|
||||
/wmaffle
|
||||
/kiwmi
|
||||
/seed
|
||||
/*.c
|
||||
/*.d
|
||||
/*.html
|
||||
|
|
46
Makefile
46
Makefile
|
@ -1,16 +1,16 @@
|
|||
include config.mk
|
||||
|
||||
WFLIT = wmaffle.lit
|
||||
WFSRC = wmaffle.c
|
||||
WFTARGET = wmaffle
|
||||
KWLIT = kiwmi.lit
|
||||
KWSRC = kiwmi.c
|
||||
KWTARGET = kiwmi
|
||||
|
||||
SYLIT = syrup.lit
|
||||
SYSRC = syrup.c
|
||||
SYTARGET = syrup
|
||||
SELIT = seed.lit
|
||||
SESRC = seed.c
|
||||
SETARGET = seed
|
||||
|
||||
SRC = $(WFSRC) $(SYSRC)
|
||||
SRC = $(KWSRC) $(SESRC)
|
||||
DEPS = $(SRC:.c=.d)
|
||||
TARGETS = $(WFTARGET) $(SYTARGET)
|
||||
TARGETS = $(KWTARGET) $(SETARGET)
|
||||
|
||||
VPATH = $(SRCPREFIX)/lit
|
||||
|
||||
|
@ -26,44 +26,44 @@ all: all-nodoc doc
|
|||
|
||||
all-nodoc: $(TARGETS)
|
||||
|
||||
$(WFTARGET): $(WFSRC)
|
||||
$(KWTARGET): $(KWSRC)
|
||||
@echo " [CC] $@..."
|
||||
$(HIDE) $(CC) -o "$@" "$<" $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
|
||||
$(SYTARGET): $(SYSRC)
|
||||
$(SETARGET): $(SESRC)
|
||||
@echo " [CC] $@..."
|
||||
$(HIDE) $(CC) -o "$@" "$<" $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
|
||||
$(WFSRC): $(WFLIT)
|
||||
$(KWSRC): $(KWLIT)
|
||||
@echo " [LIT] $@..."
|
||||
$(HIDE) $(LIT) -t "$<"
|
||||
|
||||
$(SYSRC): $(SYLIT)
|
||||
$(SESRC): $(SELIT)
|
||||
@echo " [LIT] $@..."
|
||||
$(HIDE) $(LIT) -t "$<"
|
||||
|
||||
doc: books
|
||||
|
||||
books: syrup.html wmaffle.html
|
||||
books: seed.html kiwmi.html
|
||||
|
||||
wmaffle.html: $(WFLIT)
|
||||
kiwmi.html: $(KWLIT)
|
||||
@echo " [LIT] $@..."
|
||||
$(HIDE) $(LIT) -w "$<"
|
||||
|
||||
syrup.html: $(SYLIT)
|
||||
seed.html: $(SELIT)
|
||||
@echo " [LIT] $@..."
|
||||
$(HIDE) $(LIT) -w "$<"
|
||||
|
||||
install:
|
||||
install -d "$(DESTDIR)$(BINPREFIX)"
|
||||
install -m 755 "$(WFTARGET)" "$(DESTDIR)$(BINPREFIX)"
|
||||
install -m 755 "$(SYTARGET)" "$(DESTDIR)$(BINPREFIX)"
|
||||
install -m 755 "$(KWTARGET)" "$(DESTDIR)$(BINPREFIX)"
|
||||
install -m 755 "$(SETARGET)" "$(DESTDIR)$(BINPREFIX)"
|
||||
|
||||
uninstall:
|
||||
@echo " [RM] $(WFTARGET)..."
|
||||
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(WFTARGET)"
|
||||
@echo " [RM] $(SYTARGET)..."
|
||||
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(SYTARGET)""
|
||||
@echo " [RM] $(KWTARGET)..."
|
||||
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(KWTARGET)"
|
||||
@echo " [RM] $(SETARGET)..."
|
||||
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(SETARGET)""
|
||||
|
||||
clean:
|
||||
@echo " [RM] $(DEPS)..."
|
||||
|
@ -72,7 +72,7 @@ clean:
|
|||
$(HIDE) $(RM) $(SRC)
|
||||
@echo " [RM] $(TARGETS)..."
|
||||
$(HIDE) $(RM) $(TARGETS)
|
||||
@echo " [RM] wmaffle.html syrup.html..."
|
||||
$(HIDE) $(RM) wmaffle.html syrup.html
|
||||
@echo " [RM] kiwmi.html seed.html..."
|
||||
$(HIDE) $(RM) kiwmi.html seed.html
|
||||
|
||||
-include $(DEPS)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
wmaffle
|
||||
=======
|
||||
kiwmi
|
||||
=====
|
||||
|
||||
A fully manual tiling window manager for the X window system.
|
||||
|
||||
|
@ -15,7 +15,7 @@ Where's the source at?
|
|||
|
||||
In `lit/`.
|
||||
|
||||
wmaffle is a literate program. It's a cool thing by Knuth. I'm not going to explain this, since https://en.wikipedia.org/wiki/Literate_programming[this] does it better anyways.
|
||||
kiwmi is a literate program. It's a cool thing by Knuth. I'm not going to explain this, since https://en.wikipedia.org/wiki/Literate_programming[this] does it better anyways.
|
||||
I'm using the https://github.com/zyedidia/Literate[Literate] utility for this, since it gets the job done, while keeping a light syntax for me.
|
||||
|
||||
Why? Literate programming is awesome. This allows people to learn from my stuff while making it easy to contribute.
|
||||
|
@ -38,7 +38,7 @@ Configuration
|
|||
-------------
|
||||
|
||||
Configuration languages suck and they add a lot of complexity to a program.
|
||||
`wmaffle` listens to a socket and offers a basic client (called `syrup`) to communicate with the WM.
|
||||
`kiwmi` listens to a socket and offers a basic client (called `seed`) to communicate with the WM.
|
||||
|
||||
This allows you to write your configuration in any language you want, while also removing the task of listening to keybinds for me, since you can use tools like https://github.com/baskerville/sxhkd[sxhkd] to do that.
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
@code_type c .c
|
||||
@comment_type /* %s */
|
||||
|
||||
@title wmaffle
|
||||
@title kiwmi
|
||||
|
||||
@s Introduction
|
||||
|
||||
This is the source code for wmaffle.
|
||||
This is the source code for kiwmi.
|
||||
It parses it's arguments and prints either help / info text, or runs the window manager.
|
||||
|
||||
Here's an overview:
|
||||
|
||||
--- wmaffle.c
|
||||
--- kiwmi.c
|
||||
@{copyright notice}
|
||||
|
||||
@{c headers}
|
||||
|
@ -142,7 +142,7 @@ I can clearly see how a user doesn't specify a config path.
|
|||
|
||||
This was a design decision to make, whether to load a default config. I decided to go with it.
|
||||
|
||||
It loads `"${XDG_CONFIG_HOME:-$HOME/.config}/wmaffle/wmafflerc"`.
|
||||
It loads `"${XDG_CONFIG_HOME:-$HOME/.config}/kiwmi/kiwmirc"`.
|
||||
|
||||
---get default config path
|
||||
const char *config_home = getenv("XDG_CONFIG_HOME");
|
||||
|
@ -153,7 +153,7 @@ if (config_home) {
|
|||
sizeof(config_path),
|
||||
"%s/%s",
|
||||
config_home,
|
||||
"wmafflw/wmafflerc"
|
||||
"kiwmi/kiwmirc"
|
||||
);
|
||||
} else {
|
||||
snprintf(
|
||||
|
@ -161,7 +161,7 @@ if (config_home) {
|
|||
sizeof(config_path),
|
||||
"%s/%s",
|
||||
getenv("HOME"),
|
||||
".config/wmaffle/wmafflerc"
|
||||
".config/kiwmi/kiwmi"
|
||||
);
|
||||
}
|
||||
---
|
||||
|
@ -216,15 +216,15 @@ This requires this header file.
|
|||
|
||||
@s Get socket path
|
||||
|
||||
We default to `/tmp/wmaffle.sock` if `WMAFFLE_SOCKET` isn't set.
|
||||
We default to `/tmp/kiwmi.sock` if `KIWMI_SOCKET` isn't set.
|
||||
|
||||
--- get socket path
|
||||
sock_path = getenv("WMAFFLE_SOCKET");
|
||||
sock_path = getenv("KIWMI_SOCKET");
|
||||
|
||||
if (sock_path) {
|
||||
strncpy(sock_addr.sun_path, sock_path, sizeof(sock_addr.sun_path));
|
||||
} else {
|
||||
strncpy(sock_addr.sun_path, "/tmp/wmaffle.sock", sizeof(sock_addr.sun_path));
|
||||
strncpy(sock_addr.sun_path, "/tmp/kiwmi.sock", sizeof(sock_addr.sun_path));
|
||||
}
|
||||
---
|
||||
|
||||
|
@ -302,7 +302,7 @@ exec_config(config_path);
|
|||
|
||||
@s Main loop
|
||||
|
||||
This is the heart of wmaffle.
|
||||
This is the heart of kiwmi.
|
||||
|
||||
A pretty basic loop: fetch event, decide if it's from X or the client, handle it.
|
||||
`select` is used for the first two steps.
|
|
@ -1,14 +1,14 @@
|
|||
@code_type c .c
|
||||
@comment_type /* %s */
|
||||
|
||||
@title syrup
|
||||
@title seed
|
||||
|
||||
@s Introduction
|
||||
Using syrup is rather straight forward. The syntax is as follows: `syrup COMMAND`.
|
||||
Using seed is rather straight forward. The syntax is as follows: `seed COMMAND`.
|
||||
|
||||
The program is also simple. Here is an outline.
|
||||
|
||||
--- syrup.c
|
||||
--- seed.c
|
||||
@{copyright notice}
|
||||
@{c headers}
|
||||
@{posix headers}
|
||||
|
@ -96,15 +96,15 @@ We're going to store the path in `sock_path`, local to main.
|
|||
const char *sock_path;
|
||||
---
|
||||
|
||||
We check if `WMAFFLE_SOCKET` is set, and use it, or default to `/tmp/wmaffle.sock`.
|
||||
We check if `KIWMI_SOCKET` is set, and use it, or default to `/tmp/kiwmi.sock`.
|
||||
|
||||
--- get socket path
|
||||
sock_path = getenv("WMAFFLE_SOCKET");
|
||||
sock_path = getenv("KIWMI_SOCKET");
|
||||
|
||||
if (sock_path) {
|
||||
strncpy(sock_addr.sun_path, sock_path, sizeof(sock_addr.sun_path));
|
||||
} else {
|
||||
strncpy(sock_addr.sun_path, "/tmp/wmaffle.sock", sizeof(sock_addr.sun_path));
|
||||
strncpy(sock_addr.sun_path, "/tmp/kiwmi.sock", sizeof(sock_addr.sun_path));
|
||||
}
|
||||
---
|
||||
|
Loading…
Add table
Reference in a new issue