<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bash on Janusworx</title><link>https://janusworx.com/tags/bash/</link><description>Recent content in Bash on Janusworx</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>feedback@janusworx.com (Mario Jason Braganza)</managingEditor><webMaster>feedback@janusworx.com (Mario Jason Braganza)</webMaster><copyright>© 2026, Mario Jason Braganza</copyright><lastBuildDate>Sat, 01 Feb 2025 09:27:25 +0530</lastBuildDate><atom:link href="https://janusworx.com/tags/bash/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><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/tmux-start-session-maximized-with-three-panes/</guid><description>&lt;p&gt;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.&lt;br&gt;
And it still irks me that I have to …&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Launch Terminal&lt;/li&gt;
&lt;li&gt;Launch Tmux&lt;/li&gt;
&lt;li&gt;Split it into three windows err … panes.&lt;/li&gt;
&lt;li&gt;Go to the top left pane and launch Hugo server&lt;/li&gt;
&lt;li&gt;Switch to the right pane and then launch Emacs with whatever new post I want to write today.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So &lt;em&gt;of course&lt;/em&gt;, a &lt;a href="https://en.wikipedia.org/wiki/Rube_Goldberg" target="_blank" rel="noreferrer"&gt;Rube Goldberg-esque&lt;/a&gt;, tiny bash-pipey monster took form.
It now resides, chained to an alias, &lt;code&gt;hssx&lt;/code&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; in my &lt;code&gt;.bash_aliases&lt;/code&gt; file&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;hssx&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;cd /path/to/my/hugo/folder &amp;amp;&amp;amp; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;xdotool windowsize $(xdotool getactivewindow) 100% 100% &amp;amp;&amp;amp; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;tmux new-session \; split-window -h \; select-pane -l \; split-window -v \; select-pane -U \; send-keys &amp;#34;hugo serve&amp;#34; C-m \; select-pane -R&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;The first line switches to my hugo folder&lt;/li&gt;
&lt;li&gt;The second calls &lt;code&gt;xdotool&lt;/code&gt; and maximises the terminal window&lt;/li&gt;
&lt;li&gt;And the last line is a series of instructions to the tmux command. I’ve split it below for readability.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tmux new-session \; #Tmux start a new session
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;split-window -h \; # Split the window into two vertical panes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;select-pane -l \; # Switch to the left pane
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;split-window -v \; # Split that into two horizontal panes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;select-pane -U \; # Select the upper pane
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;send-keys &amp;#34;hugo serve&amp;#34; C-m \; # Type in `hugo serve` followed by Enter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;select-pane -R # Select the right pane&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;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;'/&gt;

&lt;figcaption style="font-style: italic; text-align: center; font-size: 85%; color: var(--secondary)"&gt;
&lt;p&gt;And boom!&lt;/p&gt;
&lt;/figcaption&gt;
&lt;p&gt;&lt;a href="https://janusworx.com/images/2025/tmux-layout.png" &gt;
&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2025/tmux-layout.png" alt="bash terminal showing a tmux window split into three panes" /&gt;
 
 
 &lt;/figure&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figcaption style="font-style: italic; text-align: center; font-size: 85%; color: var(--secondary)"&gt;
&lt;p&gt;Click pic for a larger version&lt;/p&gt;
&lt;/figcaption&gt;
&lt;p&gt;&lt;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;'/&gt;

Feedback on this post?&lt;br&gt;
Mail me at &lt;a href="mailto:feebdback@janusworx.com?subject=%22Feedback on post: Tmux Start Session Maximized With Three Panes
%22" &gt;feedback at this domain&lt;/a&gt; &lt;em&gt;or&lt;/em&gt; [continue the discourse here][3].
&lt;br&gt;

&lt;br&gt;

