Compare commits

...

15 Commits
1.6 ... master

Author SHA1 Message Date
Dylan Araps
f4cb48d7af
update 2020-10-21 15:36:42 +03:00
dylan
ccb96521c1
Merge pull request #101 from venam/master
Refresh keyboard mapping uppon MappingNotify event
2020-10-02 13:35:12 +03:00
Patrick Louis
5663175d57 Refresh keyboard mapping uppon MappingNotify event
When dynamically switching between layout the keys that are grabbed need
to also be refreshed. This is a fix similar to venam/2bwm@148d832

fixes dylanaraps#100
2020-10-02 11:35:03 +03:00
dylan
95596f43aa
Merge pull request #93 from Yul3n/master
Added links to the window managers in the thanks
2020-07-08 12:53:20 +03:00
yul3n
e595bfb365
Added links to the window managers in the thanks 2020-07-08 10:12:36 +02:00
dylan
d327a0978a
Merge pull request #89 from zsugabubus/makefile
sowm: fix Makefile dependencies
2020-06-16 12:24:10 +03:00
zsugabubus
0964d47d07
sowm: fix Makefile dependencies
So the binary no longer need to be deleted for a recompilation.
2020-06-16 10:30:13 +02:00
Dylan Araps
6ca1ff91a4
docs: update 2020-05-03 22:14:12 +03:00
Dylan Araps
dabe77272b
sowm: revert normal kill 2020-04-25 10:47:50 +03:00
Dylan Araps
ea47780ab0
sowm: Fix normal kill 2020-04-23 08:40:08 +03:00
Dylan Araps
0ed080b99c
sowm: small fixes 2020-04-23 08:27:13 +03:00
dylan
7e4466e38e
Merge pull request #60 from dylanaraps/kill
sowm: normal window close
2020-04-23 08:21:27 +03:00
Dylan Araps
56bdacaa84
docs: update. Closes #66 and #67 2020-03-30 08:56:41 +03:00
Dylan Araps
e22087856b
sowm: Compress window events after compressing all events. 2020-03-11 22:21:41 +02:00
Dylan Araps
3ed647f467
sowm: simpler kill 2020-02-20 18:02:11 +02:00
4 changed files with 45 additions and 19 deletions

View File

@ -4,13 +4,13 @@ PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin BINDIR ?= $(PREFIX)/bin
CC ?= gcc CC ?= gcc
all: config.h sowm all: sowm
config.h: config.h:
cp config.def.h config.h cp config.def.h config.h
sowm: sowm: sowm.c sowm.h config.h Makefile
$(CC) -O3 $(CFLAGS) -o sowm sowm.c -lX11 $(LDFLAGS) $(CC) -O3 $(CFLAGS) -o $@ $< -lX11 $(LDFLAGS)
install: all install: all
install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm
@ -20,3 +20,5 @@ uninstall:
clean: clean:
rm -f sowm *.o rm -f sowm *.o
.PHONY: all install uninstall clean

View File

