<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>
            
                    stumpwm on
                
            
            The Neo-Babbage Files</title>
        <link>https://babbagefiles.xyz/categories/stumpwm/</link>
        <description>Recent content  in stumpwm
            on The Neo-Babbage Files</description>
        <language>en-gb</language>
        
                <managingEditor>slade@lambda-y.net (Benjamin Slade)</managingEditor>
                <webMaster>slade@lambda-y.net (Benjamin Slade)</webMaster><lastBuildDate>Mon, 29 Dec 2025 11:00:32 +0000</lastBuildDate>
        <generator>Hugo -- gohugo.io</generator>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
            <atom:link href="https://babbagefiles.xyz/categories/stumpwm/index.xml" rel="self" type="application/rss&#43;xml" />
        
            
            <item>
                <title>Group-agnostic previous-focussed-window memory in StumpWM</title>
                <link>https://babbagefiles.xyz/agnostic-focus-stumpwm/</link>
                
                
                <description>&lt;p&gt;I&amp;rsquo;ve started using StumpWM&amp;rsquo;s groups (like &amp;ldquo;workspaces&amp;rdquo; in other window
managers) more extensively, but this broke a behaviour I like: the
ability to easily switch back to the last focussed window, because
StumpWM&amp;rsquo;s &amp;ldquo;last focussed&amp;rdquo; is group-specific. So I wasn&amp;rsquo;t easily about
to switch quickly back and forth between two windows that were inb
different groups, which turns out to be something I frequently want to
do (e.g. switch back and forth between an emacsclient frame in my
&amp;ldquo;emacs&amp;rdquo; group and a Firefox instance in my &amp;ldquo;web&amp;rdquo; group).&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s my fix [updated with some fixes on &lt;span class=&#34;timestamp-wrapper&#34;&gt;&lt;span class=&#34;timestamp&#34;&gt;[2025-01-27 Mon]&lt;/span&gt;&lt;/span&gt;]:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;c1&#34;&gt;;; Global &amp;#39;last focussed window&amp;#39;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-ante-earlier-focussed-window*&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;panrecord-of-last-focussed-window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;currwin&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;lastwin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Record last visited windows and their group.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;unless&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;or&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;search&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;*EQUAKE*[&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;window-name&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;currwin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;;; don&amp;#39;t record Equake&lt;/span&gt;
              &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;cons&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;when&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-window-globally&lt;/span&gt;
           &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-ante-earlier-focussed-window*&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;when&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-window-globally&lt;/span&gt;
           &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;when&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-window-globally&lt;/span&gt;
           &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;cons&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;currwin&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;find-window-globally&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;window&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Check for presence of window in all groups.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
      &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;member&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;group-windows&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
          &lt;span class=&#34;nv&#34;&gt;window&lt;/span&gt;
          &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-window-globally&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;switch-to-last-focussed-window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Switch to last focussed window, irrespective of which group it is in and what group we&amp;#39;re currently in.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;
     &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;and&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;or&lt;/span&gt;
       &lt;span class=&#34;c1&#34;&gt;;; we&amp;#39;re in the same group [same logic below]&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
              &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
       &lt;span class=&#34;c1&#34;&gt;;; or we can switch to the previous group&lt;/span&gt;
       &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
     &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;switch-to-group&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;focus-window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-prev-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
     &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;and&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;or&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
               &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
        &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;switch-to-group&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;focus-window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;and&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-cur-focussed-window*&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-ante-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;or&lt;/span&gt;
         &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
                &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-ante-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
         &lt;span class=&#34;vg&#34;&gt;*global-ante-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt;
         &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;switch-to-group&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-ante-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
         &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;focus-window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*global-ante-earlier-focussed-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;message&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;No window to switch to.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;add-hook&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*focus-window-hook*&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;panrecord-of-last-focussed-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;;; my binding; set as you will&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;s-f&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;switch-to-last-focussed-window&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;unless&lt;/code&gt; statement in &lt;code&gt;panrecord-of-last-focussed-window&lt;/code&gt; prevents
my drop-down terminal &lt;a href=&#34;https://babbagefiles.xyz/categories/stumpwm&#34;&gt;Equake&lt;/a&gt; &amp;ldquo;window&amp;rdquo; from &amp;ldquo;counting&amp;rdquo; for history
tracking purposes.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;switch-to-last-focussed-window&lt;/code&gt; function essentially just switches
to the last focussed window, after making sure it still exists. (If
not, switch to the window which was focussed before that one, or the
one before that one, or else don&amp;rsquo;t switch and display message
indicating this to the user.)&lt;/p&gt;
&lt;p&gt;The last line, &lt;code&gt;(define-key *root-map* (kbd &amp;quot;s-f&amp;quot;) &amp;quot;switch-to-last-focussed-window&amp;quot;)&lt;/code&gt;, means that I can double tap &lt;code&gt;s-f&lt;/code&gt;
(since my StumpWM prefix key is set to &lt;code&gt;s-f&lt;/code&gt; with &lt;code&gt;(set-prefix-key (kbd &amp;quot;s-f&amp;quot;))&lt;/code&gt;) to switch to the last focussed window, no matter which group
it belongs to.&lt;/p&gt;
&lt;p&gt;I continue to really enjoy the power that StumpWM&amp;rsquo;s Common Lisp
underpinnings provides the user!&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/lisp">lisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/stumpwm">stumpwm</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/commonlisp">commonlisp</category>
                                
                            
                        
                     
                        
                     
                        
                    
                
                <guid>https://babbagefiles.xyz/agnostic-focus-stumpwm/</guid>
                <pubDate>Sat, 25 Apr 2020 14:25:00 -0500</pubDate>
            </item>
        
            
            <item>
                <title>Running pdfpc in StumpWM</title>
                <link>https://babbagefiles.xyz/pdfpc-in-stumpwm/</link>
                
                
                <description>&lt;p&gt;&lt;a href=&#34;https://pdfpc.github.io/&#34;&gt;&lt;code&gt;pdfpc&lt;/code&gt;&lt;/a&gt; is a fantastic application for presenting PDF slides,
including perhaps especially those produced using &lt;a href=&#34;https://ctan.org/pkg/beamer&#34;&gt;LaTeX Beamer&lt;/a&gt;. It
creates two (full-screen) windows, one a presenter viewer which shows
the time elapsed and a preview of the next slide, and one the
presentation view which is what is shown to the audience. It also has
a bunch of other cool features like being able to draw on slides;
highlight areas of slides, &amp;amp;c.&lt;/p&gt;
&lt;p&gt;Here is an example, with the presenter&amp;rsquo;s view shown on the left; the
audience&amp;rsquo;s view on the right:&lt;/p&gt;



&lt;figure&gt;
    
        &lt;img src=&#34;https://babbagefiles.xyz/ox-hugo/pdfpc-screenshot01.png&#34;/&gt; &lt;/figure&gt;

&lt;p&gt;In many environments &lt;code&gt;pdfpc&lt;/code&gt; is pretty smart about getting the
presentation view to the external display, but in StumpWM both end up
getting created in the same frame in the same display.&lt;/p&gt;
&lt;p&gt;(General tip: in StumpWM, after connecting/activating an external
display, you may need to run &lt;a href=&#34;https://stumpwm.github.io/git/stumpwm-git_9.html#External-Monitors&#34;&gt;&lt;code&gt;refresh-heads&lt;/code&gt;&lt;/a&gt; to get StumpWM to display
things properly.)&lt;/p&gt;
&lt;p&gt;For whatever reason, I can&amp;rsquo;t get any of the &lt;a href=&#34;https://stumpwm.github.io/git/stumpwm-git_9.html&#34;&gt;Screen-related things&lt;/a&gt; in
StumpWM to behave like I have more than one
screen. E.g. &lt;code&gt;*screen-list*&lt;/code&gt; shows a singleton list even when an
external display is connected and activated:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;nv&#34;&gt;STUMPWM&amp;gt;&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*screen-list*&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;S&amp;lt;screen&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;&amp;lt;XLIB:SCREEN&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:0.0&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;1366x768x24&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;TRUE-COLOR&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A passable solution is to use &lt;a href=&#34;https://stumpwm.github.io/git/stumpwm-git_5.html#Rule-Based-Window-Placement&#34;&gt;&lt;code&gt;define-frame-preference&lt;/code&gt;&lt;/a&gt;, adding the
following to your &lt;code&gt;init.lisp&lt;/code&gt; StumpWM configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;c1&#34;&gt;;; pdfpc rule - for &amp;#39;Default&amp;#39; group&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;;;  move to frame &amp;#39;1&amp;#39;;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;;;  non-focussing (&amp;#39;nil) the presentation view;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;;;  not only matching (t) the target-group (&amp;#39;Default&amp;#39;);&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;;;  moving the &amp;#39;pdfpc&amp;#39; &amp;#39;presentation&amp;#39; window&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-frame-preference&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Default&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:instance&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;pdfpc&amp;#34;&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:role&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;presentation&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This should properly move the presentation window to the external
display when &lt;code&gt;pdfpc&lt;/code&gt; is run.&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/lisp">lisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/stumpwm">stumpwm</category>
                                
                            
                        
                     
                        
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/tags/pdfpc">pdfpc</category>
                                 
                                    <category domain="https://babbagefiles.xyz/tags/pdf">pdf</category>
                                 
                                    <category domain="https://babbagefiles.xyz/tags/presentation">presentation</category>
                                 
                                    <category domain="https://babbagefiles.xyz/tags/beamer">beamer</category>
                                
                            
                        
                    
                
                <guid>https://babbagefiles.xyz/pdfpc-in-stumpwm/</guid>
                <pubDate>Mon, 29 Jul 2019 15:27:00 -0600</pubDate>
            </item>
        
            
            <item>
                <title>Guix, Nix: You are in a maze of twisty little $PATHs, some undefined</title>
                <link>https://babbagefiles.xyz/guix-nix-maze-of-twisty-little-paths-undefined/</link>
                
                
                <description>&lt;p&gt;Some notes on interactive fiction/text adventure games and PATHs in
Guix, and StumpWM.&lt;/p&gt;
&lt;h2 id=&#34;maze-no-dot-1&#34;&gt;Maze no. 1&lt;/h2&gt;
&lt;p&gt;There may (likely is) some way of programmatically setting the X
Windows PATH variable in Guix System (née GuixSD) via the base
configuration (e.g. &lt;code&gt;config.scm&lt;/code&gt;), but I haven&amp;rsquo;t been able to uncover
anything that works. This is relevant for being able to use locally
installed static binaries or local shell scripts via the window
manager.&lt;/p&gt;
&lt;p&gt;As a window-manager-specific workaround, in StumpWM, one can
programmatically set PATH variables via &lt;code&gt;(setf (getenv &amp;quot;VARIABLE_NAME&amp;quot;) &amp;quot;variable-value&amp;quot;)&lt;/code&gt;. Thus, if you store local static
binaries and shell scripts in &lt;code&gt;~/bin&lt;/code&gt;, the following (which you could
include in StumpWM&amp;rsquo;s &lt;code&gt;init.lisp&lt;/code&gt;) will add that to your PATH variable:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;getenv&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;PATH&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;concat&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;/home/YOURUSERNAME/bin:&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;getenv&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;PATH&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I use this with a static Haskell binary &lt;a href=&#34;https://github.com/erebe/greenclip&#34;&gt;greenclip&lt;/a&gt;, which adds clipboard
functionality to &lt;a href=&#34;https://github.com/davatorium/rofi/&#34;&gt;rofi&lt;/a&gt;, and with shell scripts that give &amp;ldquo;pretty names&amp;rdquo;
to Flatpak run commands.&lt;/p&gt;
&lt;p&gt;For example, the literate/natural-language-based programming
interactive fiction design language &lt;a href=&#34;http://inform7.com/&#34;&gt;Inform7&lt;/a&gt; (which is due to be
&lt;a href=&#34;http://inform7.com/talks/2019/06/14/narrascope.html&#34;&gt;open-sourced sometime this year&lt;/a&gt;) is now conveniently &lt;a href=&#34;https://flathub.org/apps/details/com.inform7.IDE&#34;&gt;available as a
Flatpak&lt;/a&gt;. But the run command after installing is &lt;code&gt;flatpak run com.inform7.IDE&lt;/code&gt;, which is non-ideal. So I made a simple shell script
named &lt;code&gt;inform7&lt;/code&gt; placed in &lt;code&gt;~/bin&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/sh
&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;flatpak run com.inform7.IDE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;figure&gt;
    
        &lt;img src=&#34;https://babbagefiles.xyz/ox-hugo/inform7-guix.png&#34;/&gt; &lt;/figure&gt;

&lt;h2 id=&#34;maze-no-dot-2&#34;&gt;Maze no. 2&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://nixos.org/&#34;&gt;Nix&lt;/a&gt; can be &lt;a href=&#34;https://nixos.org/releases/nix/nix-1.9/manual/#ch-installing-binary&#34;&gt;installed as a standalone package manage on top of other
distros&lt;/a&gt;, including Guix System, which is useful for be able to obtain
software currently lacking in Guix System (including, ironically,
&lt;a href=&#34;https://en.wikipedia.org/wiki/Hugo_(software)&#34;&gt;Hugo&lt;/a&gt;, used by this blog, which is present in Nix). Packages available
in Nix but not in Guix include &lt;a href=&#34;http://ccxvii.net/gargoyle/&#34;&gt;Gargoyle&lt;/a&gt;, a very nice interactive
fiction front-end client that supports a number of different backends,
including Frotz and Glulxe. One of the benefits of Gargoyle is that it
&amp;ldquo;cares about typography&amp;rdquo;. However, Nix applications by default seem to
have trouble finding/seeing fonts, including system fonts, local
fonts, and even fonts installed via Nix.&lt;/p&gt;
&lt;p&gt;This can be fixed by (1) setting the &lt;code&gt;FONTCONFIG_PATH&lt;/code&gt; and
&lt;code&gt;FONTCONFIG_FILE&lt;/code&gt;, e.g. in StumpWM this can be done with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;getenv&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;FONTCONFIG_PATH&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;/home/YOURUSERNAME/.config/fontconfig/&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;getenv&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;FONTCONFIG_FILE&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;fonts.conf&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And (2) forcing Nix to look in the right places by manual
specification in &lt;code&gt;~/.config/fontconfig/fonts.conf&lt;/code&gt;, adding right
before the final &lt;code&gt;&amp;lt;/fontconfig&amp;gt;&lt;/code&gt; (as appropriate):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-nil&#34; data-lang=&#34;nil&#34;&gt;&amp;lt;cachedir prefix=&amp;quot;xdg&amp;quot;&amp;gt;fontconfig&amp;lt;/cachedir&amp;gt;
&amp;lt;dir&amp;gt;/home/YOURUSERNAME/.local/share/fonts/&amp;lt;/dir&amp;gt;
&amp;lt;dir&amp;gt;/home/YOURUSERNAME/.nix-profile/share/fonts/&amp;lt;/dir&amp;gt;
&amp;lt;dir&amp;gt;/home/YOURUSERNAME/.guix-profile/share/fonts/&amp;lt;/dir&amp;gt;
&amp;lt;dir&amp;gt;/usr/share/fonts&amp;lt;/dir&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And regenerating the font cache (via &lt;code&gt;fc-cache -fv&lt;/code&gt;) [possibly you may
need to install Nix&amp;rsquo;s &lt;code&gt;fontconfig&lt;/code&gt; package].&lt;/p&gt;



&lt;figure&gt;
    
        &lt;img src=&#34;https://babbagefiles.xyz/ox-hugo/counterfeit-gargoyle-screenshot.png&#34;/&gt; &lt;/figure&gt;

</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/lisp">lisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/guix">guix</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/linux">linux</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/stumpwm">stumpwm</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/intfic">intfic</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/fonts">fonts</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/inform">inform</category>
                                
                            
                        
                     
                        
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/tags/nix">nix</category>
                                 
                                    <category domain="https://babbagefiles.xyz/tags/gargoyle">gargoyle</category>
                                
                            
                        
                    
                
                <guid>https://babbagefiles.xyz/guix-nix-maze-of-twisty-little-paths-undefined/</guid>
                <pubDate>Wed, 24 Jul 2019 00:48:00 -0600</pubDate>
            </item>
        
            
            <item>
                <title>Equake(!) Quake-style overlay console in StumpWM</title>
                <link>https://babbagefiles.xyz/equake-in-stumpwm/</link>
                
                
                <description>&lt;p&gt;I&amp;rsquo;ve been alternatively using both KDE Plasma 5 and StumpWM on various
machines and have got a working model for using &lt;a href=&#34;https://babbagefiles.xyz/equake-elisp-console/&#34;&gt;the Equake drop-down&lt;/a&gt;
in StumpWM.&lt;/p&gt;
&lt;p&gt;The StumpWM &lt;code&gt;#&#39;invoke-equake&lt;/code&gt; command hides (using StumpWM native
&lt;code&gt;hide-window&lt;/code&gt;, rather than Emacs&amp;rsquo;s &lt;code&gt;make-frame-invisible&lt;/code&gt; as the
latter creates various issues in finding and fetching the Equake
window) the Equake frame if it&amp;rsquo;s the currently active window; it
searches through all windows in all groups on the current
screen/monitor, and calls &lt;code&gt;emacsclient -n -e &#39;(equake-invoke)&#39;&lt;/code&gt; to
create an Equake frame if no extant Equake window is found; and if an
Equake window does already exist for the current screen, it is yanked
into the current group, pulled into the current frame, and unhidden (if
necessary).&lt;/p&gt;
&lt;p&gt;This seems to work pretty well, though I haven&amp;rsquo;t figured out how to
have StumpWM &amp;lsquo;skip&amp;rsquo; the Equake frame when cycling through Emacs
windows. (And, of course, having a proper partial height floating
Equake window would be ideal.)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Here&amp;rsquo;s a better, more Quake-like set-up, which actually makes
use of recently added partial-height floating windows in non-floating
groups:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;calc-equake-width&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-width&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;caddr&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;with-input-from-stringp&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient -n -e &amp;#39;(equake-find-workarea-of-current-screen (equake-calculate-mouse-location (display-monitor-attributes-list)) (display-monitor-attributes-list))&amp;#39;&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;read&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;desired-width-perc&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;read-from-string&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient -n -e &amp;#39;equake-size-width&amp;#39;&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;truncate&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;screen-width&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;desired-width-perc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;calc-equake-height&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-height&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cadddr&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;with-input-from-string&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient -n -e &amp;#39;(equake-find-workarea-of-current-screen (equake-calculate-mouse-location (display-monitor-attributes-list)) (display-monitor-attributes-list))&amp;#39;&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;read&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;desired-height-perc&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;read-from-string&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient -n -e &amp;#39;equake-size-height&amp;#39;&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;truncate&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;screen-height&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;desired-height-perc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*equake-width*&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1368&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; TODO: programmatically get screen dimensions before Emacs starts&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*equake-height*&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;768&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;invoke-equake&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;let*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;on-top-windows&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;group-on-top-windows&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
         &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;equake-on-top&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-equake-in-group&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;on-top-windows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;equake-on-top&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;group-on-top-windows&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;remove&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;equake-on-top&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;on-top-windows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
               &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;unfloat-window&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;equake-on-top&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
               &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;hide-window&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;equake-on-top&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;;; then hide Equake window via native Stumpwm method.)&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;found-equake&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-equake-globally&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; Otherwise, search all groups of current screen for Equake window:&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;found-equake&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;          &lt;span class=&#34;c1&#34;&gt;; If Equake cannot be found,&lt;/span&gt;
            &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt;
              &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient -n -e &amp;#39;(equake-invoke)&amp;#39;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; then invoke Equake via emacs function.&lt;/span&gt;
              &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*equake-height*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;calc-equake-height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; delay calculation of height &amp;amp; width setting until 1st time equake invoked&lt;/span&gt;
              &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*equake-width*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;calc-equake-width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; (otherwise Emacs may not be fully loaded)&lt;/span&gt;
          &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;raise-window&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;found-equake&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
                   &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;move-window-to-group&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;found-equake&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; But if Equake window is found, move it to the current group,&lt;/span&gt;
                   &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;unhide-window&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;found-equake&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; unhide window, in case hidden&lt;/span&gt;
                   &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;float-window&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;found-equake&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; float window&lt;/span&gt;
                   &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;float-window-move-resize&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-equake-globally&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;screen-groups&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-screen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:width&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*equake-width*&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:height&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*equake-height*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; set size&lt;/span&gt;
                   &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;focus-window&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;found-equake&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
                   &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;toggle-always-on-top&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))))))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; make on top&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;find-equake-in-group&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;windows-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Search through WINDOWS-LIST, i.e. all windows of a group, for an Equake window. Sub-component of &amp;#39;#find-equake-globally.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-searched-window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;windows-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;current-searched-window&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
        &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;search&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;*EQUAKE*[&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;window-name&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;current-searched-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
            &lt;span class=&#34;nv&#34;&gt;current-searched-window&lt;/span&gt;
            &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-equake-in-group&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;windows-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;find-equake-globally&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Recursively search through GROUP-LIST, a list of all groups on current screen, for an Equake window.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
      &lt;span class=&#34;ss&#34;&gt;&amp;#39;nil&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;equake-window&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-equake-in-group&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;list-windows&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;car&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))))&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;equake-window&lt;/span&gt;
            &lt;span class=&#34;nv&#34;&gt;equake-window&lt;/span&gt;               &lt;span class=&#34;c1&#34;&gt;; stop if found and return window&lt;/span&gt;
            &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;find-equake-globally&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cdr&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;group-list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))))&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;;; Set the mouse focus policy;  - :click is best for proper Equake functioning&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*mouse-focus-policy*&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:click&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;;; also StumpWM default (I think)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;;; Keybindings&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;;; bind to an appropriate key&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*top-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;F12&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;invoke-equake&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is what it looks like:
