<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>The Mandelbear&apos;s Musings</title>
  <link>https://mdlbear.dreamwidth.org/</link>
  <description>The Mandelbear&apos;s Musings - Dreamwidth Studios</description>
  <lastBuildDate>Wed, 29 Jun 2016 04:10:25 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>mdlbear</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/15740388/505737</url>
    <title>The Mandelbear&apos;s Musings</title>
    <link>https://mdlbear.dreamwidth.org/</link>
    <width>96</width>
    <height>96</height>
  </image>

<item>
  <guid isPermaLink='true'>https://mdlbear.dreamwidth.org/1573683.html</guid>
  <pubDate>Wed, 29 Jun 2016 04:10:25 GMT</pubDate>
  <title>[I wrote a thing]  Xmonad (part 2 of several)</title>
  <link>https://mdlbear.dreamwidth.org/1573683.html</link>
  <description>&lt;p&gt; You may want to start with &lt;a href=&quot;http://mdlbear.dreamwidth.org/1573035.html&quot;&gt;Part 1&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt; Xmonad is a &lt;em&gt;tiling&lt;/em&gt; window manager.  That means that, with very
    few exceptions, it lays out all of the windows in your workspace so that
    they completely fill the screen.  You can have multiple layouts, and flip
    between them with a single keystroke.  You can bring a workspace (there
    are 9 by default, but you can add more) to your screen with a single
    keystroke, or send a window to a workspace.
&lt;/p&gt;
&lt;p&gt; And the whole thing is configured using a text file that is actually a
    program, written in the functional language Haskell.  I&apos;ll get to that
    later. 
&lt;/p&gt;
&lt;p&gt; One of my main gripes about Gnome, etc., and one of the things I miss the
    most about CTWM, is that when you first start a program its window shows
    up at some random location on the screen, with whatever size the program
    thinks is appropriate.  If you don&apos;t like those choices you have to move
    and resize the window yourself, and then do it all over the next time you
    log in.  (There are some exceptions -- many newer programs remember where
    you put them last, and older programs, from the CTWM era, can be given a
    starting geometry.)
&lt;/p&gt;
&lt;p&gt; Xmonad&apos;s layouts are all deterministic, which is to say, predictable.
    When you start a program, you know &lt;em&gt;exactly&lt;/em&gt; where it&apos;s going to be
    on the screen.  When you change the layout, you know where everything is
    going to go.  If you want to move a window into the main position (most
    layouts have one; e.g. the left-hand column) it&apos;s (as usual) just one
    keystroke to put it there.
&lt;/p&gt;
&lt;p&gt; But the best thing, and the reason I switched to xmonad in the first
    place, is the way it treats multiple monitors: it simply assigns one
    workspace to each monitor.
&lt;/p&gt;
&lt;p&gt; Undock your laptop, and its screen stays exactly the same.  The workspaces
    that were shown on the other screens simply go back into hiding with all
    the others, and are still only a keystroke away.  When you have multiple
    screens, you can move a window to another screen, or bring a workspace to
    a screen, or &lt;em&gt;warp the pointer to another screen&lt;/em&gt;, all with single
    keystrokes. 
&lt;/p&gt;
&lt;p&gt; When you go to a conference room and plug in a projector, a workspace
    immediately shows up there and its layout automatically adjusts to the
    projector&apos;s resolution and aspect ratio.  When you get a new computer --
    all the developers at work got new laptops just a month or two ago -- just
    copy your configuration files to it and everything will be exactly the
    same as it was on the old one.  (Sometime later I&apos;ll write about my
    portable configuration, which makes it possible for me to set up my entire
    working environment in mere minutes.)
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt; So let&apos;s go a little deeper into those magic keystrokes.  First of all,
    you have to know that all of the commands (you can&apos;t really call them
    shortcuts) include a key that xmonad calls &quot;Mod&quot; (short for &quot;modifier&quot;, of
    course).  Mod is initially defined as Alt, but the first thing any Emacs
    user is going to do is redefine it as something else, usually the &quot;logo&quot;
    key.  (That&apos;s the one on the left between Ctrl and Alt that usually has a
    Windows logo on it.  If your keyboard has replaceable keys you may be able
    to get a penguin for it.)  On old laptops that don&apos;t have a logo key I use
    Ctrl-Alt, but that&apos;s a matter of taste.