@ -1,8 +1,8 @@
# sowm (*Simple Opinionated Window Manager*) # sowm (*~~Simple~~ Shitty Opinionated Window Manager*)
<a href="https://user-images.githubusercontent.com/6799467/66687576-9747c200-ec72-11e9-947d-5b96753eab03.jpg"><img src="https://user-images.githubusercontent.com/6799467/66687576-9747c200-ec72-11e9-947d-5b96753eab03.jpg" width="43%" align="right"></a> <a href="https://user-images.githubusercontent.com/6799467/66687576-9747c200-ec72-11e9-947d-5b96753eab03.jpg"><img src="https://user-images.githubusercontent.com/6799467/66687576-9747c200-ec72-11e9-947d-5b96753eab03.jpg" width="43%" align="right"></a>
An itsy bitsy floating window manager (*220~ sloc / 24kb compiled!*). An itsy bitsy floating window manager (*220~ sloc!*).
- Floating only. - Floating only.
- Fullscreen toggle. - Fullscreen toggle.
@ -38,8 +38,8 @@ Patches available here: https://github.com/dylanaraps/sowm/pulls
| `MOD4` + `f` | maximize toggle | | `MOD4` + `f` | maximize toggle |
| `MOD4` + `c` | center window | | `MOD4` + `c` | center window |
| `MOD4` + `q` | kill window | | `MOD4` + `q` | kill window |
| `MOD4` + `1-9` | desktop swap | | `MOD4` + `1-6` | desktop swap |
| `MOD4` + `Shift` +`1-9` | send window to desktop | | `MOD4` + `Shift` +`1-6` | send window to desktop |
| `MOD1` + `TAB` (*alt-tab*) | focus cycle | | `MOD1` + `TAB` (*alt-tab*) | focus cycle |
**Programs** **Programs**
@ -71,17 +71,28 @@ Patches available here: https://github.com/dylanaraps/sowm/pulls
4) (Optional) Apply patch with `git apply patches/patch-name` 4) (Optional) Apply patch with `git apply patches/patch-name`
- In case of applying multiple patches, it has to be done **manually**. - In case of applying multiple patches, it has to be done **manually**.
If you are using GDM, save the following to `/usr/share/xsessions/sowm.desktop`. It is still recommended to start `sowm` from `.xinitrc` or through
[your own xinit implementation](https://github.com/dylanaraps/bin/blob/dfd9a9ff4555efb1cc966f8473339f37d13698ba/x).
```
[Desktop Entry]
Name=sowm
Comment=This session runs sowm as desktop manager
Exec=sowm
Type=Application
```
## Thanks ## Thanks
- 2bwm - [2bwm](https://github.com/venam/2bwm)
- SmallWM - [SmallWM](https://github.com/adamnew123456/SmallWM)
- berry - [berry](https://github.com/JLErvin/berry)
- catwm - [catwm](https://github.com/pyknite/catwm)
- dminiwm - [dminiwm](https://github.com/moetunes/dminiwm)
- dwm - [dwm](https://dwm.suckless.org)
- monsterwm - [monsterwm](https://github.com/c00kiemon5ter/monsterwm)
- openbox - [openbox](https://github.com/danakj/openbox)
- possumwm - [possum-wm](https://github.com/duckinator/possum-wm)
- swm - [swm](https://github.com/dcat/swm)
- tinywm - [tinywm](http://incise.org/tinywm.html)

14
sowm.c
View File

@ -24,6 +24,7 @@ static void (*events[LASTEvent])(XEvent *e) = {
[ConfigureRequest] = configure_request, [ConfigureRequest] = configure_request,
[KeyPress] = key_press, [KeyPress] = key_press,
[MapRequest] = map_request, [MapRequest] = map_request,
[MappingNotify] = mapping_notify,
[DestroyNotify] = notify_destroy, [DestroyNotify] = notify_destroy,
[EnterNotify] = notify_enter, [EnterNotify] = notify_enter,
[MotionNotify] = notify_motion [MotionNotify] = notify_motion
@ -221,6 +222,15 @@ void map_request(XEvent *e) {
win_focus(list->prev); win_focus(list->prev);
} }
void mapping_notify(XEvent *e) {
XMappingEvent *ev = &e->xmapping;
if (ev->request == MappingKeyboard || ev->request == MappingModifier) {
XRefreshKeyboardMapping(ev);
input_grab(root);
}
}
void run(const Arg arg) { void run(const Arg arg) {
if (fork()) return; if (fork()) return;
if (d) close(ConnectionNumber(d)); if (d) close(ConnectionNumber(d));
@ -240,6 +250,8 @@ void input_grab(Window root) {
== XKeysymToKeycode(d, 0xff7f)) == XKeysymToKeycode(d, 0xff7f))
numlock = (1 << i); numlock = (1 << i);
XUngrabKey(d, AnyKey, AnyModifier, root);
for (i = 0; i < sizeof(keys)/sizeof(*keys); i++) for (i = 0; i < sizeof(keys)/sizeof(*keys); i++)
if ((code = XKeysymToKeycode(d, keys[i].keysym))) if ((code = XKeysymToKeycode(d, keys[i].keysym)))
for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++) for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++)
@ -272,6 +284,6 @@ int main(void) {
XDefineCursor(d, root, XCreateFontCursor(d, 68)); XDefineCursor(d, root, XCreateFontCursor(d, 68));
input_grab(root); input_grab(root);
while (1 && !XNextEvent(d, &ev)) while (1 && !XNextEvent(d, &ev)) // 1 && will forever be here.
if (events[ev.type]) events[ev.type](&ev); if (events[ev.type]) events[ev.type](&ev);
} }

1
sowm.h
View File

@ -39,6 +39,7 @@ void configure_request(XEvent *e);
void input_grab(Window root); void input_grab(Window root);
void key_press(XEvent *e); void key_press(XEvent *e);
void map_request(XEvent *e); void map_request(XEvent *e);
void mapping_notify(XEvent *e);
void notify_destroy(XEvent *e); void notify_destroy(XEvent *e);
void notify_enter(XEvent *e); void notify_enter(XEvent *e);
void notify_motion(XEvent *e); void notify_motion(XEvent *e);