all repos — ryudo @ 2e003caebde4ddca0f99e953860cab7ff7275a1c

the floatiling window manager that flows; fork of rio from plan9port

v1.3.0 ready for release; fix for wrangle and zoom keybinds, update docs and config.def.h
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmIecmYACgkQO3+8IhRO
Y5gTCg/+NKSWn42AXhV+37i04+25w2WNZj0yH6GalNyhedhom/dIQ+nv0KerWllL
DXeBIX6Q+4Dx/EkJrHQKygeBxc8J7faJccXNQMjB6cyT+VkNUCYq8/vE7SmvFQ+m
p1OJ7msSrRg7lvsIIhC+KESoqbHBXfL5ImqcQESJl3Z80KelVkoIkG5prrDgPha5
tPpvzFnS1tWH1Z4RxUahas1r+P92pfPgCaK4jecEOIaoB0PBnLd1Gt/uFLzl1txo
utn5vwrkFGuY/JcnVE/IdSW7k3pj5Ddd+1iFyVkBHvyCBOAr5gOaNaaevdxKOjBT
xh6F+OBI9rszZLQjOplGDvOX9HbX5PHsIxQUmp9CLdQ0irsAynHQwELmZgCmENTl
W4i56UM5l0MgxN/tdhI0LFQ2tF6542J6A7LLGwjygSrPa1+6cKzYKQdYTUXPenDv
Pn4eLzRm0/zXrLLTHS80bkU0CgSxSTnY3Z5UOqZoH3VFime+XjrkRseHLdJ/ELpX
bWQX6Hi4AJkF2PcItKXXLS7HQUhT20Eso0AafPppqdPkmqTV/xWVIhgKBdI4InNy
qywb8s74j21I83hIRTZkn64fX4OwX7ysfF2ettl8SI2eEYf36xvHvxnsBcSNOf8p
cNXzW0J5hgejUxEP+TtbA+GVIu5/F1jzfXnjoTMRwsQlIHMqNho=
=R7dP
-----END PGP SIGNATURE-----
commit

2e003caebde4ddca0f99e953860cab7ff7275a1c

parent

69da0d7c775508da0ccac9466a5da237bb4899ef

M README.mdREADME.md

@@ -2,22 +2,24 @@ # [[ RYUDO ]]

## the minimalist floatiling window manager that flows -- Derek Stevens <nilix@nilfm.cc> 2019 -- -![micro centered](./screenshots/micro_centered.png) -![floating porn](./screenshots/floating.png) -![firefox maximized](./screenshots/firefox_maximized.png) -![pseudotiling](./screenshots/pseudotiling.png) +[![micro centered](./screenshots/micro_centered.png.thumb.png)](./screenshots/micro_centered.png) +[![floating porn](./screenshots/floating.png.thumb.png)](./screenshots/floating.png) +[![firefox maximized](./screenshots/firefox_maximized.png.thumb.png)](./screenshots/firefox_maximized.png) +[![pseudotiling](./screenshots/pseudotiling.png.thumb.png)](./screenshots/pseudotiling.png) ### About `ryudo` is a fork of Russ Cox's `rio`, itself a fork of David Hogan's `9wm`. The primary additions I've made are: -- `urxvt`, `konsole`, and `Alacritty` are detected as proper terminal programs for sweeping out new windows +- Explicit list of eligible terminal programs in `config.h` - `urxvt` is the default terminal emulator (still tries `9term` and then `xterm` if no dice) - Window spawning behavior has been made more natural -- windows shouldn't spawn partially offscreen like with `rio` - Customizable colors, borders, fonts, gaps, and keybinds in `config.h` - Multimonitor support via `Xrandr` - Default keybindings: + New Terminal: Super+Slash + + Switch Windows: Alt-Tab + + Switch to Window on the next monitor: Alt-Shift-Tab + Destroy: Super+D + Iconify: Super+I + Uniconify: Super+U

@@ -45,6 +47,7 @@ + `TRANSPARENTLIST` of window classes to be rendered with partial transparency (and corresponding OPACITY setting)