P.S. Subscribe to my &lt;a href="https://janusworx.com/subscribe/" target="_blank" rel="noreferrer"&gt;mailing list!&lt;/a&gt;&lt;br&gt;
Forward these posts and letters to your friends and get them to subscribe!&lt;br&gt;
P.P.S. Feed my &lt;a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share" target="_blank" rel="noreferrer"&gt;insatiable reading habit.&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;code&gt;hugo start session&lt;/code&gt; and x just because all my aliases have ended with x for years and years&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Getting Emacs Windows to Not Be Shy</title><link>https://janusworx.com/work/getting-emacs-windows-to-not-be-shy/</link><pubDate>Sat, 18 Nov 2023 09:37:35 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/getting-emacs-windows-to-not-be-shy/</guid><description>&lt;p&gt;Figuring out my webapps problem yesterday made me ask myself if I could somehow repurpose that little &lt;code&gt;xdotool&lt;/code&gt; script to solve another niche itch that I had.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Spoiler alert: It did.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I run &lt;a href="https://www.emacswiki.org/emacs/EmacsAsDaemon" target="_blank" rel="noreferrer"&gt;Emacs as a daemon&lt;/a&gt;, and use EmacsClient to connect to the Emacs process.&lt;br&gt;
Makes it really ease to launch, work on, sling around and close lots of Emacs windows.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Which brings me to the hiccough. I launch EmacsClient and a window (frame) does indeed launch, but it just … stays there in the background.&lt;/p&gt;
&lt;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;'/&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2023/ec-err-1.png" alt="" /&gt;
 
 
 &lt;/figure&gt;
&lt;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;'/&gt;

&lt;p&gt;Repeated attempts to launch EmacsClient are to no avail.&lt;br&gt;
The pesky little windows just pile up in their corner.&lt;/p&gt;

&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2023/ec-err-2.png" alt="" /&gt;
 
 
 &lt;/figure&gt;
&lt;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;'/&gt;

&lt;p&gt;Ergo, this little bit of Bash/xdotool shenanigans …&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;EMACSWINID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;xdotool search &lt;span class="s2"&gt;&amp;#34;\*scratch\*&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; tail -n1&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$EMACSWINID&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; xdotool windowactivate &lt;span class="nv"&gt;$EMACSWINID&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sh -c &lt;span class="s1"&gt;&amp;#39;emacsclient --create-frame --no-wait --alternate-editor=&amp;#34;&amp;#34; &amp;amp;&amp;amp; export EMACSWINID=$(xdotool search &amp;#34;\*scratch\*&amp;#34; | tail -n1) &amp;amp;&amp;amp; xdotool windowactivate $EMACSWINID&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Check to see if an Emacs scratch buffer is open. If it is, switch to it.&lt;/li&gt;
&lt;li&gt;Otherwise, just launch EmacsClient, get the id of the scratch buffer window (frame) and raise it, so that I can work on it. In peace.&lt;/li&gt;
&lt;/ul&gt;
&lt;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;'/&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2023/ec-err-3.png" alt="An Emacs frame in the foreground" /&gt;
 
 
 &lt;/figure&gt;
&lt;figcaption style="font-style: italic; text-align: center; font-size: 85%; color: var(--secondary)"&gt;
&lt;p&gt;&lt;em&gt;Cue: sounds of relief, in the background&lt;/em&gt;&lt;/p&gt;
&lt;/figcaption&gt;
&lt;p&gt;&lt;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;'/&gt;

Feedback on this post? Mail me at &lt;a href="mailto:&amp;amp;#102;&amp;amp;%23101;&amp;amp;%23101;&amp;amp;%23100;&amp;amp;%2398;&amp;amp;%2397;&amp;amp;%2399;&amp;amp;%23107;&amp;amp;%2364;&amp;amp;%23106;&amp;amp;%2397;&amp;amp;%23110;&amp;amp;%23117;&amp;amp;%23115;&amp;amp;%23119;&amp;amp;%23111;&amp;amp;%23114;&amp;amp;%23120;&amp;amp;%2346;&amp;amp;%2399;&amp;amp;%23111;&amp;amp;%23109;" &gt;feedback@janusworx.com&lt;/a&gt;
&lt;br&gt;

&lt;br&gt;

P.S. Subscribe to my &lt;a href="https://janusworx.com/subscribe/" target="_blank" rel="noreferrer"&gt;mailing list!&lt;/a&gt;&lt;br&gt;
Forward these posts and letters to your friends and get them to subscribe!&lt;br&gt;
P.P.S. Feed my &lt;a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share" target="_blank" rel="noreferrer"&gt;insatiable reading habit.&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Frames, in Emacs parlance&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Getting Around Linux Mint Web App Manager Window Errors</title><link>https://janusworx.com/work/getting-around-linux-mint-web-app-manager-window-errors/</link><pubDate>Fri, 17 Nov 2023 19:09:46 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/getting-around-linux-mint-web-app-manager-window-errors/</guid><description>&lt;p&gt;One of best parts of using Linux Mint is its &lt;a href="https://www.linuxmint.com/rel_ulyssa_cinnamon_whatsnew.php" target="_blank" rel="noreferrer"&gt;Web Apps Manager&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I can use most of my websites as dedicated applications now.&lt;br&gt;
Case in point, I use a dedicated web app to run &lt;a href="https://elk.zone/" target="_blank" rel="noreferrer"&gt;Elk&lt;/a&gt;, the web client for Mastodon.&lt;br&gt;
Social stuff like this, or banking stuff or my webmail for that matter, stays away from the rest of my browsing and lets me keep these activities cognitively separate.&lt;/p&gt;
&lt;p&gt;&lt;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;'/&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2023/ff-err-1.png" alt="" /&gt;
 
 
 &lt;/figure&gt;&lt;/p&gt;
