diff --git a/README.md b/README.md index d8321ee..234770c 100755 --- a/README.md +++ b/README.md @@ -2,22 +2,24 @@ ## the minimalist floatiling window manager that flows -- Derek Stevens 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 @@ The primary additions I've made are: + 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 @@ Of the bugs and caveats not already mentioned in `rio`'s README: ### 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 diff --git a/config.def.h b/config.def.h index e57efa9..4f81899 100644 --- a/config.def.h +++ b/config.def.h @@ -31,7 +31,7 @@ #define MBORDERCOL 0x000000 /* Normal menu colors */ -#define MENUFGCOL 0x797979 +#define MENUFGCOL 0xC9C9C9 #define MENUBGCOL 0x000000 /* Selected menu colors */ @@ -127,6 +127,13 @@ #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 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 diff --git a/key.c b/key.c index 72163b4..c74cfd9 100644 --- a/key.c +++ b/key.c @@ -261,24 +261,6 @@ void keysetup(void) { 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 @@ void keypress(XKeyEvent* e) { 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 @@ void keypress(XKeyEvent* e) { 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 @@ void keypress(XKeyEvent* e) { 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; diff --git a/manage.c b/manage.c index e1f81e3..34cf0c9 100644 --- a/manage.c +++ b/manage.c @@ -31,9 +31,6 @@ int manage(Client* c, int mapped) { XSetWindowAttributes attrs; XRRMonitorInfo monitor; - static XWindowAttributes ra; - XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra); - trace("manage", c, 0); XSelectInput( dpy, diff --git a/ryudo.1 b/ryudo.1 index 8af97a8..6747685 100644 --- a/ryudo.1 +++ b/ryudo.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 @@ Right\-clicking on the desktop or an inactive window opens a menu with the follo \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 @@ The following operations are bindable to key combinations (shown are the default \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 @@ -136,6 +142,9 @@ The following operations are bindable to key combinations (shown are the default \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\. . .IP "\(bu" 4 diff --git a/ryudo.1.html b/ryudo.1.html index 99bd3cc..4dc63d7 100644 --- a/ryudo.1.html +++ b/ryudo.1.html @@ -134,7 +134,7 @@
  • Stick: 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.
  • Delete: Closes a window. Click the window to close with mouse button 3. SIGHUP (hangup signal) is sent to all processes in the window's process group.
  • Hide: 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.
  • -
  • LABEL: Select any label after the Hide option to restore it to the current virtual desktop.
  • +
  • LABEL: Select any label after the Hide option to restore the window it represents to the current virtual desktop.
  • @@ -152,6 +152,8 @@