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
|
/kiwmi
|
||||||
/wmaffle
|
/seed
|
||||||
/*.c
|
/*.c
|
||||||
/*.d
|
/*.d
|
||||||
/*.html
|
/*.html
|
||||||
|
|
46
Makefile
46
Makefile
|
@ -1,16 +1,16 @@
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
WFLIT = wmaffle.lit
|
KWLIT = kiwmi.lit
|
||||||
WFSRC = wmaffle.c
|
KWSRC = kiwmi.c
|
||||||
WFTARGET = wmaffle
|
KWTARGET = kiwmi
|
||||||
|
|
||||||
SYLIT = syrup.lit
|
SELIT = seed.lit
|
||||||
SYSRC = syrup.c
|
SESRC = seed.c
|
||||||
SYTARGET = syrup
|
SETARGET = seed
|
||||||
|
|
||||||
SRC = $(WFSRC) $(SYSRC)
|
SRC = $(KWSRC) $(SESRC)
|
||||||
DEPS = $(SRC:.c=.d)
|
DEPS = $(SRC:.c=.d)
|
||||||
TARGETS = $(WFTARGET) $(SYTARGET)
|
TARGETS = $(KWTARGET) $(SETARGET)
|
||||||
|
|
||||||
VPATH = $(SRCPREFIX)/lit
|
VPATH = $(SRCPREFIX)/lit
|
||||||
|
|
||||||
|
@ -26,44 +26,44 @@ all: all-nodoc doc
|
||||||
|
|
||||||
all-nodoc: $(TARGETS)
|
all-nodoc: $(TARGETS)
|
||||||
|
|
||||||
$(WFTARGET): $(WFSRC)
|
$(KWTARGET): $(KWSRC)
|
||||||
@echo " [CC] $@..."
|
@echo " [CC] $@..."
|
||||||
$(HIDE) $(CC) -o "$@" "$<" $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
$(HIDE) $(CC) -o "$@" "$<" $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
$(SYTARGET): $(SYSRC)
|
$(SETARGET): $(SESRC)
|
||||||
@echo " [CC] $@..."
|
@echo " [CC] $@..."
|
||||||
$(HIDE) $(CC) -o "$@" "$<" $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
$(HIDE) $(CC) -o "$@" "$<" $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||||
|
|
||||||
$(WFSRC): $(WFLIT)
|
$(KWSRC): $(KWLIT)
|
||||||
@echo " [LIT] $@..."
|
@echo " [LIT] $@..."
|
||||||
$(HIDE) $(LIT) -t "$<"
|
$(HIDE) $(LIT) -t "$<"
|
||||||
|
|
||||||
$(SYSRC): $(SYLIT)
|
$(SESRC): $(SELIT)
|
||||||
@echo " [LIT] $@..."
|
@echo " [LIT] $@..."
|
||||||
$(HIDE) $(LIT) -t "$<"
|
$(HIDE) $(LIT) -t "$<"
|
||||||
|
|
||||||
doc: books
|
doc: books
|
||||||
|
|
||||||
books: syrup.html wmaffle.html
|
books: seed.html kiwmi.html
|
||||||
|
|
||||||
wmaffle.html: $(WFLIT)
|
kiwmi.html: $(KWLIT)
|
||||||
@echo " [LIT] $@..."
|
@echo " [LIT] $@..."
|
||||||
$(HIDE) $(LIT) -w "$<"
|
$(HIDE) $(LIT) -w "$<"
|
||||||
|
|
||||||
syrup.html: $(SYLIT)
|
seed.html: $(SELIT)
|
||||||
@echo " [LIT] $@..."
|
@echo " [LIT] $@..."
|
||||||
$(HIDE) $(LIT) -w "$<"
|
$(HIDE) $(LIT) -w "$<"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -d "$(DESTDIR)$(BINPREFIX)"
|
install -d "$(DESTDIR)$(BINPREFIX)"
|
||||||
install -m 755 "$(WFTARGET)" "$(DESTDIR)$(BINPREFIX)"
|
install -m 755 "$(KWTARGET)" "$(DESTDIR)$(BINPREFIX)"
|
||||||
install -m 755 "$(SYTARGET)" "$(DESTDIR)$(BINPREFIX)"
|
install -m 755 "$(SETARGET)" "$(DESTDIR)$(BINPREFIX)"
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@echo " [RM] $(WFTARGET)..."
|
@echo " [RM] $(KWTARGET)..."
|
||||||
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(WFTARGET)"
|
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(KWTARGET)"
|
||||||
@echo " [RM] $(SYTARGET)..."
|
@echo " [RM] $(SETARGET)..."
|
||||||
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(SYTARGET)""
|
$(HIDE) $(RM) "$(DESTDIR)$(BINPREFIX)/$(SETARGET)""
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo " [RM] $(DEPS)..."
|
@echo " [RM] $(DEPS)..."
|
||||||
|
@ -72,7 +72,7 @@ clean:
|
||||||
$(HIDE) $(RM) $(SRC)
|
$(HIDE) $(RM) $(SRC)
|
||||||
@echo " [RM] $(TARGETS)..."
|
@echo " [RM] $(TARGETS)..."
|
||||||
$(HIDE) $(RM) $(TARGETS)
|
$(HIDE) $(RM) $(TARGETS)
|
||||||
@echo " [RM] wmaffle.html syrup.html..."
|
@echo " [RM] kiwmi.html seed.html..."
|
||||||
$(HIDE) $(RM) wmaffle.html syrup.html
|
$(HIDE) $(RM) kiwmi.html seed.html
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
wmaffle
|
kiwmi
|
||||||
=======
|
=====
|
||||||
|
|
||||||
A fully manual tiling window manager for the X window system.
|
A fully manual tiling window manager for the X window system.
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Where's the source at?
|
||||||
|
|
||||||
In `lit/`.
|
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.
|
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.
|
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.
|
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.
|
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
|
@code_type c .c
|
||||||
@comment_type /* %s */
|
@comment_type /* %s */
|
||||||
|
|
||||||
@title wmaffle
|
@title kiwmi
|
||||||
|
|
||||||
@s Introduction
|
@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.
|
It parses it's arguments and prints either help / info text, or runs the window manager.
|
||||||
|
|
||||||
Here's an overview:
|
Here's an overview:
|
||||||
|
|
||||||
--- wmaffle.c
|
--- kiwmi.c
|
||||||
@{copyright notice}
|
@{copyright notice}
|
||||||
|
|
||||||
@{c headers}
|
@{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.
|
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
|
---get default config path
|
||||||
const char *config_home = getenv("XDG_CONFIG_HOME");
|
const char *config_home = getenv("XDG_CONFIG_HOME");
|
||||||
|
@ -153,7 +153,7 @@ if (config_home) {
|
||||||
sizeof(config_path),
|
sizeof(config_path),
|
||||||
"%s/%s",
|
"%s/%s",
|
||||||
config_home,
|
config_home,
|
||||||
"wmafflw/wmafflerc"
|
"kiwmi/kiwmirc"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
snprintf(
|
snprintf(
|
||||||
|
@ -161,7 +161,7 @@ if (config_home) {
|
||||||
sizeof(config_path),
|
sizeof(config_path),
|
||||||
"%s/%s",
|
"%s/%s",
|
||||||
getenv("HOME"),
|
getenv("HOME"),
|
||||||
".config/wmaffle/wmafflerc"
|
".config/kiwmi/kiwmi"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
@ -216,15 +216,15 @@ This requires this header file.
|
||||||
|
|
||||||
@s Get socket path
|
@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
|
--- get socket path
|
||||||
sock_path = getenv("WMAFFLE_SOCKET");
|
sock_path = getenv("KIWMI_SOCKET");
|
||||||
|
|
||||||
if (sock_path) {
|
if (sock_path) {
|
||||||
strncpy(sock_addr.sun_path, sock_path, sizeof(sock_addr.sun_path));
|
strncpy(sock_addr.sun_path, sock_path, sizeof(sock_addr.sun_path));
|
||||||
} else {
|
} 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
|
@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.
|
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.
|
`select` is used for the first two steps.
|
|
@ -1,14 +1,14 @@
|
||||||
@code_type c .c
|
@code_type c .c
|
||||||
@comment_type /* %s */
|
@comment_type /* %s */
|
||||||
|
|
||||||
@title syrup
|
@title seed
|
||||||
|
|
||||||
@s Introduction
|
@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.
|
The program is also simple. Here is an outline.
|
||||||
|
|
||||||
--- syrup.c
|
--- seed.c
|
||||||
@{copyright notice}
|
@{copyright notice}
|
||||||
@{c headers}
|
@{c headers}
|
||||||
@{posix headers}
|
@{posix headers}
|
||||||
|
@ -96,15 +96,15 @@ We're going to store the path in `sock_path`, local to main.
|
||||||
const char *sock_path;
|
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
|
--- get socket path
|
||||||
sock_path = getenv("WMAFFLE_SOCKET");
|
sock_path = getenv("KIWMI_SOCKET");
|
||||||
|
|
||||||
if (sock_path) {
|
if (sock_path) {
|
||||||
strncpy(sock_addr.sun_path, sock_path, sizeof(sock_addr.sun_path));
|
strncpy(sock_addr.sun_path, sock_path, sizeof(sock_addr.sun_path));
|
||||||
} else {
|
} 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