+ Optionally notify with `notify-send` which desktop is switched to (I use it with `dunst`) + Gaps for pseudo-tiling + Option to swap the keyboard shortcuts between "Snap Big Center" and "Snap Floating Center" (and the preferred behavior for terminals launched by keyboard) + + Focus model for new windows in multimonitor setup (follow mouse or follow active window) The name "Ryudo" is a nod to "Rio" and a Japanese word for "flow." Using `ryudo` should feel very natural -- you can do things with keyboard or

@@ -80,204 +83,3 @@

### Legacy The original README from `rio`, (which contains the original README from 9wm) is in this repository. See [README.rio](./readme.rio) -This is David Hogan's 9wm updated to behave more like -Plan 9's rio. Since I cannot get approval for the changes -and I'd prefer not to resort to patches, I have renamed it "rio". - -Current incompatibilities that would be nice to fix: - -- The command-line options should be made more like Plan 9. - -- Should work out a protocol between 9term and rio so that: - * 9term can tell rio to blue its border during hold mode - -- Should change window focus on b2/b3 clicks and then - pass along the click event to the now-focused window. - -- Should change 9term to redirect b3 clicks to rio so that rio - can put up the usual b3 menu. - -Axel Belinfante contributed the code to handle border grabbing -for resize and various other improvements. - -The original README is below. - -- russ cox -rsc@swtch.com -30 march 2004 - - - 9wm Version 1.2 - Copyright 1994-1996 David Hogan. - -What is 9wm? -============ - -9wm is an X window manager which attempts to emulate the Plan 9 window -manager 8-1/2 as far as possible within the constraints imposed by X. -It provides a simple yet comfortable user interface, without garish -decorations or title-bars. Or icons. And it's click-to-type. This -will not appeal to everybody, but if you're not put off yet then read -on. (And don't knock it until you've tried it.) - -One major difference between 9wm and 8-1/2 is that the latter provides -windows of text with a typescript interface, and doesn't need to run a -separate program to emulate a terminal. 9wm, as an X window manager, -does require a separate program. For better 8-1/2 emulation, you should -obtain Matthew Farrow's "9term" program (ftp://ftp.cs.su.oz.au/matty/unicode), -version 1.6 or later (earlier versions don't cooperate with 9wm in -implementing "hold mode"). Of course, you can run xterm under 9wm as well. - -What is 9wm not? -================ - -9wm is not a virtual window manager. It is not customisable to any -great extent. It is not large and unwieldy, and doesn't use the X -toolkit. Requests to make it any of these things will be silently -ignored (or flamed if I have had a bad day :-) If you want tvtwm -or mwm, you know where to get them... - -Where do I get it? -================== - -The latest version of 9wm is held at ftp://ftp.cs.su.oz.au/dhog/9wm - -Author -====== - -9wm was written by David Hogan (dhog@cs.su.oz.au), a postgraduate -student at the Basser Department of Computer Science, University -of Sydney (http://www.cs.su.oz.au/~dhog/). - -Licence -======= - - 9wm is free software, and is Copyright (c) 1994-1996 by David Hogan. - Permission is granted to all sentient beings to use this software, - to make copies of it, and to distribute those copies, provided - that: - - (1) the copyright and licence notices are left intact - (2) the recipients are aware that it is free software - (3) any unapproved changes in functionality are either - (i) only distributed as patches - or (ii) distributed as a new program which is not called 9wm - and whose documentation gives credit where it is due - (4) the author is not held responsible for any defects - or shortcomings in the software, or damages caused by it. - - There is no warranty for this software. Have a nice day. - -How do I compile/install it? -============================ - -Assuming your system is correctly configured, you should only need to -run xmkmf to generate the Makefile, and then run make or make install. -make install.man should copy the manpage (9wm.man) to the appropriate -directory. - -If the make fails, complaining that the function _XShapeQueryExtension -does not exist, try removing the "-DSHAPE" from the Imakefile, and -run xmkmf and make again. - -If you don't have imake, or it is misconfigured, or you would prefer -not to use it, try copying the file "Makefile.no-imake" to "Makefile", -then edit the definitions in this Makefile to suit your system. This -may require defining suitable compilation flags for your system -(normally imake does this for you). For instance, on AIX you must -include "-DBSD_INCLUDES" in CFLAGS. - -How do I use it? -================ - -See the manual page for details. You should probably read the -man page for 9term as well. - -What if I find a bug? -===================== - -Please mail all bug reports to 9wm-bugs@plan9.cs.su.oz.au, so -that I can incorporate fixes into the next release. If you can -tell me how to fix it, all the better. - -Known Problems/Bugs -=================== - -9wm tries hard to emulate 8-1/2, but isn't 100% compatible. If -you are an experienced 8-1/2 user, please be patient with it. - -One intentional difference between 9wm and 8-1/2 is in the behaviour -of the menu when the last hidden item is unhidden. Under 8-1/2, when -the menu is next used, it pops up with "New" selected. Under 9wm, -the (new) last menu item will be selected. This is a feature. It -may be confusing if you frequently switch between 9wm and 8-1/2. -If you don't like this feature, email me for the one line fix. - -There have been some problems encountered when resizing 9term on -some platforms. This turns out to be a problem in 9term (actually -in libXg, to be precise). Newer versions of 9term should be -immune to this, see matty@cs.su.oz.au if your 9term needs fixing. - -Some client programs do weird things. One of these is Frame Maker. -It appears that if it has a modal dialog on the screen, then if any -of its windows are current, all keypresses are redirected to the -modal dialog. This is not 9wm's fault -- Frame Maker is doing this. - -Programs like Netscape Navigator like to put riddiculously long -icon name properties on their windows, of the form "Netscape: blah blah". -There is no way that I know of to stop netscape from doing this. For this -reason, 9wm truncates labels at the first colon it finds. This keeps the -button 3 menu from becoming excessively wide. Note that with same -applications, you can use an iconName resource to set the label; this -works well for "xman", whose default icon name of "Manual Browser" -is a tad too long. - -See Also -======== - -http://www.cs.su.oz.au/~dhog/ - The 9wm Home Page - -ftp://ftp.cs.su.oz.au/matty/unicode/ - for source to 9term (get README first) - -ftp://plan9.att.com/plan9/unixsrc/sam/ - for source && info on Rob Pike's editor "sam" - -ftp://rtfm.mit.edu/pub/usenet/news.answers/unix-faq/shell/rc - for information on a publically available implementation - of the Plan 9 shell "rc" for unix (or look in comp.unix.shell). - -ftp://viz.tamu.edu/pub/rc - for source to the abovementioned implementation of rc. - -http://plan9.att.com/plan9/ -http://plan9.att.com/magic/man2html/1/8%c2%bd - for information on Plan 9 (including the 8-1/2 manual entry) - -Acknowledgements -================ - -Thanks to Rob Pike for writing the original 8-1/2 program (and -before that, mux) which inspired the writing of 9wm. - -Thanks to John Mackin, whose gwm "wool code" for emulating mux -was also an inspiration: I used it (and hacked it) until I got -too frustrated with gwm's large memory requirements and lack of -speed (sorry Colas!), and decided to write a dedicated program. - -Thanks to Matthew Farrow for writing 9term. - -A big thanks to Dave Edmondson for adding support for -multi-screen displays. - -The following people helped beta test 9wm: - - John Mackin - Noel Hunt - Fred Curtis - James Matthew Farrow - Danny Yee - Arnold Robbins - Byron Rakitzis - micro@cooper.edu
M config.def.hconfig.def.h