&lt;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;'/&gt;

&lt;p&gt;So far, so good.&lt;br&gt;
The issue arises, when I try to launch one of these dedicated apps and it is already running.&lt;br&gt;
Due to the way these little web containers are created, it cannot run another instance and I run into this error.&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;“Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile.”&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;&lt;br&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2023/ff-err-2.png" alt="" /&gt;
 
 
 &lt;/figure&gt;
&lt;br&gt;

And I’m like, I know this you git! I &lt;em&gt;am&lt;/em&gt; running a different profile. Can’t you just switch to it? Apparently it cannot. So I’d have to go looking for my app and then &lt;em&gt;Alt-Tab&lt;/em&gt; through dozens of windows or look in my dock&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; and then get it back.&lt;/p&gt;
&lt;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;'/&gt;

&lt;p&gt;The problem wasn’t the error per se, the problem was the slightly longish delay between me calling the app and the error popping up. And also all that crazy hunting and pecking to find the right window, once I see the error. It gets maddening when I need to do this dance and all I want to do is get to my email window to go look for something important.&lt;/p&gt;
&lt;p&gt;So I began casting around for a way to somehow switch to the actually running window. Was it possible?&lt;br&gt;
That’s when I found &lt;a href="https://github.com/jordansissel/xdotool" target="_blank" rel="noreferrer"&gt;&lt;code&gt;xdotool&lt;/code&gt;&lt;/a&gt;&lt;br&gt;
It lets you do all sorts of crazy things with windows and keyboard and mouse input, but most importantly for me, it let me search for my running app window &lt;em&gt;and&lt;/em&gt; it let me raise and bring it back up. Awesome!&lt;/p&gt;
&lt;p&gt;So instead of telling &lt;a href="https://ulauncher.io/" target="_blank" rel="noreferrer"&gt;Ulauncher&lt;/a&gt; to directly launch the app, I told it to run this script instead.&lt;/p&gt;
&lt;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;'/&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2023/ff-err-3.png" alt="pic of the ulauncher script window" /&gt;
 
 
 &lt;/figure&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;span class="lnt"&gt;7
&lt;/span&gt;&lt;span class="lnt"&gt;8
&lt;/span&gt;&lt;span class="lnt"&gt;9
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ELKWINID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;xdotool search WebApp-ElkforToots1234 &lt;span class="p"&gt;|&lt;/span&gt; tail -n1&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$ELKWINID&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; xdotool windowactivate &lt;span class="nv"&gt;$ELKWINID&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sh -c &lt;span class="s1"&gt;&amp;#39; firefox --class WebApp-ElkforToots1234 --profile /home/user/.local/share/ice/firefox/ElkforToots1234 --no-remote &amp;#34;https://elk.zone/&amp;#34;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;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;'/&gt;

&lt;p&gt;In a nutshell, I’m looking to see if Elk is already running (using the xdotool search option in line 3).&lt;br&gt;
If it is, I tell xdotool to get that window to the forefront of the display; and if it isn’t, then to just go ahead and launch the app anew.&lt;/p&gt;
&lt;p&gt;What a load off my mind, this one was!&lt;/p&gt;
&lt;p&gt;&lt;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;'/&gt;

Feedback on this post? Mail me at &lt;a href="mailto:&amp;amp;#102;&amp;amp;%23101;&amp;amp;%23101;&amp;amp;%23100;&amp;amp;%2398;&amp;amp;%2397;&amp;amp;%2399;&amp;amp;%23107;&amp;amp;%2364;&amp;amp;%23106;&amp;amp;%2397;&amp;amp;%23110;&amp;amp;%23117;&amp;amp;%23115;&amp;amp;%23119;&amp;amp;%23111;&amp;amp;%23114;&amp;amp;%23120;&amp;amp;%2346;&amp;amp;%2399;&amp;amp;%23111;&amp;amp;%23109;" &gt;feedback@janusworx.com&lt;/a&gt;
&lt;br&gt;

