<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Francois Rigaut on Medium]]></title>
        <description><![CDATA[Stories by Francois Rigaut on Medium]]></description>
        <link>https://medium.com/@frigaut?source=rss-9ac9d74bda49------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gssDO6zPDjTrwJZy.</url>
            <title>Stories by Francois Rigaut on Medium</title>
            <link>https://medium.com/@frigaut?source=rss-9ac9d74bda49------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:12:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@frigaut/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Better multi-display space switching with yabai]]></title>
            <link>https://medium.com/@frigaut/better-multi-display-space-switching-with-yabai-829343241b97?source=rss-9ac9d74bda49------2</link>
            <guid isPermaLink="false">https://medium.com/p/829343241b97</guid>
            <category><![CDATA[yabai]]></category>
            <category><![CDATA[skhd]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[tiling-window-manager]]></category>
            <dc:creator><![CDATA[Francois Rigaut]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 09:27:31 GMT</pubDate>
            <atom:updated>2023-02-23T12:32:06.471Z</atom:updated>
            <content:encoded><![CDATA[<p>I love tilling window managers. I have been an adept for a little over a year, and now can’t go back to the mess that stacking WMs are (or Display compositors, or whatever you want to call it). I love linux and have spent many years toying with it and making it work on all kind of hardware (mostly macs). Recently I heard about yabai and this enticed me to try going back to macos (lots of utilities that are required for my work are more easily acessible on macos than linux unfortunately, but that’s another story).</p><p>So yabai it is. But I have had to fight with it quite a bit to bring it to what I was used to, or wanted it to be. One thing is <strong>better navigation on multi-displays</strong>. Coming from hyprland, I was used to scan spaces on the current display, not all spaces on all displays. I have managed to wrangle a couple of scripts to do that, which are below.</p><p>These just go to the next/prev space on the current display, and wrap to the first/last space on the display if at the end. This is in contrast to most solution you find for yabai that go around all spaces on all displays, which is not a solution that work with my workflow.</p><pre>#!/bin/bash<br># This script will focus the next space in the current display<br># yabai_prev_space_on_display.sh<br><br># What&#39;s the current display and space?<br>curdis=$(yabai -m query --displays --display | jq &#39;.index&#39;)<br>curspa=$(yabai -m query --spaces --space | jq &#39;.index&#39;)<br># get all spaces<br>allspa=$(yabai -m query --spaces --display $curdis | jq &quot;.[].index&quot;)<br># get all spaces of index higher than current one<br>higspa=$(yabai -m query --spaces --display $curdis | jq &quot;.[].index | select(. &gt; $curspa)&quot;)<br><br>if [ ! -z &quot;$higspa&quot; ]<br>then<br>  # there is at least one space with higher index on this display, switch to it <br>  set -- $higspa<br>  yabai -m space --focus $1<br>else<br>  # there is no space with higher index on this display, <br>  # circle around to lowest index space.<br>  # Comment if you don&#39;t want to wrpa around. <br>  set -- $allspa<br>  yabai -m space --focus $1<br>fi</pre><p>Next one is just going to the previous space:</p><pre>#!/bin/bash<br># yabai_prev_space_on_display.sh<br># This script will focus the previous space in the current display<br><br># What&#39;s the current display and space?<br>curdis=$(yabai -m query --displays --display | jq &#39;.index&#39;)<br>curspa=$(yabai -m query --spaces --space | jq &#39;.index&#39;)<br># get all spaces<br>allspa=$(yabai -m query --spaces --display $curdis | jq &quot;.[].index&quot;)<br># get all spaces of index higher than current one<br>lowspa=$(yabai -m query --spaces --display $curdis | jq &quot;.[].index | select(. &lt; $curspa)&quot;)<br><br>if [ ! -z &quot;$lowspa&quot; ]<br>then<br>  # there is at least one space with lower index on this display, switch to it <br>  set -- $lowspa<br>  yabai -m space --focus ${@: -1}<br>else<br>  # there is no space with lower index on this display, <br>  # circle around to highest index space.<br>  # comment if you don&#39;t want to wrap around.<br>  set -- $allspa<br>  yabai -m space --focus ${@: -1}<br>fi</pre><p>Of course now that you have these script (that you must chmod a+x), you can /have to link them to keys in your skhdrc, for instance in my case:</p><pre>cmd + alt - left  : yabai_prev_space_on_display.sh<br>cmd + alt - right : yabai_next_space_on_display.sh</pre><p>That’s it — a small addition, but it makes a difference to me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=829343241b97" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>