💾 Archived View for amami.city › ~xdefrag › twm.gmi captured on 2020-11-07 at 00:33:22. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Wanna some old soft, mmm??//
TWM always scared me. In old days if anything goes wrong and your Fluxbox desktop is a no-show, instead you will end up with TWM and three xterms (why though?). From there you would viing your config, execing wm and all's good, but what if you don't want to leave TWM?
Let's find out!
So I just installed it, logined, started xterm, "man twm", and another xterm, "vim ~/.twmrc"... Okay. Deep inhale.
(why I even exists in this world?)
(can we go back to dwm, please...)
But fear not! TWM's config actually pretty simple. TWM itself not some awesome window manager, but it do job and do it right. What else you want?
First of, my personal wishes about workspace... (dwm was perfect, isn't it?) I need windows, no titles, keyboard driven control, switching around it, minimize or maximize it. And some bar with mail count, time, and laptop state. Always like those.
And you can easily do it with not hacks on TWM (almost):
Let's pile it all up!
NoDefaults # Because defaults is for fools! NoTitle RandomPlacement UsePPosition "on" # If some app thinks it smarter with # placements then me, so... So be it. ShowIconManager # IconManager is something like active # applications bar. It useful for iconified # apps. I don't get how we can "uniconify" # them by kbd. IconifyByUnmapping # Manual is somewhat confusing about # what this do. This is hide icons on desktop # if you iconify app. We have IconManager! IconManagerDontShow { "conky "} # We don't want to count conky as # window. TitleFont "fixed" # I still can't figured out how to set font ResizeFont "fixed" # with different charset than iso8859. MenuFont "fixed" # Really want to use Terminus, but TWM just IconFont "fixed" # throws squares at me for some reason. IconManagerFont "fixed" # If anyone know what I'm doing wrong, # please email me at <me@xdefrag.dev>. # # Oh, yes. And no unicode for some reason. Color { ... } # There is nothing special, sticking to man. "q" = mod1 : iconmgr|window|frame|title : f.delete "x" = mod1 : iconmgr|window|frame|title : f.iconify "z" = mod1 : iconmgr|window|frame|title : f.fullzoom "j" = mod1 : all : f.circledown "k" = mod1 : all : f.circleup "r" = mod1 : all : f.twmrc "p" = mod1 : all : !"dmenu_run -b -f -fn terminus -nb black -nf green -sb green -sf black &" # Oh, yeah! Key bindings! I spent some time to figure how them works. # Wish there was some geek who already figured it out for me and # throw some examples on Internet. # First goes key and after "=" modifiers. # Second places where key binding would work. # And last function to call. You also can compose them (see below) MENU "dull" {} # And there you can compose menu. # It's simple but not useful. # We're hAcKeRs loves kEyBoArDs! # (only mechanical though)
For function composition you need first define function like:
Function "myfunc" { f.deiconify f.raise } # And call it like: MENU "ops" { "MYFUNC" f.function "myfunc" } # or "o" = mod1 : all : f.function "myfunc"
It's really powerful, especially for thirty years old window manager. But base functions suit my needs anyway.
And that's it.
Is it worth it? It depends. TWM is lightweight and written in C, it includes with default x11 installation. So I guess if you interested in this kind stuff = it's great piece of history to learn. And when you stuck again with this three xterms you will know how to make useful workspace for yourself.
UPDATE: So I find out better way to circle through windows. Let's use WARPRING!
RaiseOnWarp # Up window on stack. WarpCursor # Throw cursor on window to focus. WarpUnmapped # If it iconify: uniconify it. WindowRing { "emacs" "urxvt" } # Most used application. "u" = mod1 : all : f.warpto "urxvt" "e" = mod1 : all : f.warpto "emacs" "p" = mod1 shift : all : f.warpring "prev" "n" = mod1 shift : all : f.warpring "next"
So you can "warp" to specific application, which you can identify with f.identify function. And warpring is just predefined array of applications. And with WarpCursor it's actually warps cursor to windows, so focus will be changed.
-- BY-NC-SA: Stanislav Karkavin