&lt;img src=&#34;https://github.com/emacsomancer/equake/raw/master/image/equake-in-stumpwm.gif&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://gitlab.com/emacsomancer/equake/raw/master/image/equake-in-stumpwm.webm&#34;&gt;video
link here&lt;/a&gt;&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/lisp">lisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/stumpwm">stumpwm</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/equake">equake</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/emacs">emacs</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/eshell">eshell</category>
                                
                            
                        
                     
                        
                     
                        
                    
                
                <guid>https://babbagefiles.xyz/equake-in-stumpwm/</guid>
                <pubDate>Wed, 22 May 2019 22:26:00 -0500</pubDate>
            </item>
        
            
            <item>
                <title>Quake-style drop-down terminal in StumpWM</title>
                <link>https://babbagefiles.xyz/quake_terminal_stumpwm/</link>
                
                
                <description>&lt;p&gt;One thing I&amp;rsquo;ve missed in StumpWM is a Quake-style drop-down terminal,
like what Guake provides (and I have a Lua-one in my AwesomeWM
config). It may be that I&amp;rsquo;m still haven&amp;rsquo;t fully absorbed the
StumpWM-mindset and that I should be doing this a different way. But
up until now when I&amp;rsquo;m using StumpWM I&amp;rsquo;ve tended to end up with a heap
of terminal windows that are a pain to navigate through (I have a
&lt;code&gt;run-or-raise&lt;/code&gt; command associated with xterm, but it starts from the
first xterm window and usually I want the last – something else to
figure out how to do). It&amp;rsquo;s nice to have a &amp;lsquo;working terminal&amp;rsquo; that one
can quickly summon and dismiss.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a number of issues for creating a Quake-type drop-down in
StumpWM (at least based on my current knowledge). The first is fairly
easily dealt with - I don&amp;rsquo;t want more than one Quake terminal around.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;run-or-raise&lt;/code&gt; will prevent multiple instances from being created:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;urxvt&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Start an urxvt instance or switch to it, if it is already running.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-or-raise&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;urxvt&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;ss&#34;&gt;:title&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;urxvt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(I&amp;rsquo;m cheating here a bit because I&amp;rsquo;m not quite sure how to handle
title-management. I know windows can be retitled, and I initially
tried setting the window title in the above function to &amp;ldquo;quake&amp;rdquo;, but
somehow I ended up also sporadically re-titling &lt;strong&gt;other&lt;/strong&gt; windows as
&amp;ldquo;quake&amp;rdquo;, so I&amp;rsquo;ve side-stepped the whole issue by just using urxvt for
my drop-down terminal, with my regular terminal being xterm.)&lt;/p&gt;
&lt;p&gt;What we want then is a function that toggles our Quake terminal
on-and-off: essentially if the current window is not urxvt, then call
the &lt;code&gt;urxvt&lt;/code&gt; function defined above, and if the current window is urxvt
then switch back to the last used window before urxvt was called.  The
basic thing we need for this is &lt;code&gt;(if (equal (window-title (current-window)) &amp;quot;urxvt&amp;quot;)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The trouble is that StumpWM has a nice feature which is similar to
doing &lt;code&gt;C-x b RET&lt;/code&gt; in Emacs: it essentially switches to the last window
used, so it can be a nice feature for switching back and forth between
two different windows you&amp;rsquo;re working in. The function is
&lt;code&gt;pull-hidden-other&lt;/code&gt; and it is invoked with &amp;ldquo;prefix prefix&amp;rdquo;, which for
me is &lt;code&gt;s-f s-f&lt;/code&gt; (Super+F, twice), but by default is &lt;code&gt;C-t C-&lt;/code&gt; (Ctrl+t
twice). Why this creates a problem is because our Quake terminal will
muck that up because &lt;strong&gt;it&lt;/strong&gt; will often end up being the last used
window, and that&amp;rsquo;s not what I want. I want &lt;code&gt;pull-hidden-other&lt;/code&gt; to
switch to the last used window that&amp;rsquo;s &lt;strong&gt;not&lt;/strong&gt; the Quake drop-down.&lt;/p&gt;
&lt;p&gt;I tried a number of different things, and this may still not be the
best solution, but it works:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;rxvt-quake&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Toggle rxvt-quake window.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;window-title&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;urxvt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;   &lt;span class=&#34;c1&#34;&gt;; if the current window is quake&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;other-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;    &lt;span class=&#34;c1&#34;&gt;; switch back to window quake was called from&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;select-window-by-number&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*real-other-window*&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;; switch to the &amp;#39;real&amp;#39; &amp;#34;other-window&amp;#34;&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;other-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;; switch back to the original window - this way after quake finishes, the original configuration is restored&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;progn&lt;/span&gt;          &lt;span class=&#34;c1&#34;&gt;; otherwise, if the current window is NOT quake&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;other-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;   &lt;span class=&#34;c1&#34;&gt;; first switch the current &amp;#34;other-window&amp;#34;&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;window-title&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;urxvt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; if the current&lt;/span&gt;
								  &lt;span class=&#34;c1&#34;&gt;; &amp;#34;other-window&amp;#34; is&lt;/span&gt;
								  &lt;span class=&#34;c1&#34;&gt;; quake itself, do&lt;/span&gt;
								  &lt;span class=&#34;c1&#34;&gt;; nothing&lt;/span&gt;
	    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setf&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*real-other-window*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;window-number&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; otherwise store the window-number of the current other-window&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;other-window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; switch back to the window originally called from&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;urxvt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; run-or-raise urxvt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So this function indeed checks to see whether the current window is
our Quake drop-down terminal. If it&amp;rsquo;s not, it first switches to the
currently last used window with &lt;code&gt;(other-window)&lt;/code&gt; and stores the number
of this window in &lt;code&gt;*real-other-window*&lt;/code&gt; (but &lt;strong&gt;only&lt;/strong&gt; if this
last-used-window isn&amp;rsquo;t itself urxvt - otherwise we&amp;rsquo;ll sometime end up
&amp;lsquo;over-writing&amp;rsquo; the actual last-used-window we want to keep). It then
switches back to window that was active when &lt;code&gt;rxvt-quake&lt;/code&gt; was invoked,
and then it calls the &lt;code&gt;urxvt&lt;/code&gt; function which either launches a new
urxvt (if none currently exists), or raises the currently running
urxvt window. Storing the value in &lt;code&gt;*real-other-window*&lt;/code&gt; gives us a
way to remember what the &amp;lsquo;real&amp;rsquo; last-used window should be.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;rxvt-quake&lt;/code&gt; is invoked while the Quake urxvt drop-down is the
currently active window, then first &lt;code&gt;(other-window)&lt;/code&gt; is invoked,
switching us back to the window that was active before we called the
drop-down terminal, then we switch to our stored window (which was the
&amp;lsquo;real&amp;rsquo; last-used window before Quake was invoked), and then we switch
back with &lt;code&gt;(other-window)&lt;/code&gt; to the window that was active when Quake
was first invoked.&lt;/p&gt;
&lt;p&gt;This way the window configuration that existed before we summoned our
Quake drop-down terminal is restored, and &lt;code&gt;pull-hidden-other&lt;/code&gt;
effectively ignores the Quake drop-drop.&lt;/p&gt;
&lt;p&gt;Bind this command to the traditional F12 with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*top-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;F12&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;rxvt-quake&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And you&amp;rsquo;re got a &amp;lsquo;traditional&amp;rsquo; Quake drop-down terminal in StumpWM.&lt;/p&gt;
&lt;p&gt;It is a &amp;lsquo;full-length&amp;rsquo; drop-down terminal, however. It might be nice to
have it be a fraction of the screen like a more traditional Quake drop-down.&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/lisp">lisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/stumpwm">stumpwm</category>
                                
                            
                        
                     
                        
                     
                        
                    
                
                <guid>https://babbagefiles.xyz/quake_terminal_stumpwm/</guid>
                <pubDate>Tue, 18 Sep 2018 20:45:00 -0600</pubDate>
            </item>
        
            
            <item>
                <title>Managing emacsclient windows in StumpWM</title>
                <link>https://babbagefiles.xyz/emacs_windows_stumpwm/</link>
                
                
                <description>&lt;p&gt;I&amp;rsquo;m still working on getting my GuixSD machine configured, including
working on getting familiar with &lt;a href=&#34;https://stumpwm.github.io/&#34;&gt;StumpWM&lt;/a&gt; – a windows manager written
in Common Lisp – which is the desktop paradigm I&amp;rsquo;ve decided upon for
this Lisp-centric machine.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m somewhat habituated to (my) &lt;a href=&#34;https://awesomewm.org/&#34;&gt;AwesomeWM&lt;/a&gt; keybindings, which involve
the Super key in combination with various other keys, including say
&lt;code&gt;s-1&lt;/code&gt; for tag/workspace 1, &lt;code&gt;s-3&lt;/code&gt; for tag/workspace 3, &amp;amp;c., and
&lt;code&gt;s-E&lt;/code&gt; (i.e. hold Super and Shift and press &lt;code&gt;e&lt;/code&gt;) to launch an
emacsclient (see below on the Emacs client/daemon
configuration). StumpWM could be configured in a somewhat similar
fashion (though it doesn&amp;rsquo;t seem to quite use tag/workspaces in the
same fashion), but the &amp;lsquo;tradition&amp;rsquo; seems to be to use a prefix, which
is by default &lt;code&gt;C-t&lt;/code&gt; (that is, hold Control and press &lt;code&gt;t&lt;/code&gt;), which
is then released and followed with another key or key combination. I
don&amp;rsquo;t really like using Control for windows management since it tends
to conflict with bindings in Emacs and elsewhere, so I&amp;rsquo;m testing out
&lt;code&gt;s-F&lt;/code&gt; (hold Super, press &lt;code&gt;f&lt;/code&gt;) as a prefix (though whether I&amp;rsquo;ll
stick with prefixed bindings or go back to single action bindings, I&amp;rsquo;m
not yet certain).&lt;/p&gt;
&lt;p&gt;From browsing other stumpwm configs, I came across a useful bit of
configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;run-or-raise-prefer-group&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;cmd&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;win-cls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;If there are windows in the same class, cycle in those. Otherwise call
&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;run-or-raise with group search t.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;windows&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;group-windows&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;current-group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;member&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;win-cls&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;mapcar&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;#&amp;#39;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;window-class&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;windows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:test&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;#&amp;#39;string-equal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-or-raise&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;cmd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;ss&#34;&gt;:class&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;win-cls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-or-raise&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;cmd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;ss&#34;&gt;:class&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;win-cls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This function can then be used with specific applications, e.g.:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;run-or-raise-icecat&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
	    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-or-raise-prefer-group&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;icecat&amp;#34;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Icecat&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above function leverages &lt;code&gt;run-or-raise-prefer-group&lt;/code&gt; to either
launch Icecat, if it is not already running, or else focus the Icecat
window, and successive calls will cycle through multiple Icecat
windows/windows if more than one Icecat window exists. This is extremely
useful as it&amp;rsquo;s much less cognitively-tasking than figuring out which
window number Icecat currently is associated with.&lt;/p&gt;
&lt;p&gt;This can then be assigned a binding(s) like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;W&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;run-or-raise-icecat&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;C-W&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;run-or-raise-icecat&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;s-W&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;run-or-raise-icecat&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This means that one first presses the prefix (&lt;code&gt;s-f&lt;/code&gt; for me) followed
by either &lt;code&gt;W&lt;/code&gt; or &lt;code&gt;C-W&lt;/code&gt; or &lt;code&gt;s-W&lt;/code&gt; (that is, &lt;code&gt;Shift+w&lt;/code&gt;,
&lt;code&gt;Control-Shift+w&lt;/code&gt; or &lt;code&gt;Super-Shift+w&lt;/code&gt;) to either launch Icecat or
focus/cycle through existing Icecat windows/windows.&lt;/p&gt;
&lt;p&gt;Now, the way I typically use Emacs is to invoke it as a daemon
(i.e. &lt;code&gt;emacs --daemon&lt;/code&gt;) and then connect Emacsclients to this daemon
(i.e. &lt;code&gt;emacsclient -c&lt;/code&gt; for the &amp;lsquo;windowed&amp;rsquo; gtk-application,
&lt;code&gt;emacsclient -t&lt;/code&gt; in the terminal). However, if we define a parallel
function for Emacs, a particular edge-case arises:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;run-or-raise-emacsclient&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
		&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-or-raise-prefer-group&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacs&amp;#34;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Emacs&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This works rather like the Icecat one as long as at least one
Emacsclient window exists (so if there are multiple window,
successive calls of &lt;code&gt;run-or-raise-emacsclient&lt;/code&gt; will cycle through
them). &lt;strong&gt;However&lt;/strong&gt;, if no emacsclient is currently open, it will launch an
undaemon&amp;rsquo;ed Emacs (requiring loading the entire &lt;code&gt;init.el&lt;/code&gt;), even
if/though an Emacs daemon is currently running and thus could be
attached to.&lt;/p&gt;
&lt;p&gt;At least one solution to this is the following function (with
relevant keybindings):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;decide-on-emacsclient&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
 &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;equal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;pgrep \&amp;#34;emacsclient\&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
     &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient -c&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
     &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-or-raise-emacsclient&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;s-e&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;decide-on-emacsclient&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;C-e&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;decide-on-emacsclient&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;e&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;decide-on-emacsclient&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above function executes the shell-command &lt;code&gt;pgrep &amp;quot;emacsclient&amp;quot;&lt;/code&gt;
and evaluates whether the output of that shell-command is equal to the
empty string (which will be the case only when no emacsclient is
running). Where at least one emacsclient is running, it executes the
&lt;code&gt;run-or-raise-emacsclient&lt;/code&gt; function defined earlier,
focussing/cycling through running emacsclients. Where no emacsclient
is currently running, it executes instead &lt;code&gt;emacsclient -c&lt;/code&gt;, opening
a windowed emacsclient.  And the bindings let me press the prefix and
then either &lt;code&gt;Super+e&lt;/code&gt;, &lt;code&gt;Control+e&lt;/code&gt; or simply &lt;code&gt;e&lt;/code&gt; to execute this
new function.&lt;/p&gt;
&lt;p&gt;I also have the following definitions:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lisp&#34; data-lang=&#34;lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;defcommand&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;emacsclient-launch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-shell-command&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient -c&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;s-E&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient-launch&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;C-E&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient-launch&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;define-key&lt;/span&gt; &lt;span class=&#34;vg&#34;&gt;*root-map*&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kbd&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;E&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;emacsclient-launch&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So that if I want to launch a new emacsclient window instead of switching to an
existing one, I can do so using one of series of keybindings parallel
to the previous set, but with a capital &lt;code&gt;E&lt;/code&gt; rather than a lowercase
one.&lt;/p&gt;
&lt;p&gt;This is working well for me, and is a nice example of the power of
using Lisp-based &amp;lsquo;desktop environment&amp;rsquo;.&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/lisp">lisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/stumpwm">stumpwm</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/emacs">emacs</category>
                                
                            
                        
                     
                        
                     
                        
                    
                
                <guid>https://babbagefiles.xyz/emacs_windows_stumpwm/</guid>
                <pubDate>Sat, 18 Aug 2018 21:36:00 -0600</pubDate>
            </item>
        
            
            <item>
                <title>Guix: You are in a maze of lispy little passages, (map equal? ′(′all ′alike) ′(′all ′alike))</title>
                <link>https://babbagefiles.xyz/guix_maze_of_lispy_little_passages/</link>
                
                
                <description>&lt;p&gt;So I finally made a serious go of running &lt;a href=&#34;https://www.gnu.org/software/guix/&#34;&gt;GuixSD&lt;/a&gt;, a GNU Linux distro
which is largely built on &lt;a href=&#34;https://en.wikipedia.org/wiki/GNU_Guile&#34;&gt;GNU Guile Scheme&lt;/a&gt; (a dialect of Lisp) on one
of my machines (one I had actually put together with GuixSD in mind:
an X200 Thinkpad, which I &lt;a href=&#34;https://libreboot.org/&#34;&gt;Libreboot&lt;/a&gt;&amp;lsquo;ed and put a Atheros Wi-Fi card
in), and, to increase both the quantity and variety of Lisps involved,
am trying to use with &lt;a href=&#34;https://stumpwm.github.io/&#34;&gt;StumpWM&lt;/a&gt; (which is written in Common Lisp).&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a fascinating distro, modelled on &lt;a href=&#34;https://nixos.org/&#34;&gt;Nix&lt;/a&gt;, but implemented in
Guile. It&amp;rsquo;s not been exactly easy to get running (&lt;a href=&#34;https://www.gnu.org/software/guix/blog/2017/back-from-fosdem-2017/&#34;&gt;one of the videos on
GuixSD from Fosdem 2017&lt;/a&gt; included the line &amp;ldquo;[GuixSD] is like Gentoo for
grown ups&amp;rdquo;), in part because its architecture is rather different from what
I&amp;rsquo;ve experienced with other Linux distros, which use different package
managers perhaps and sometimes even different libc&amp;rsquo;s, but generally
follow a similar design philosophy. Rather than spreading out
configuration across lots of different pieces, GuixSD seems to largely
try to concentrate it in specific configuration files which are
transactional in that they can be rolled back (and thus the system can
be rolled back to known working states).&lt;/p&gt;
&lt;p&gt;It is a GNU-blessed distro, and does take the FSF&amp;rsquo;s hard line (and to
my eyes sometimes weird line) approach to software. So no proprietary
software is included in the Guix repos, including firmware (and it
runs on the linux-libre kernel). That by itself is fine, but it means
the state of affairs for Guix-packaged browsers is pretty poor. No
Chromium, no Firefox. IceCat 52 is essentially what&amp;rsquo;s currently
available (if IceCat were up to the latest Firefox ESR 60, it might be
easier) in terms of browsers which might be considered secure.&lt;/p&gt;
&lt;p&gt;This led me to try to use the Nix installer by itself&lt;sup&gt;&lt;a href=&#34;#org-target--0b&#34;&gt;*&lt;/a&gt;&lt;/sup&gt;&lt;span class=&#34;org-target&#34; id=&#34;org-target--0t&#34;&gt;&lt;/span&gt; to try to
install Firefox and Chromium. Sadly, I can&amp;rsquo;t get Nix&amp;rsquo;s Chromium to
work at all on GuixSD, and while Firefox works fine, I can&amp;rsquo;t get it to
see my locally installed fonts (or other fonts I&amp;rsquo;ve installed via
Nix).&lt;/p&gt;
&lt;p&gt;Hopefully at some point &lt;a href=&#34;http://next-browser.com/&#34;&gt;Next Browser&lt;/a&gt; will be packaged for Guix, to
bring in another major component written in (Common) Lisp. And when
(if?) IceCat 60 comes out, that will alleviate the pain somewhat. (I
was a long-time &lt;a href=&#34;http://conkeror.org/&#34;&gt;Conkeror&lt;/a&gt; user, and I briefly tried it again in GuixSD,
but I&amp;rsquo;m not certain of its security and uBlock Origin no long works
with it, which I believe is why I stopped using it in the first
place).&lt;/p&gt;
&lt;p&gt;Other interesting Lispy pieces include &lt;a href=&#34;https://www.gnu.org/software/mcron/&#34;&gt;mcron&lt;/a&gt;, a cron which accepts (as
well as Vixie cron style, I think) Guile config files. The &lt;a href=&#34;https://www.gnu.org/software/guix/manual/en/html_node/Scheduled-Job-Execution.html&#34;&gt;examples in
Guix manual&lt;/a&gt; I couldn&amp;rsquo;t really get to work. But via the &lt;code&gt;help-guix&lt;/code&gt;
listserv I found that one can put simple guile scripts in
&lt;code&gt;~/.config/cron/job.guile&lt;/code&gt;. Working out how to do a &amp;lsquo;run this every N
minutes&amp;rsquo; was not immediately obvious, but I figured out how to do it,
e.g.:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-guile&#34; data-lang=&#34;guile&#34;&gt;; execute run_me every 5 minutes
(job &#39;(next-minute (range 0 60 5)) &amp;quot;run_me&amp;quot;)
; run execute_me every 2 hours
(job &#39;(next-hour (range 0 24 2)) &amp;quot;execute_me&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;One of the other great things about GuixSD is that its init manager,
&lt;a href=&#34;https://www.gnu.org/software/shepherd/&#34;&gt;GNU Shepherd&lt;/a&gt;, is also written in Guile Scheme. I&amp;rsquo;ve only had a chance
to play with it a little bit, but it seems very nice and it&amp;rsquo;s good to
find other innovative init managers (I would mention here also &lt;a href=&#34;http://smarden.org/runit/&#34;&gt;runit&lt;/a&gt;
and &lt;a href=&#34;https://skarnet.org/software/s6/&#34;&gt;s6&lt;/a&gt;) which take very different approaches to &lt;a href=&#34;https://www.freedesktop.org/wiki/Software/systemd/&#34;&gt;systemd&lt;/a&gt; (another
innovative init, or perhaps init+, but one that creates more problems
than it solves in the end, in my experience).&lt;/p&gt;
&lt;p&gt;On the Guix package manager itself: I learned the hard way that
searching for packages in Guix is really only comfortable within
Emacs: so do &lt;code&gt;guix package -i guix-emacs&lt;/code&gt; and then do everything else
from guix-emacs within Emacs ( &lt;code&gt;M-x guix-search-by-name&lt;/code&gt; to search
package names by regex; and &lt;code&gt;M-x guix-search-by-regex&lt;/code&gt; to search
names+descriptions by regex). The results returned by &lt;code&gt;guix package -s ....&lt;/code&gt; in a terminal are not very browseable (though I tried valiantly
for some time). But if you&amp;rsquo;re interested in Guix, you&amp;rsquo;ll likely
interested in Emacs anyway.&lt;/p&gt;
&lt;p&gt;What I&amp;rsquo;m trying to build on this machine is something with lots of
Lisp. Of course the kernel is still a kernel written in C, as are lots
of the other pieces like the terminal &amp;amp;c., but much of the user-facing
things: the package manager, the windows manager, the init, the job
scheduler (=cron), and (most importantly perhaps) the &amp;lsquo;text editor&amp;rsquo;
(read: document composer, email interface, irc interface, twitter
interface, blog post interface, code editor &amp;hellip;) are all largely
written in and interacted with using some form of Lisp (Guile Scheme,
Common Lisp, Emacs Lisp).&lt;/p&gt;
&lt;p&gt;Guix is a bit like Emacs, I think. It&amp;rsquo;s an incredibly powerful tool
with lots of interesting possibilities, but when you start using it
you&amp;rsquo;re presented with an empty screen with little indication of what
you can do. I&amp;rsquo;ll be sticking with it, I think. Now I&amp;rsquo;ve got to get to
grips with StumpWM and figure out how to configure &lt;a href=&#34;https://github.com/jaagr/polybar&#34;&gt;polybar&lt;/a&gt;&amp;hellip;&lt;/p&gt;
&lt;p&gt;[And if you&amp;rsquo;re curious about why Guix is pronounced like &amp;ldquo;geeks&amp;rdquo;, have
a look at &lt;a href=&#34;https://slade.jnanam.net/post/scheming-french-geeks-with-guile/&#34;&gt;this post over on my linguistics blog&lt;/a&gt;.]&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;#org-target--0t&#34;&gt;*&lt;/a&gt;&lt;span class=&#34;org-target&#34; id=&#34;org-target--0b&#34;&gt;&lt;/span&gt; As well as being the package managers of both of their
respective distros, both the Nix and Guix package managers can be used
&lt;strong&gt;on top of&lt;/strong&gt; other distros. Nix doesn&amp;rsquo;t have quite the same hard line
approach to software licences as Guix.&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/lisp">lisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/guix">guix</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/linux">linux</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/stumpwm">stumpwm</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/emacs">emacs</category>
                                
                            
                        
                     
                        
                     
                        
                    
                
                <guid>https://babbagefiles.xyz/guix_maze_of_lispy_little_passages/</guid>
                <pubDate>Sat, 04 Aug 2018 21:47:00 -0500</pubDate>
            </item>
        
    </channel>
</rss>