@@ -31,7 +31,7 @@ #define MENUBORDER 0

#define MBORDERCOL 0x000000 /* Normal menu colors */ -#define MENUFGCOL 0x797979 +#define MENUFGCOL 0xC9C9C9 #define MENUBGCOL 0x000000 /* Selected menu colors */

@@ -127,6 +127,13 @@ /* The summary and message to pass to the notifcation daeomon */

#define VIRTHEADER "virtual" #define VIRTMSG "[%s]" +/* If enabled, having the mouse cursor in a monitor will cause + * new windows to spawn in that monitor; otherwise, they will spawn + * in the same monitor as the active window and can be moved afterward + */ + +#define MONITORFOLLOWSMOUSE + // clang-format off /* List of window classes to spawn as sticky;

@@ -195,6 +202,7 @@ #define MOVE_KEY XK_v

#define RESIZE_KEY XK_r #define DESTROY_KEY XK_d #define STICK_KEY XK_s +#define WRANGLE_KEY XK_a #define SNAPLEFT_KEY XK_h #define SNAPRIGHT_KEY XK_l
M key.ckey.c

@@ -261,24 +261,6 @@ 0,

GrabModeSync, GrabModeAsync); #endif -#ifdef WRANGLE_KEY - XGrabKey( - dpy, - wcode, - SHORTCUTMOD, - screens[i].root, - 0, - GrabModeSync, - GrabModeAsync); - XGrabKey( - dpy, - wcode, - SHORTCUTMOD | Mod2Mask, - screens[i].root, - 0, - GrabModeSync, - GrabModeAsync); -#endif #ifdef SNAPLEFT_KEY XGrabKey( dpy,