&lt;br&gt;

P.S. Subscribe to my &lt;a href="https://janusworx.com/subscribe/" target="_blank" rel="noreferrer"&gt;mailing list!&lt;/a&gt;&lt;br&gt;
Forward these posts and letters to your friends and get them to subscribe!&lt;br&gt;
P.P.S. Feed my &lt;a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share" target="_blank" rel="noreferrer"&gt;insatiable reading habit.&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;I don’t know if this would happen if I use Chrome as the browser engine. I don’t even use it as a browser, much. And for things like these, I wouldn’t touch it with a ten foot pole.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;and still some how miss it&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Restart Emacs on System Startup</title><link>https://janusworx.com/work/restart-emacs-on-system-startup/</link><pubDate>Wed, 28 Sep 2022 11:00:00 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/restart-emacs-on-system-startup/</guid><description>&lt;p&gt;&lt;em&gt;This post was originaly published on 2022-09-27.&lt;br&gt;
&lt;a href="https://janusworx.com/work/restart-emacs-on-system-startup/#update-2022-09-28" &gt;Updated 2022-09-28&lt;/a&gt;, to include the improved script.&lt;/em&gt;&lt;br&gt;
&lt;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;'/&gt;

It’s been a year, since I figured out &lt;a href="https://janusworx.com/blog/emacsclient-does-not-recognise-compose-key-sequences/" &gt;the hack&lt;/a&gt; that finally let me use my &lt;a href="https://en.wikipedia.org/wiki/Compose_key" target="_blank" rel="noreferrer"&gt;Compose key&lt;/a&gt; in Emacs.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;br&gt;
Without it, I am unable to type any kind of quotation marks or umlauts in emacs.&lt;br&gt;
A year in, and I’m tired of restarting the service everytime the machine comes on.&lt;br&gt;
&lt;a href="https://janusworx.com/tags/automation/" &gt;The computer can do that for me.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So I whipped up this tiny bash script&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt;pidof -s emacs&lt;span class="k"&gt;)&lt;/span&gt; &lt;span class="k"&gt;))&lt;/span&gt; -le &lt;span class="m"&gt;10000&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	systemctl --user restart emacs&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	:&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It just arbitrarily checks for the Emacs service’s &lt;code&gt;PID&lt;/code&gt; and then if it’s lesser than or equal to 10000, it goes ahead and restarts the service.&lt;br&gt;
This is just some superstitious thing I did, because when I was troubleshooting all those months ago, I assumed that if Emacs started at an &lt;code&gt;ID&lt;/code&gt; in the low thousands, it must not have been loading something and restarting it to get a higher process &lt;code&gt;ID&lt;/code&gt; meant what ever it needed must have loaded.&lt;/p&gt;
&lt;p&gt;I learnt a couple of things doing it this way too.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The output of a bash command is a string.&lt;/li&gt;
&lt;li&gt;I use &lt;code&gt;$(( some_numerical_string ))&lt;/code&gt; to convert said string into an integer&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:&lt;/code&gt; means &lt;code&gt;pass&lt;/code&gt; in bash-speak&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;What I &lt;em&gt;ought&lt;/em&gt; to do is to check for the &lt;em&gt;existence&lt;/em&gt; of a &lt;code&gt;PID&lt;/code&gt; and if there is one, to then go ahead and restart emacs. I’ll do that some other time. Because right now, I put this script into my system startup and it &lt;em&gt;just works.&lt;/em&gt;&lt;/p&gt;
&lt;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;'/&gt;


&lt;h3 class="relative group"&gt;Update 2022-09-28
 &lt;div id="update-2022-09-28" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#update-2022-09-28" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;p&gt;I obviously am incapable, of leaving well enough alone.&lt;br&gt;
