Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Akihabara, used/refurbished Mac laptops?



On 2017-11-09 17:37 -0700 (Thu), Lars Kotthoff wrote:

> > ...when you've got more than a dozen 100+ line terminals...
> 
> Sorry to hijack the thread, but how do you switch between them? I start
> to have trouble with more than about 5 terminals with similar names.

Moving between windows on the same desktop I'll typically just switch
by moving my mouse pointer. I use a ThinkPad Trackpoint keyboard so
this requires no movement away from the home row. While very fine
control of the mouse pointer is a bit more fiddly with a pointing
stick than with touchpad, for coarse movements (which are all you need
when your target is a non-tiny window) I find considerably more
accurate, across long or short distances. I also use point to focus so
there's no clicking involved.

This only works for the windows that have a reasonable amount of
themselves exposed, of course. (That can range from only three on a
small display to eight or more on a 4k display.) Others, be they
underneath or iconized, I need to find by title, and there are two
parts to this.

First, I have my xtitle[1] script, which is invoked with no arguments
by my `cd()` function and with the `xt()` function as described in the
script. This means that every terminal has the hostname and current
working directory in the title, and when starting into a programming
session I'll generally title the more important windows with `xt
edit`, `xt build`, etc. or just use a script that starts up several
windows with appropriate names on whichever host I happen to need to
work on.

[1]: https://github.com/dot-home/cjs0/blob/master/bin/xtitle

Second, I have a pretty standard fvwm2 window switcher menu bound to
the Muhenkan key just to the left of the space bar. That's almost
instant to tap with my left thumb and gives me a list of all the
windows on this desktop. For example, my current one looks something
like this:

    0.   iambic  /etc
    1. lower  iambic ~/
    2. edit  iambic  ~/.home/cjs0
    3. Recycling (Background Events)
    4. cjs0 xtitle at master ยท dot-home/cjs0 - Google Chrome
    5. build  iambic  ~/.home/cjs0
    6.   t2.dyadic  dot-home/_dot-home
    7. (iconized  iambic  ~/)
    8. mutt  iambic  ~/

(`iambic.cynic.net` is the name of this host.  The "Recycling" window
is a reminder window from Checker Plus for Google Calendar. The Chrome
window is obvious, and all the rest are xterms, a couple nameless. The
one iconized window is in parens.)

I can move up and down in the list with j/k or just tap a number and,
unlike moving focus by moving the pointer, selecting a window here
also uniconizes it if necessary and raises it to the top.

Shift-Muhenkan will bring up a similar menu that shows windows from all
desktops, rather than just the current one. This can be useful if I've
forgotten on which desktop I put all my t1.dyadic.cynic.net sessions or
something like that, but that's pretty rare.

I suspect that's rare not because I have a good memory (in fact, mine is
notoriously poor), but because of the way I switch desktops. I have my
function keys F1-F12 bound to switch to desktops 1-12 and so when I want
to switch to a particular desktop I simply tap the function key.

(I also have a "goto desktop" menu bound to Ctrl-Muhenkan so that
Ctrl-Muhenkan followed by '3' will go to desktop 3, but I've found
this to be inconvenient enough compared to tapping a function key that
I prefer to live with the occasional inconvenience arising from not
having unmodified function keys available. I would like a good
solution to this but, sad to say, xmodmap doesn't seem to have the
ability to translate, e.g., Alt-Shift-F3 to an unmodified F3.)

Over the past year or two I've had from time to time had to make use
of relative desktop switching on Macs (Ctrl-arrowkey) and Windows
(Super-arrowkey) and this really does not work nearly as well. For
whatever reason I find it far easier to have my brain's and my
muscles' memory work with "go directly to desktop 3" (mail and chat),
"desktop 4" (primary web browser window and 1-3 terminals), "desktop
5" (first development desktop) and so on than to try to do relative
moves that are usually 3-4 keystrokes or more. Perhaps the real
problem with relative moves is that you have to think about where you
currently are or, worse yet, look at what's on the screen after you
type a keystroke or two. The latter is the kiss of death for fast
action since the large fraction of a second it takes to look at and
process information is going to be the vast majority of the time you
spend doing something when you've got efficient keystroke combinations
that even in combination take a tenth as long as that one look and
comprehension.

So my most common focus changes are trackpoint to move between windows
on a desktop devoted to a particular task and a single keystroke
(albeit requiring a move away from home row) to switch to a desktop
with a different task. Optimizing heavily for such changes has worked
very well for me: I think no more about what window I'm moving focus
to than I think about, e.g., moving three paragraphs up or down in vim.

Other frequent operations are bound to similarly short combinations.
Henkan, just to the right of the space bar, brings up my window ops
menu so it's two keystrokes to move a window to the top or bottom of
the stack, vertically maximize a window, iconify a window, etc. To
move a window I press Muhenkan followed by 'a' and then just move my
trackpoint (relying heavily on a moderate snap to the edge of other
windows or the screen) and to resize it's Henkan followed by 's' and a
move across the border I want to move to resize. The Hiragana key,
just to the right of Henkan (and also pressed with the right thumb)
gives me actions such as 's' to open a new shell window on the current
host and slightly longer sequences to open windows on other hosts or
start other programs.

As a side note, the `xtitle` system I mentioned above also helps me
keep my command prompts quite short. I do still keep the hostname in
my command prompt (perhaps more because of habit rather than because
it's actually useful), but having the current directory in a prompt,
especially when it's going to say something like
`~/co/github.com/0cjs/foo` rather than just `0cjs/foo`, I find an
unbearable waste of screen real estate. I fixed the problem of the
title bar being far from the prompt on large windows by moving the
title bar to the bottom of my windows, rather than the top.

On 2017-11-10 02:51 +0100 (Fri), Christian Horn wrote:

> Some years ago I wondered about a tlug technical session where people
> would present their working environments, would be interesting.

I'd be up for that, though I'm thinking it would be even better for me
just to do a video.

cjs
-- 
Curt J. Sampson      <cjs@example.com>      +81 90 7737 2974

To iterate is human, to recurse divine.
    - L Peter Deutsch


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links