@@ -680,7 +662,7 @@ #ifdef STICK_KEY

scode = XKeysymToKeycode(dpy, STICK_KEY); #endif #ifdef WRANGLE_KEY - wcode = XKeysymToKeycode(dpy, WRANGLE_KEY); + acode = XKeysymToKeycode(dpy, WRANGLE_KEY); #endif #ifdef RESIZE_KEY rcode = XKeysymToKeycode(dpy, RESIZE_KEY);

@@ -729,11 +711,7 @@ int tcode = XKeysymToKeycode(dpy, STICKYTOFRONT_KEY);

int bcode = XKeysymToKeycode(dpy, STICKYTOBACK_KEY); #endif -#ifdef MONITORFOLLOWSMOUSE m = current ? getmonitorbyclient(current) : getmonitorbymouse(); -#else - m = getmonitorbyclient(current); -#endif monitor = monitorinfo[m];

@@ -774,16 +752,16 @@ #ifdef STICK_KEY

else if (e->keycode == scode && (e->state & SHORTCUTMOD) == (MODBITS)) stick(current); #endif + + /* move to another monitor */ + #ifdef WRANGLE_KEY else if (e->keycode == acode && (e->state & SHORTCUTMOD) == (MODBITS)) { - wrangle(current, m < nmonitors - 1 ? monitorinfo[m++] : monitorinfo[0]); + wrangle(current, m < nmonitors - 1 ? monitorinfo[++m] : monitorinfo[0]); } #endif -#ifdef ZOOM_KEY - else if (e->keycode == zcode && (e->state & SHORTCUTMOD) == (MODBITS)) - zoom = !zoom; -#endif +/* toggle zoom mode */ #ifdef ZOOM_KEY else if (e->keycode == zcode && (e->state & SHORTCUTMOD) == (MODBITS)) { zoom = !zoom;
M manage.cmanage.c

@@ -31,9 +31,6 @@ XWMHints* hints;