As I was in the bath this morning, it struck me that I was restarting the service using &lt;code&gt;systemctl restart …&lt;/code&gt;&lt;br&gt;
So I could just check for the exit status of a &lt;code&gt;systemctl status&lt;/code&gt; command, and then depending on what I got, do something. If it was running, I could just restart it.&lt;br&gt;
I checked on the command line and sure enough, if a service is running, the exit status is &lt;code&gt;0&lt;/code&gt; and if it isn’t, the status is &lt;code&gt;3&lt;/code&gt; .&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;br&gt;
So … then I monkeyed with the script to this&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;span class="lnt"&gt;7
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; systemctl --user status emacs &amp;gt; /dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; systemctl --user restart emacs&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; :&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If the emacs service is running, restart it, else do nothing.&lt;br&gt;
This ought to quiet the monkey brain for a while.&lt;br&gt;
I hope 🙂&lt;br&gt;
&lt;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;'/&gt;
&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;all i have to do is restart my Emacs service as soon as the system boots up&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I don’t know if it is always 3. It could probably vary. But it suffices in my case that it isn’t 0.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Tomorrow is Another Date</title><link>https://janusworx.com/work/tomorrow-is-another-date/</link><pubDate>Sun, 31 Jul 2022 15:17:11 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/tomorrow-is-another-date/</guid><description>&lt;p&gt;&lt;br&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2022/org-daily-tasks.png" alt="" /&gt;
 
 
 &lt;/figure&gt;
&lt;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;'/&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a href="https://orgmode.org/" target="_blank" rel="noreferrer"&gt;Org mode&lt;/a&gt; is &lt;del&gt;slowly spreading its tentacles&lt;/del&gt; increasingly becoming something, I cannot live without, to manage my day.&lt;br&gt;
And I’m getting pretty consistent with it too!&lt;/p&gt;
&lt;p&gt;Like you see above, I use dates as my headlines, below which I list the various tasks for the day.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;br&gt;
And that’s where I run into my current itch to scratch.&lt;/p&gt;
&lt;p&gt;I don’t want to keep typing out the date daily.&lt;br&gt;
The computer can do that for me.&lt;br&gt;
But how? Of the millions of ways possible, what do I want to do?&lt;br&gt;
My first thought was to figure out some way to &lt;a href="https://www.emacswiki.org/emacs/InsertingTodaysDate" target="_blank" rel="noreferrer"&gt;insert a date into Emacs.&lt;/a&gt;&lt;br&gt;
And then I thought, why only emacs? I want it &lt;em&gt;systemwide,&lt;/em&gt; across all my programs.&lt;br&gt;
So I checked if &lt;a href="https://espanso.org/" target="_blank" rel="noreferrer"&gt;Espanso&lt;/a&gt;, my friendly text expansion program, would do that for me.&lt;br&gt;
&lt;a href="https://espanso.org/docs/matches/basics/#dynamic-matches" target="_blank" rel="noreferrer"&gt;Turns out, Espanso does!&lt;/a&gt;&lt;br&gt;
I could just type &lt;code&gt;:dtx&lt;/code&gt; wherever I wanted and Espanso would happily insert the date in there. And so I did that for a few days.&lt;br&gt;
Problem solved? Well, that’s when the itch got stronger.&lt;br&gt;
&lt;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;'/&gt;


&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2022/org-shutdown-routine.png" alt="" /&gt;
 
 
 &lt;/figure&gt;
&lt;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;'/&gt;
&lt;/p&gt;
&lt;p&gt;See my evening tasks above?&lt;br&gt;
I use Cal Newport’s idea of a &lt;a href="https://www.calnewport.com/blog/2009/06/08/drastically-reduce-stress-with-a-work-shutdown-ritual/" target="_blank" rel="noreferrer"&gt;shutdown ritual&lt;/a&gt;, to empty my mind and plan the next day, every evening.&lt;br&gt;
Which, for the past couple of weeks meant using my little expansion snippet to put in today’s date for the next day’s headline, as I began planning it. And I’d just manually change the date part to the next day’s date.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Until today.&lt;/p&gt;
&lt;p&gt;I typed in &lt;code&gt;:dtx&lt;/code&gt; and I got 2022-07-31.&lt;br&gt;
And then the lazy bum inside me groaned. What? I need to the change the &lt;em&gt;month&lt;/em&gt; too?&lt;br&gt;
The computer can do that for me!&lt;/p&gt;
&lt;p&gt;So I went back to Espanso to see if it did support date expansions for tomorrow.&lt;br&gt;
&lt;a href="https://espanso.org/docs/matches/extensions/#future-and-past-dates" target="_blank" rel="noreferrer"&gt;Turns out it does!&lt;/a&gt;&lt;br&gt;
Only for some reason, it just wouldn’t play ball with the way I want my dates expressed, &lt;em&gt;(YYYY-MM-DD)&lt;/em&gt;. It would throw weird &lt;code&gt;yaml&lt;/code&gt; errors.&lt;br&gt;
And then I recalled Emacs &lt;a href="https://www.emacswiki.org/emacs/InsertingTodaysDate" target="_blank" rel="noreferrer"&gt;just called the shell to do it.&lt;/a&gt;&lt;br&gt;
So I went looking to see, if Espanso could call the operating system shell&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; to do expansions ala Emacs.&lt;br&gt;
&lt;a href="https://espanso.org/docs/matches/extensions/#shell-extension" target="_blank" rel="noreferrer"&gt;Turns out, it can!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Finally, I looked up how the &lt;code&gt;date&lt;/code&gt; command worked with past and future dates, and jigged up a small expansion snippet and put that into Espanso’s &lt;code&gt;match/base.yaml&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;:dttx&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;{{output}}&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;vars&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;output&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;shell&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;cmd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;date --date=&amp;#39;tomorrow&amp;#39; +&amp;#39;%Y-%m-%d&amp;#39;&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;br&gt;

