mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-07-31 20:21:57 -07:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6b8a169b9d | ||
|
f201a467ea | ||
|
7821aac0d2 | ||
|
a1c80d9b23 | ||
|
0df345e1da | ||
|
b5087acaac |
4
Makefile
4
Makefile
@@ -9,8 +9,8 @@ all: config.h sowm
|
||||
config.h:
|
||||
cp config.def.h config.h
|
||||
|
||||
sowm: sowm.o
|
||||
$(CC) $(LDFLAGS) -O3 -o sowm sowm.c -lX11
|
||||
sowm:
|
||||
$(CC) -O3 $(CFLAGS) -o sowm sowm.c -lX11 $(LDFLAGS)
|
||||
|
||||
install: all
|
||||
install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm
|
||||
|
@@ -9,7 +9,8 @@ An itsy bitsy floating window manager (*220~ sloc / 24kb compiled!*).
|
||||
- Window centering.
|
||||
- Mix of mouse and keyboard workflow.
|
||||
- Focus with cursor.
|
||||
- Rounded corners (*[through patch](https://github.com/dylanaraps/sowm-patches)*)
|
||||
- Rounded corners (*[through patch](https://github.com/dylanaraps/sowm/pull/58)*)
|
||||
- Titlebars (*[through patch](https://github.com/dylanaraps/sowm/pull/57)*)
|
||||
|
||||
<a href="https://user-images.githubusercontent.com/6799467/66687814-8cd9f800-ec73-11e9-97b8-6ae77876bd1b.jpg"><img src="https://user-images.githubusercontent.com/6799467/66687814-8cd9f800-ec73-11e9-97b8-6ae77876bd1b.jpg" width="43%" align="right"></a>
|
||||
|
||||
@@ -23,7 +24,7 @@ An itsy bitsy floating window manager (*220~ sloc / 24kb compiled!*).
|
||||
|
||||
<br>
|
||||
|
||||
Patches available here: https://github.com/dylanaraps/sowm-patches
|
||||
Patches available here: https://github.com/dylanaraps/sowm/pulls
|
||||
|
||||
## Default Keybindings
|
||||
|
||||
|
15
sowm.c
15
sowm.c
@@ -255,6 +255,20 @@ void input_grab(Window root) {
|
||||
XFreeModifiermap(modmap);
|
||||
}
|
||||
|
||||
void win_init(void) {
|
||||
Window *child;
|
||||
unsigned int i, n_child;
|
||||
|
||||
XQueryTree(d, RootWindow(d, DefaultScreen(d)),
|
||||
&(Window){0}, &(Window){0}, &child, &n_child);
|
||||
|
||||
for (i = 0; i < n_child; i++) {
|
||||
XSelectInput(d, child[i], StructureNotifyMask|EnterWindowMask);
|
||||
XMapWindow(d, child[i]);
|
||||
win_add(child[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
XEvent ev;
|
||||
|
||||
@@ -271,6 +285,7 @@ int main(void) {
|
||||
XSelectInput(d, root, SubstructureRedirectMask);
|
||||
XDefineCursor(d, root, XCreateFontCursor(d, 68));
|
||||
input_grab(root);
|
||||
win_init();
|
||||
|
||||
while (1 && !XNextEvent(d, &ev))
|
||||
if (events[ev.type]) events[ev.type](&ev);
|
||||
|
Reference in New Issue
Block a user