&lt;/p&gt;
&lt;p&gt; You also probably want to know that Mod-? gets you a list of all the
    commands.  And that there&apos;s a fantastic collection of tutorials,
    documentation, and sample configuration files at &lt;a href=&quot;http://xmonad.org/&quot;&gt;xmonad.org&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt; When xmonad starts up, you see a totally empty, black screen.  Most
    people, myself included, add a status/navigation bar at the top, but you
    don&apos;t have to.  I&apos;ll get to that later.  You can start a program by typing
    Mod-P, or open a terminal window with Mod-Shift-Enter.  You will
    immediately notice that the first window you open fills the screen.  If
    you open another, xmonad will tile the screen with them, showing them side
    by side.
&lt;/p&gt;
&lt;p&gt; If you start a third program, it will get added to the right-hand column.
    You can probably see where this is going.  When you move the mouse pointer
    into a window, it gets a thin red border to show you that it has &quot;focus&quot;.
&lt;/p&gt;
&lt;p&gt; If you decide that you started things in the wrong order, move the pointer
    into the window you want to put in the left-hand column (the &quot;master&quot;
    column) and hit Mod-Enter.  You close a window you&apos;re done with using
    Mod-Shift-C. 
&lt;/p&gt;
&lt;p&gt; Here&apos;s where it gets interesting: Mod-Space will switch you to a new
    &lt;em&gt;layout&lt;/em&gt;, with the master column turning into a master
    &lt;em&gt;row&lt;/em&gt;, and all the other windows across the bottom.  Hit Mod-Space
    again, and the currently-focused window goes full-screen.  (I reconfigure
    my full-screen layout to put a row of tabs across the top.  Wondering how
    to see the hidden windows?  Mod-Tab moves focus to the next window in the
    stack.  It also works in other layouts, so you don&apos;t need the mouse to
    move focus around.  If you spend most of your time in a terminal and an
    editor like vim or emacs, you can throw your mouse away and still be
    productive.  Mod-Shift-Tab moves focus to the previous window.
&lt;/p&gt;
&lt;p&gt; Mod-2 puts you into a second &lt;em&gt;workspace.&lt;/em&gt;  There are nine of them.  (I
    add two more -- 0 and -.)  If you want to move a window, say from
    workspace 2 to workspace 1, use Mod-Shift-1.  That&apos;s kind of a recurring
    theme in xmonad -- Mod-something does one thing, and Mod-Shift-something
    does something related.
&lt;/p&gt;
&lt;p&gt; You can see that in action if you add an(other) monitor.  Now, workspace 1
    is in the left-hand screen, and 2 is in the right-hand screen.  Think of
    the two of them as West and East.
&lt;/p&gt;
&lt;p&gt; Now, Mod-w will move the focus (and the mouse pointer) into the West
    screen, and Mod-e will move the focus into the East screen.  Mod-1 through
    Mod-9 will bring that workspace into whatever screen has the focus.  If
    the other workspace was already visible, they trade places.  (Some people
    don&apos;t like that, so you can change it so that it just moves focus into the
    other screen if you select a workspace that&apos;s already visible.)
&lt;/p&gt;
&lt;p&gt; Add a third screen to the right of East, and call it Right.  Now, Mod-r
    and Mod-Shift-R do exactly what you would expect.  (There are no bindings
    for T, so I suppose that if you have space for a fourth screen you could
    use it for that.)
&lt;/p&gt;
&lt;p&gt; There are more key bindings, to move focus (Mod-j and Mod-k focus the next
    and previous window, respectively; shifted, they swap the focused window
    with the next or previous window), to shrink and enlarge the master area
    (Mod-h and Mod-l respectively), or increase or decrease the number of
    windows in the master area (Mod-Comma and Mod-Period respectively).
&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1573683&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://mdlbear.dreamwidth.org/1573683.html</comments>
  <category>writing</category>
  <category>linux</category>
  <category>500-words</category>
  <category>curmudgeon</category>
  <category>software</category>
  <category>xmonad</category>
  <lj:mood>productive</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://mdlbear.dreamwidth.org/1573035.html</guid>
  <pubDate>Wed, 22 Jun 2016 04:04:08 GMT</pubDate>
  <title>[I wrote a thing] xmonad (part 1 of several, incomplete)</title>
  <link>https://mdlbear.dreamwidth.org/1573035.html</link>
  <description>&lt;p&gt; As I mentioned about a week ago, I&apos;ve been trying to write more.  And
    since my current obsession is a program called &lt;a href=&quot;http://xmonad.org/documentation.html&quot;&gt;xmonad&lt;/a&gt;, well, ...
&lt;/p&gt;
&lt;p&gt; This is incomplete: it&apos;s about the first day&apos;s worth (I&apos;ve been trying to
    write about 500 words per day).  Comments and suggestions are, of course,
    welcome. 
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt; My new 27&quot; monitors arrived at work; I took advantage of the change to
    rearrange my work space.  Before, it was the set-up I&apos;ve had for most of
    the last three years -- monitor in front on a stand, second monitor on the
    right, and my laptop on the left.  The new laptop, however, has a decent
    keyboard (with trackpoint and three buttons), and the monitors between
    them occupy about 2/3 of the desk.
&lt;/p&gt;
&lt;p&gt; The new arrangement has the laptop dock under the &quot;middle&quot; monitor; the
    laptop, being a business-class Dell, has both a pointing stick and a
    middle &quot;mouse&quot; button.  The laptop&apos;s keyboard is decent enough that it can
    replace the thinkpad keyboard I&apos;ve been using for the last couple of years
    -- it&apos;s a high-end Dell, and has both a pointing stick and a middle
    button.  (The middle button has part of the Unix desktop environment since
    the mid 1980s; it means &quot;paste&quot;, and I use it all the time.) The monitors
    are about 50% bigger, pixel-wise, than the laptop, and are arranged
    &quot;traditionally&quot; with the laptop on the left.
&lt;/p&gt;
&lt;p&gt; You can probably see the problem with this arrangement.  The total
    workspace is about 7000 pixels wide, and it&apos;s not even arranged in a
    straight line -- to get from the laptop to the &quot;middle&quot; monitor you have
    to move the cursor to the right, but the natural direction would be
    straight up.  What&apos;s more, when you undock the laptop the whole thing
    collapses down to a &quot;mere&quot; 1920x1080.  It&apos;s no wonder that most of the
    programmers in my team have opted for a single 30&quot; monitor, and keep their
    laptop (almost invariably a mac) closed while they&apos;re using it.
&lt;/p&gt;
&lt;p&gt; Fortunately, I anticipated this problem months ago, and started using a
    window manager called xmonad.
&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; One of the things I love most about Linux is the fact that the program
    that manages the layout of the screen and the behavior and appearance of
    the windows on it is &lt;em&gt;not&lt;/em&gt; part of the operating system.  It&apos;s a
    separate program, sensibly called a &quot;window manager&quot;, and it runs in user
    space as a perfectly ordinary application that just happens to have a
    couple of extra hooks into X, which is the (also ordinary) program that
    actually controls the display, the keyboard, and the mouse.
&lt;/p&gt;
&lt;p&gt; Being an ordinary program -- and not even a terribly complicated one --
    anybody can write one, and many people have.  For a long time I was using
    one called TWM (Tabbed Window Manager, but the T originally stood for
    Tom&apos;s).  Later I started using CTWM (Claude&apos;s Tabbed Window Manager),
    because it introduced the then unfamiliar notion of multiple workspaces.
    (Before CTWM, these could only be found in an experimental system at Xerox
    where they were called &quot;rooms&quot;.  Apple introduced them decades later, as
    part of MacOS X.)
&lt;/p&gt;
&lt;p&gt; You&apos;ve probably heard of Gnome, KDE, and Ubuntu&apos;s horrible Unity desktop
    environments.  Down at the bottom, they&apos;re just window managers plus a
    couple of utilities for doing things like putting up the familiar bar
    (Gnome calls it a &quot;panel&quot;) full of menus, launcher buttons, clocks and
    other widgets.  You can, in fact, run &lt;code&gt;gnome-panel&lt;/code&gt; under any
    window manager, and I did for a while.  They also include a &quot;session
    manager&quot;, which handles things like starting the panel and making sure
    that applications get notified when you log out, so that they can save
    their state and exit cleanly.  I&apos;ve been using Gnome for years, and loved
    it for its configurability.
&lt;/p&gt;
&lt;p&gt; But Gnome&apos;s configurability comes with a cost -- every time you move to a
    new computer, you have to spend an hour clicking around in control panels
    and property windows to get everything set up the way you like it.  And
    every time there&apos;s a major upgrade, something is a little different.  It&apos;s
    a cost I no longer have to pay.
&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt; &lt;a href=&quot;http://mdlbear.dreamwidth.org/1573683.html&quot;&gt;Part 2&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1573035&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://mdlbear.dreamwidth.org/1573035.html</comments>
  <category>500-words</category>
  <category>writing</category>
  <category>linux</category>
  <category>xmonad</category>
  <category>software</category>
  <category>curmudgeon</category>
  <lj:mood>productive</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
</channel>
</rss>