Et voilà!&lt;br&gt;
No more backspacing and struggling with Espanso undos and date calculations.&lt;br&gt;
&lt;code&gt;:dttx&lt;/code&gt; turns into tomorrow’s date:&lt;code&gt;2022-08-01&lt;/code&gt;!&lt;br&gt;
And the monkey brain is happy again :)&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Subtasks not shown.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;like yesterday evening, I typed in &lt;code&gt;:dtx&lt;/code&gt; to get &lt;code&gt;2022-07-30&lt;/code&gt; for e.g. and then changed the &lt;code&gt;30&lt;/code&gt; to a &lt;code&gt;31&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;in my case, &lt;code&gt;bash&lt;/code&gt;&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>NeXTSTEP, Shopify and Bash History</title><link>https://janusworx.com/work/nextstep-shopify-and-bash-history/</link><pubDate>Fri, 30 Apr 2021 05:45:00 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/nextstep-shopify-and-bash-history/</guid><description>&lt;p&gt;&lt;small&gt;&lt;em&gt;This post was first sent to my newsletter on April 23rd, 2021.&lt;br&gt;
[You really ought to subscribe][1] :)&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Welcome to a tech edition of the letter.&lt;br&gt;
I’m trying something new with this now, since I am in that strange valley, where I don’t know enough about programming to write opinions of my own and yet I need to talk to my techie friends.&lt;/p&gt;
&lt;!-- TEASER_END --&gt; 
&lt;p&gt;So, taking a leaf out of &lt;a href="https://news.kushaldas.in/" target="_blank" rel="noreferrer"&gt;Kushal’s newsletter&lt;/a&gt;, I will share stuff that I come across as I read.&lt;br&gt;
And reading and jabbering about tech is something I can do.&lt;br&gt;
And the stuff I share will definitely be the best links and articles I find from the wide variety of sites I read.&lt;br&gt;
At most three a letter; I don’t want to overwhelm you :)
So, like Kushal, but not as niche as him. Definitely not wide ranging either. Let’s see :)&lt;br&gt;
Also, please let me know how you like it :)&lt;br&gt;
Here we go …&lt;/p&gt;
&lt;hr style="margin-left: auto; margin-right: auto;margin-bottom: 40px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;" /&gt; 

&lt;h3 class="relative group"&gt;Brad Cox, passed away on January 2nd this year.
 &lt;div id="brad-cox-passed-away-on-january-2nd-this-year" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#brad-cox-passed-away-on-january-2nd-this-year" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;p&gt;The throwaway language he created to sell his software libraries was picked up by a computer company as the cornerstone language to base its operating system around. That failing company was then bought out by &lt;em&gt;another&lt;/em&gt; company at death’s door, for the operating system and the libraries they’d created with Brad’s language.&lt;br&gt;
Read all about it in &lt;a href="https://computerhistory.org/blog/the-deep-history-of-your-apps-steve-jobs-nextstep-and-early-object-oriented-programming/" target="_blank" rel="noreferrer"&gt;The Deep History of Your Apps: Steve Jobs, NeXTSTEP, and Early Object-Oriented Programming&lt;/a&gt;,&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;NeXT had already invented the future back in 1988, but because NeXT never shipped more than 50,000 computers, only a handful were lucky enough to glimpse it in the 1990s.&lt;br&gt;
Steve Jobs needed to return to Apple to distribute that future to the rest of the world.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;hr style="margin-left: auto; margin-right: auto;margin-bottom: 40px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;" /&gt; 

