<?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>Espanso on Janusworx</title>
    <link>https://janusworx.com/tags/espanso/</link>
    <description>Recent content in Espanso 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.163.0</generator>
    <language>en</language>
    <lastBuildDate>Sun, 19 Jan 2025 12:45:09 +0530</lastBuildDate>
    <atom:link href="https://janusworx.com/tags/espanso/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>More Espanso &amp; Emacs Shenanigans</title>
      <link>https://janusworx.com/work/more-espanso-emacs-shenanigans/</link>
      <pubDate>Sun, 19 Jan 2025 12:45:09 +0530</pubDate>
      <guid>https://janusworx.com/work/more-espanso-emacs-shenanigans/</guid>
      <description>Fixing my blog post, CTA snippet …</description>
      <content:encoded><![CDATA[<p><br>

<figure class="align-center ">
    <img loading="lazy" src="/images/2024/espanso.png#center"
         alt="Espanso Logo"/> 
</figure>
</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;'/>

<p>Now that I use my local machine to draft all my posts, desktop Emacs makes everything easier … with one exception. It swallows up a lot of my Espanso expansions.</p>
<p>My current bugbear is that it will not render a <code>=</code> when expanding.<br>
I know this is entirely something that I brought on myself, and neither Emacs or Espanso in isolation will have issues.</p>
<p>My workaround after rummaging through Espanso’s documentation was to set the backend to use <code>xdotool</code>, in my config. (<code>~/.config/espanso/config/default.yml</code>)</p>
<div class="highlight"><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-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">x11_use_xdotool_backend</span>: <span style="color:#66d9ef">true</span>
</span></span></code></pre></div><p>One downside now is that it no longer <a href="https://espanso.org/docs/matches/basics/#cursor-hints">jumps back to a predefined location</a> in the snippets where I’ve defined such a thing. No matter. I use them rarely and I’ll figure something out later. (Alongside why desktop emacs won’t render markdown expansions sometimes as well)</p>
<p>For now, most of my expansions work. Hurrah!</p>
<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: More Espanso &amp; Emacs Shenanigans
%22">feedback at this domain</a> <em>or</em> <a href="https://dc.janusworx.com/t/more-espanso-emacs-shenanigans
">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>
]]></content:encoded>
    </item>
    <item>
      <title>Fixing Espanso Expansions</title>
      <link>https://janusworx.com/work/fixing-espanso-expansions/</link>
      <pubDate>Sun, 29 Sep 2024 17:05:19 +0530</pubDate>
      <guid>https://janusworx.com/work/fixing-espanso-expansions/</guid>
      <description>Text used to not g</description>
      <content:encoded><![CDATA[<p><br>

<figure class="align-center ">
    <img loading="lazy" src="/images/2024/espanso.png#center"/> 
</figure>

<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;'/>
</p>
<p>I never had the time to deal with my <a href="https://espanso.org/">Espanso</a><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> hijinks until today.<br>
While it worked perfectly, when I installed it all those years ago, when I migrated over from the Mac, Espanso itself has changed and evolved over the years.<br>
It took over my old configuration like a champ and <em>mostly</em> worked, with the exception of a few shortcuts; ones that I <em>frequently</em> used 😂</p>
<p>Emacs was one application of mine that never quite worked right with Espanso.<br>
I’d frequently get <code>timed out waiting for reply from selection owner</code> whenever I tried expansions in there. Typing :joy to get 😂 would work in every other program, but no joy with Emacs, in additon to plenty of other expansions err … not expanding.</p>
<p>All my browser url expansions would not expand properly either, with mangled expansions most of the time.</p>
<p>So today I <a href="https://espanso.org/docs/">dove in to the docs</a>, and realised two things.<br>
1. My emacs needed a longer time out<br>
2. Espanso now tries to identify the <em>kind</em> of text, and maybe those were causing my issues?</p>
<br>

<h3 id="emacs">Emacs</h3>
<p>I realised I needed a longer clipboard threshold, only for Emacs.<br>
So I created an <a href="https://espanso.org/docs/configuration/app-specific-configurations/">App specific configuration</a>, just for Emacs to use and gave it said option. Here’s what the contents of my <code>espanso/config/emacs.yml</code> look like</p>
<div class="highlight"><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-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">filter_class</span>: <span style="color:#e6db74">&#39;Emacs&#39;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">clipboard_threshold</span>: <span style="color:#ae81ff">10000</span>
</span></span></code></pre></div><br>

<h3 id="rich-text-expansions">Rich Text Expansions</h3>
<p>That helped with a lot of expansions in Emacs, but not with my joy expansion.<br>
And not with stuff that were links and oh … links! and html! and markdown! Could those be the culprits?<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup><br>
The docs mention that Espanso now has <a href="https://espanso.org/docs/matches/basics/#rich-text">rich text support</a><br>
What that means, is that the trigger nows supports two new keywords <code>html</code> and <code>markdown</code> in addition ye ole <code>replace</code>
So I changed most of my affected shortcuts to either of those two keywords; <code>markdown</code> for most everything and <code>html</code> for linky stuff. Here’s what my beloved joy looks like now …</p>
<div class="highlight"><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-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">matches</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">trigger</span>: <span style="color:#e6db74">&#34;:joy&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">markdown</span>: <span style="color:#ae81ff">😂</span>
</span></span></code></pre></div><p><br>

And those two things did it! Every shortcut expands everwhere! What joy 😂</p>
<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?subjectFeedback on post: Fixing Espanso Expansions
%22">feedback at this domain</a> <em>or</em> <a href="https://dc.janusworx.com/t/fixing-espanso-expansions
">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_l_share">insatiable reading habit.</a></p>
<hr>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Espanso lets you assign short snippets of text to longer streams of text, that you’d frequently use. I use <code>:adhx</code> for example, and it expands out to type my whole address. Pretty handy!&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>dun! dun! dun! they were!&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded>
    </item>
  </channel>
</rss>
