<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Tmux on Janusworx</title>
    <link>https://janusworx.com/tags/tmux/</link>
    <description>Recent content in Tmux on Janusworx</description>
    <image>
      <title>Janusworx</title>
      <url>https://janusworx.com/images/jw-logo.png</url>
      <link>https://janusworx.com/images/jw-logo.png</link>
    </image>
    <generator>Hugo -- 0.157.0</generator>
    <language>en</language>
    <lastBuildDate>Sat, 01 Feb 2025 09:27:25 +0530</lastBuildDate>
    <atom:link href="https://janusworx.com/tags/tmux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Tmux Start Session Maximized With Three Panes</title>
      <link>https://janusworx.com/work/tmux-start-session-maximized-with-three-panes/</link>
      <pubDate>Sat, 01 Feb 2025 09:27:25 +0530</pubDate>
      <guid>https://janusworx.com/work/tmux-start-session-maximized-with-three-panes/</guid>
      <description>New short ritual to get my writing sessions going</description>
      <content:encoded><![CDATA[<p>So I got tired of starting up a dedicated tmux session to manage all the work related to my writing sessions. Over the past few months, I’ve boiled it down to three.<br>
And it still irks me that I have to …</p>
<ol>
<li>Launch Terminal</li>
<li>Launch Tmux</li>
<li>Split it into three windows err … panes.</li>
<li>Go to the top left pane and launch Hugo server</li>
<li>Switch to the right pane and then launch Emacs with whatever new post I want to write today.</li>
</ol>
<p>So <em>of course</em>, a <a href="https://en.wikipedia.org/wiki/Rube_Goldberg">Rube Goldberg-esque</a>, tiny bash-pipey monster took form.
It now resides, chained to an alias, <code>hssx</code><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> in my <code>.bash_aliases</code> file</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>alias hssx<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;cd /path/to/my/hugo/folder &amp;&amp; \
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">xdotool windowsize $(xdotool getactivewindow) 100% 100% &amp;&amp; \
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">tmux new-session \; split-window -h \; select-pane -l \; split-window -v \; select-pane -U \; send-keys &#34;hugo serve&#34; C-m \; select-pane -R&#39;</span>
</span></span></code></pre></td></tr></table>
</div>
</div><ol>
<li>The first line switches to my hugo folder</li>
<li>The second calls <code>xdotool</code> and maximises the terminal window</li>
<li>And the last line is a series of instructions to the tmux command. I’ve split it below for readability.</li>
</ol>
<pre tabindex="0"><code>tmux new-session \; #Tmux start a new session
split-window -h \; # Split the window into two vertical panes
select-pane -l \; # Switch to the left pane
split-window -v \; # Split that into two horizontal panes
select-pane -U \; # Select the upper pane
send-keys &#34;hugo serve&#34; C-m \; # Type in `hugo serve` followed by Enter
select-pane -R # Select the right pane
</code></pre><hr style='margin-left: auto; margin-right: auto; margin-bottom: 40px; margin-top: 50px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238);  height: 1px;'/>

<figcaption style="font-style: italic; text-align: center;  font-size: 85%; color: var(--secondary)">
<p>And boom!</p>
</figcaption>
<p><a href="/images/2025/tmux-layout.png"><figure class="align-center ">
    <img loading="lazy" src="/images/2025/tmux-layout.png#center"
         alt="bash terminal showing a tmux window split into three panes"/> 
</figure>
</a></p>
<figcaption style="font-style: italic; text-align: center;  font-size: 85%; color: var(--secondary)">
<p>Click pic for a larger version</p>
</figcaption>
<p><hr style='margin-left: auto; margin-right: auto; margin-bottom: 40px; margin-top: 50px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238);  height: 1px;'/>

Feedback on this post?<br>
Mail me at <a href="mailto:feebdback@janusworx.com?subject=%22Feedback on post: Tmux Start Session Maximized With Three Panes
%22">feedback at this domain</a> <em>or</em> <a href="https://dc.janusworx.com/t/tmux-start-session-maximized-with-three-panes
">continue the discourse here</a>.
<br>

<br>

P.S. Subscribe to my <a href="https://janusworx.com/subscribe/">mailing list!</a><br>
Forward these posts and letters to your friends and get them to subscribe!<br>
P.P.S. Feed my <a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share">insatiable reading habit.</a></p>
<hr>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><code>hugo start session</code> and x just because all my aliases have ended with x for years and years&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded>
    </item>
  </channel>
</rss>