&lt;h3 class="relative group"&gt;Ben Thompson always has awesome insight on the meta, in technology.
 &lt;div id="ben-thompson-always-has-awesome-insight-on-the-meta-in-technology" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#ben-thompson-always-has-awesome-insight-on-the-meta-in-technology" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://stratechery.com/2021/the-webs-missing-interoperability/" target="_blank" rel="noreferrer"&gt;Here’s his take on The Web’s Missing Interoperability&lt;/a&gt;,&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;from a big picture perspective this is clearly a case of Shopify, one of the most exciting companies in tech and the seeming leader of The Anti-Amazon Alliance, effectively moving into Facebook’s garden, because the web is increasingly a barren wasteland for small businesses. The cause is Apple: its approach to cookies makes platform-based web storefronts increasingly difficult to monetize effectively (Shop Pay performed magic in this regard), and its attack on “tracking” — which goes far beyond the IDFA — makes it increasingly impossible to acquire users in one place and convert them in another. The solution is to do user acquisition and user conversion all in one app — i.e. on Facebook — which is why Shopify is helping merchants move off the web and onto Facebook.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Again, it’s a good solution for Shopify, and Facebook deserves credit for recognizing that Shopify is a complement to their service, not a competitor, but I find it disappointing that once again elevating privacy above every other tradeoff is entrenching Facebook, the biggest incumbent of all.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;hr style="margin-left: auto; margin-right: auto;margin-bottom: 40px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;" /&gt; 

&lt;h3 class="relative group"&gt;Jump more efficiently into bash history
 &lt;div id="jump-more-efficiently-into-bash-history" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#jump-more-efficiently-into-bash-history" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;p&gt;The third tip on &lt;a href="https://mhoffman.github.io/2015/05/21/how-to-navigate-directories-with-the-shell.html" target="_blank" rel="noreferrer"&gt;Max Hoffman’s post solved an really sore and irritating need I had&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;The last tip aims for faster retrieval of commands from history. Usually, the up-arrow jumps to the previous command in the history. However this quickly becomes very tedious if one jumps 5 or 10 or more commands back in history. Instead if you put&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bind '&amp;quot;\e[A&amp;quot;:history-search-backward'&lt;/code&gt;&lt;br&gt;
&lt;code&gt;bind '&amp;quot;\e[B&amp;quot;:history-search-forward'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;into your &lt;code&gt;/.bashrc&lt;/code&gt; and start typing part of a command it will only jump to those commands in the history which start with the same fragment of a command. This is useful for any command line work and you may already know if from e.g. IPython but it is also useful for &lt;code&gt;cd&lt;/code&gt;. So …&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cd &amp;lt;up-arrow&amp;gt;&amp;lt;up-arrow&amp;gt;&lt;/code&gt; &amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;let’s you quickly navigate through previous cd commands.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;br&gt; 
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=b9434BoGkNQ" target="_blank" rel="noreferrer"&gt;That’s all folks!&lt;/a&gt; :)&lt;/p&gt;</description></item><item><title>A Hundred Days of Code, Day 028</title><link>https://janusworx.com/work/a-hundred-days-of-code-day-028/</link><pubDate>Mon, 11 May 2020 08:39:53 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/a-hundred-days-of-code-day-028/</guid><description>&lt;p&gt;This probably will be a few days of bike shedding.&lt;br&gt;
I finally came up with a problem, I want to solve for myself and then realised, I don’t know enough &lt;a href="https://www.commandlinefu.com/commands/browse" target="_blank" rel="noreferrer"&gt;command line fu&lt;/a&gt; to integrate my stuff with my operating system, the way I like.&lt;br&gt;
So I am going to spend time, learning how to use the &lt;a href="https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29" target="_blank" rel="noreferrer"&gt;bash&lt;/a&gt; shell.&lt;br&gt;
Been searching, copying and modifying scripts for far too long now.&lt;br&gt;
Best to get this skill in my kitty as soon as I can possibly learn it.&lt;/p&gt;
&lt;p&gt;P.S. Learnt enough in a marathon 12 hour session to be dangerous, to know what I want and look it up.&lt;/p&gt;</description></item></channel></rss>