XSetWindowAttributes attrs; XRRMonitorInfo monitor; - static XWindowAttributes ra; - XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra); - trace("manage", c, 0); XSelectInput( dpy,
M ryudo.1ryudo.1

@@ -1,7 +1,7 @@

.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "RYUDO" "1" "February 2022" "" "" +.TH "RYUDO" "1" "March 2022" "" "" . .SH "NAME" \fBryudo\fR \- The floatiling window manager that flows

@@ -89,7 +89,7 @@ .IP "\(bu" 4

\fBHide\fR: Minimize a window\. Click the window with mouse button 3\. It will be hidden and its label truncated and appended to the menu\. There is a compiled\-in limit of 128 hidden windows\. . .IP "\(bu" 4 -\fBLABEL\fR: Select any label after the \fBHide\fR option to restore it to the current virtual desktop\. +\fBLABEL\fR: Select any label after the \fBHide\fR option to restore the window it represents to the current virtual desktop\. . .IP "" 0 .

@@ -115,6 +115,12 @@ .IP "\(bu" 4

\fBLaunch\fR (Super + /): Open a new terminal in the center of the screen and make it active\. . .IP "\(bu" 4 +\fBSwitch\fR (Alt + Tab): Switch focus to the next window (on this monitor) +. +.IP "\(bu" 4 +\fBSwitch\-to\-monitor\fR (Alt + Shift + Tab): Switch focus to a window on the next monitor +. +.IP "\(bu" 4 \fBReshape\fR (Super + R): Initiate a reshape operation as if the \fBReshape\fR option was selected in the menu and the currently active window selected for the operation\. . .IP "\(bu" 4

@@ -134,6 +140,9 @@ \fBDelete\fR (Super + D): Close the currently active window\.

. .IP "\(bu" 4 \fBStick\fR (Super + S): Toggle stickiness of the currently active window\. +. +.IP "\(bu" 4 +\fBWrangle\fR (Super + A): Wrangle the currently active window to the next monitor (keeps it active)\. . .IP "\(bu" 4 \fBZoom\fR (Super + Z): Toggle zoom mode\. In zoom mode, the currently active window is maximized, new windows are opened maximized, and using Alt\-Tab to switch to another window maximizes it\.
M ryudo.1.htmlryudo.1.html

@@ -134,7 +134,7 @@ <li><code>Maximize</code>: Not enabled by default. Click mouse button 3 on the window to maximize, and it will fill the entire screen and be made active.</li>

<li><code>Stick</code>: Not enabled by default. Click mouse button 3 on a window to toggle its stickiness. If sticky, it will be present on all virtual desktops. If made unsticky, the window will be restricted to the current virtual desktop.</li> <li><code>Delete</code>: Closes a window. Click the window to close with mouse button 3. <code>SIGHUP</code> (hangup signal) is sent to all processes in the window's process group.</li> <li><code>Hide</code>: Minimize a window. Click the window with mouse button 3. It will be hidden and its label truncated and appended to the menu. There is a compiled-in limit of 128 hidden windows.</li> -<li><code>LABEL</code>: Select any label after the <code>Hide</code> option to restore it to the current virtual desktop.</li> +<li><code>LABEL</code>: Select any label after the <code>Hide</code> option to restore the window it represents to the current virtual desktop.</li> </ul>

@@ -152,6 +152,8 @@ <p>The following operations are bindable to key combinations (shown are the default bindings):</p>

<ul> <li><code>Launch</code> (Super + /): Open a new terminal in the center of the screen and make it active.</li> +<li><code>Switch</code> (Alt + Tab): Switch focus to the next window (on this monitor)</li> +<li><code>Switch-to-monitor</code> (Alt + Shift + Tab): Switch focus to a window on the next monitor</li> <li><code>Reshape</code> (Super + R): Initiate a reshape operation as if the <code>Reshape</code> option was selected in the menu and the currently active window selected for the operation.</li> <li><code>Move</code> (Super + V): Initiate a move operation as if the <code>Move</code> option was selected from the menu and the currently active window selected for the operation.</li> <li><code>Maximize</code> (Super + M): Maximize the currently active window.</li>

@@ -159,6 +161,7 @@ <li><code>Hide</code> (Super + I): Minimize the currently active window.</li>

<li><code>Unhide</code> (Super + U): Restore the most recently minimized window.</li> <li><code>Delete</code> (Super + D): Close the currently active window.</li> <li><code>Stick</code> (Super + S): Toggle stickiness of the currently active window.</li> +<li><code>Wrangle</code> (Super + A): Wrangle the currently active window to the next monitor (keeps it active).</li> <li><code>Zoom</code> (Super + Z): Toggle zoom mode. In zoom mode, the currently active window is maximized, new windows are opened maximized, and using Alt-Tab to switch to another window maximizes it.</li> <li><code>Tile Left</code> (Super + H): Tile the currently active window to fill the left half of the screen.</li> <li><code>Tile Right</code> (Super + L): Tile the currently active window to fill the right half of the screen.</li>

@@ -188,8 +191,8 @@

<h2 id="AUTHORS">AUTHORS</h2> <ul> -<li>Derek Stevens <a href="&#109;&#x61;&#105;&#108;&#x74;&#111;&#58;&#110;&#x69;&#x6c;&#x69;&#120;&#64;&#x6e;&#x69;&#x6c;&#102;&#x6d;&#46;&#99;&#99;" data-bare-link="true">&#x6e;&#105;&#x6c;&#105;&#120;&#64;&#110;&#105;&#108;&#x66;&#109;&#x2e;&#x63;&#99;</a></li> -<li>Russ Cox <a href="&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#58;&#114;&#115;&#x63;&#x40;&#x73;&#x77;&#116;&#x63;&#104;&#46;&#99;&#111;&#109;" data-bare-link="true">&#x72;&#115;&#99;&#x40;&#115;&#119;&#116;&#x63;&#x68;&#x2e;&#x63;&#111;&#109;</a></li> +<li>Derek Stevens <a href="&#109;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#x6e;&#105;&#108;&#x69;&#x78;&#64;&#x6e;&#x69;&#108;&#102;&#109;&#46;&#99;&#99;" data-bare-link="true">&#110;&#105;&#108;&#x69;&#x78;&#x40;&#x6e;&#105;&#x6c;&#102;&#x6d;&#x2e;&#x63;&#99;</a></li> +<li>Russ Cox <a href="&#x6d;&#97;&#105;&#108;&#116;&#111;&#x3a;&#x72;&#x73;&#99;&#64;&#x73;&#119;&#116;&#x63;&#104;&#x2e;&#x63;&#x6f;&#x6d;" data-bare-link="true">&#114;&#115;&#99;&#64;&#x73;&#119;&#116;&#99;&#x68;&#x2e;&#99;&#111;&#x6d;</a></li> <li>David Hogan, RIP</li> </ul>

@@ -201,7 +204,7 @@

<ol class='man-decor man-foot man foot'> <li class='tl'></li> - <li class='tc'>February 2022</li> + <li class='tc'>March 2022</li> <li class='tr'>ryudo(1)</li> </ol>
M ryudo.1.mdryudo.1.md

@@ -69,6 +69,8 @@

The following operations are bindable to key combinations (shown are the default bindings): - `Launch` (Super + /): Open a new terminal in the center of the screen and make it active. +- `Switch` (Alt + Tab): Switch focus to the next window (on this monitor) +- `Switch-to-monitor` (Alt + Shift + Tab): Switch focus to a window on the next monitor - `Reshape` (Super + R): Initiate a reshape operation as if the `Reshape` option was selected in the menu and the currently active window selected for the operation. - `Move` (Super + V): Initiate a move operation as if the `Move` option was selected from the menu and the currently active window selected for the operation. - `Maximize` (Super + M): Maximize the currently active window.

@@ -76,7 +78,7 @@ - `Hide` (Super + I): Minimize the currently active window.

- `Unhide` (Super + U): Restore the most recently minimized window. - `Delete` (Super + D): Close the currently active window. - `Stick` (Super + S): Toggle stickiness of the currently active window. -- `Wrangle` (Super + A): Wrangle the currently active window to another monitor (this follows the order of the monitors given by `Xrandr`'s `XRRGetMonitors` function and may not correspond to the actual visible order of the monitors -- wrangling doesn't change the active window, so you can repeat the operation until the window is on the desired monitor. +- `Wrangle` (Super + A): Wrangle the currently active window to the next monitor (keeps it active). - `Zoom` (Super + Z): Toggle zoom mode. In zoom mode, the currently active window is maximized, new windows are opened maximized, and using Alt-Tab to switch to another window maximizes it. - `Tile Left` (Super + H): Tile the currently active window to fill the left half of the screen. - `Tile Right` (Super + L): Tile the currently active window to fill the right half of the screen.