<?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 Nipun Kothari on Medium]]></title>
        <description><![CDATA[Stories by Nipun Kothari on Medium]]></description>
        <link>https://medium.com/@nipunkothari04?source=rss-462d887dc3be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VQEtysZK_IyAFh9_</url>
            <title>Stories by Nipun Kothari on Medium</title>
            <link>https://medium.com/@nipunkothari04?source=rss-462d887dc3be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:59:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nipunkothari04/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[How trying to remap a Evince shortcut turned into a Linux rabbit hole]]></title>
            <link>https://medium.com/@nipunkothari04/how-trying-to-remap-a-evince-shortcut-turned-into-a-linux-rabbit-hole-66db7b9835e9?source=rss-462d887dc3be------2</link>
            <guid isPermaLink="false">https://medium.com/p/66db7b9835e9</guid>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[gnome]]></category>
            <category><![CDATA[keyboard-shortcuts]]></category>
            <category><![CDATA[systemd]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Nipun Kothari]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 09:26:27 GMT</pubDate>
            <atom:updated>2026-11-24T09:26:27.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7cyiEHfbpImlCaVg.png" /><figcaption>Highlighting in GNOME Evince Document Viewer</figcaption></figure><p>All I wanted to do was remap a keyboard shortcut in Evince.</p><p>Specifically, I wanted the hkey to activate Evince&#39;s <strong>Highlight Text</strong> tool, which is normally bound to Ctrl+h. The remapping also needed to work only in Evince, without changing what H does in other applications.</p><p>It sounded straightforward. It wasn’t.</p><p>What followed involved Evince’s shortcut handling, xremap, keyd, Linux input-device permissions, Hyprland’s session environment, and systemd user services.</p><p>Here’s how I got it working.</p><h3>1. The problem</h3><p>Evince, GNOME’s Document Viewer, already has a keyboard shortcut for highlighting text:</p><ul><li>Ctrl+h : Highlight Text</li><li>h : Page Up</li></ul><p>I wanted to swap the behavior of h in Evince so that pressing it would activate Highlight Text.</p><p>The important requirement was that this should be application-specific. I didn’t want h to become Ctrl+h everywhere.</p><p>I first looked into Evince’s built-in keyboard shortcut customization. However, its accelerator settings weren’t enough to get the behavior I wanted.</p><p>So I decided to handle the remapping outside Evince.</p><h3>2. Introducing xremap</h3><p>I chose <a href="https://github.com/xremap/xremap">xremap</a>, a keyboard remapping tool that supports application-specific keymaps.</p><p>The initial configuration was simple:</p><pre>keymap:<br>  - remap:<br>      H: C-H</pre><p>This worked, but it remapped h globally.</p><p>To restrict it to Evince, I changed the configuration:</p><pre>keymap:<br>  - application:<br>      only: org.gnome.Evince<br>    remap:<br>      H: C-H</pre><p>The application identifier came from checking Evince’s window class in Hyprland:</p><pre>hyprctl clients</pre><p>The relevant class was:</p><pre>org.gnome.Evince</pre><p>The configuration looked correct, but application-specific matching wasn’t working.</p><h3>3. The first complication: keyd was grabbing the keyboard</h3><p>I was already using <a href="https://github.com/rvaiya/keyd">keyd</a> for keyboard remapping.</p><p>When I tried launching xremap, it couldn’t grab the physical keyboard because keyd had already taken control of it.</p><p>Running xremap normally resulted in an input-device error.</p><p>The solution was to make xremap listen to keyd’s virtual keyboard instead:</p><pre>sudo xremap \<br>  --device &quot;keyd virtual keyboard&quot; \<br>  ~/.config/xremap/config.yml</pre><p>This got the global remapping working.</p><p>However, the application-specific configuration still didn’t work.</p><h3>4. The actual culprit: Hyprland’s session environment</h3><p>This was probably the least obvious part of the entire debugging process.</p><p><strong>xremap</strong> needs to know which application currently has focus to apply application-specific keymaps.</p><p>It supports Hyprland for this, but it also needs access to the relevant session environment.</p><p>My initial attempts didn’t preserve that environment when launching xremap with sudo.</p><p>The important difference was using:</p><pre>sudo -E xremap ...</pre><p>Instead of:</p><pre>sudo xremap ...</pre><p>The -E option tells sudo to preserve the calling user&#39;s environment, subject to sudo&#39;s environment policy.</p><p>I tested it with debug logging:</p><pre>sudo -E env RUST_LOG=debug xremap \<br>  --device &quot;keyd virtual keyboard&quot; \<br>  ~/.config/xremap/config.yml</pre><p>After this change, the application-specific configuration started working.</p><p>The final YAML remained unchanged:</p><pre>keymap:<br>  - application:<br>      only: org.gnome.Evince<br>    remap:<br>      H: C-H</pre><p>That was the breakthrough. The configuration wasn’t the problem; the environment in which xremap was running was.</p><h3>5. Getting rid of sudo</h3><p>Running xremap manually with sudo wasn’t a solution I wanted to keep.</p><p>I wanted it to run as a regular user and start automatically with my graphical session.</p><p>For that, I needed to give my user access to the relevant Linux input devices.</p><p>First, I added my user to the input group:</p><pre>sudo usermod -aG input &quot;$USER&quot;</pre><p>Then I created a udev rule:</p><pre>sudo nano /etc/udev/rules.d/99-uinput.rules</pre><p>With the following content:</p><pre>KERNEL==&quot;uinput&quot;, GROUP=&quot;input&quot;, MODE=&quot;0660&quot;</pre><p>This gives members of the input group read/write access to /dev/uinput.</p><p>After rebooting, I checked the group membership and device permissions:</p><pre>getent group input<br>ls -l /dev/uinput<br>ls -l /dev/input/event18</pre><p>The relevant devices were owned by root:input, with group read/write permissions.</p><p>The event device number can differ between systems, so it’s worth checking your own device list rather than assuming it will always be event18.</p><h3>6. Making it persistent with systemd</h3><p>With the permissions sorted out, I could run xremap without sudo.</p><p>Instead of adding a command to Hyprland’s startup configuration, I used a systemd user service.</p><p>I created:</p><pre>mkdir -p ~/.config/systemd/user<br>nano ~/.config/systemd/user/xremap.service</pre><p>The service file:</p><pre>[Unit]<br>Description=Evince keyboard remapping<br>PartOf=graphical-session.target<br>After=graphical-session.target<br><br>[Service]<br>Type=simple<br>ExecStart=/usr/bin/xremap --device &quot;keyd virtual keyboard&quot; %h/.config/xremap/config.yml<br>Restart=on-failure<br>RestartSec=3<br><br>[Install]<br>WantedBy=graphical-session.target</pre><p>Then I enabled and started it:</p><pre>systemctl --user daemon-reload<br>systemctl --user enable --now xremap.service</pre><p>To check whether it was running:</p><pre>systemctl --user status xremap.service</pre><p>And to inspect its logs:</p><pre>journalctl --user -u xremap.service -f</pre><p>One thing worth checking if application-specific matching fails again is whether the systemd user manager has inherited Hyprland’s session environment:</p><pre>systemctl --user show-environment | grep -E \<br>  &#39;WAYLAND_DISPLAY|HYPRLAND_INSTANCE_SIGNATURE|XDG_RUNTIME_DIR&#39;</pre><p>A manually launched process and a systemd user service don’t necessarily inherit their environment from the same place. If the variables are missing, application detection may need additional session-environment setup.</p><h3>7. The final result</h3><p>The final xremap configuration is just:</p><pre>keymap:<br>  - application:<br>      only: org.gnome.Evince<br>    remap:<br>      H: C-H</pre><p>The remapping is application-specific, uses keyd’s virtual keyboard, and runs through a systemd user service.</p><p>Pressing H in Evince now activates Highlight Text, while H retains its normal behavior in other applications.</p><h3>What I learned</h3><p>A small keyboard remapping problem ended up touching several layers of the Linux desktop:</p><ul><li><strong>Evince:</strong> Its built-in shortcuts weren’t sufficient for my use case.</li><li><strong>xremap:</strong> Application-specific remapping depends on detecting the focused application.</li><li><strong>keyd:</strong> When another remapper owns the physical keyboard, xremap may need to consume its virtual device.</li><li><strong>Linux permissions:</strong> Access to input devices can be configured through groups and udev rules.</li><li><strong>Hyprland:</strong> Application matching depends on the graphical session environment.</li><li><strong>systemd:</strong> A user service is a convenient way to make the configuration persistent.</li></ul><p>The final configuration was only a few lines long. Getting those lines to work reliably was the interesting part.</p><p>Sometimes, changing one keyboard shortcut is all it takes to discover how many layers sit between a keypress and an application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66db7b9835e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Replaced Firefox Taskbar Tabs in My Omarchy Web App Launcher]]></title>
            <link>https://medium.com/@nipunkothari04/why-i-replaced-firefox-taskbar-tabs-in-my-omarchy-web-app-launcher-1d910ece1aa6?source=rss-462d887dc3be------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d910ece1aa6</guid>
            <category><![CDATA[firefox]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[omarchy]]></category>
            <category><![CDATA[firefox-addons]]></category>
            <category><![CDATA[web-apps]]></category>
            <dc:creator><![CDATA[Nipun Kothari]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 14:04:59 GMT</pubDate>
            <atom:updated>2026-10-16T14:04:59.377Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Running Omarchy web apps in Firefox with full URLs, existing logins, and no Chromium.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4o7EGw5wgdU2uZml" /><figcaption>Photo by <a href="https://unsplash.com/@growtika?utm_source=medium&amp;utm_medium=referral">Growtika</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In <a href="https://medium.com/@nipunkothari04/running-omarchy-web-apps-on-firefox-without-installing-chromium-6018d6bbe012">my original article on running Omarchy web apps on Firefox, without installing Chromium</a>, I described a local launcher built around Firefox Taskbar Tabs. This is the follow-up: what broke when I used it with more apps, why I replaced that implementation, and how the new version works.</p><p>The Omarchy manual opened. That was enough to make the first version of my Firefox web-app launcher look promising.</p><p>Then I tried two ntfy topics on the same domain.</p><p>One opened correctly. The other opened the site’s homepage. Along the way, I also ended up with duplicate launcher results and an app that didn’t appear in Omarchy’s removal menu.</p><p>If you’re setting this up today, use the installation instructions in this article. The original post describes the earlier Taskbar Tabs implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zYuog_WpIi2CkFPztPMGmA.png" /><figcaption><em>Omarchy Manual web app in a Firefox popup.</em></figcaption></figure><h3>The URL was the first warning</h3><p>The original problem was straightforward. With Firefox as my default browser and Chromium removed, opening the Omarchy manual produced this error:</p><pre>Path &quot;--app=https:/omarchy.org/manual&quot; does not exist!</pre><p>My first fix used Firefox’s experimental Taskbar Tabs command-line interface. It opened an app-style window, and I could integrate it without modifying /usr/share/omarchy.</p><p>But a web-app shortcut needs to remember more than a domain. These are different destinations:</p><pre>https://ntfy.sh/topic-1<br>https://ntfy.sh/topic-2</pre><p>The topic names here are examples. In my testing, the first registration could open the expected topic while the second opened https://ntfy.sh. My existing Letterboxd web app shortcut also opened the homepage instead of the profile URL I had configured.</p><p>My wrapper looked up Taskbar Tabs registrations by hostname. That couldn’t distinguish two launch targets on the same host. Attempts to correct the saved registrations added another problem: Firefox also held that state in memory while it was running.</p><p>Changing a file on disk wasn’t a reliable way to control what the browser would open next.</p><h3>Two sets of shortcuts made removal confusing</h3><p>There was another mismatch. Omarchy created its desktop shortcut, and Firefox’s Taskbar Tabs mechanism generated another one. Searching for Letterboxd showed two results.</p><p>Omarchy’s removal menu recognized its own web-app launchers. It didn’t necessarily recognize a Firefox-generated registration. That explained how something could appear in application search but be missing from <strong>Remove → Web App</strong>.</p><p>I had started with a launcher and ended up trying to synchronize app IDs, URLs, browser registrations, and desktop files. Each workaround gave the wrapper more browser state to manage.</p><p>This doesn’t establish that Taskbar Tabs is unusable. It showed that my command-line wrapper and registration-file approach didn’t reliably deliver the behavior I wanted.</p><h3>The requirement I kept coming back to</h3><p>I wanted each shortcut to open its complete URL in a window without the browser tabs, address bar, or sidebar. It also needed to use my existing Firefox session, so I wouldn’t have to sign into the same sites again.</p><p>A Firefox extension gave me a direct way to ask the running browser for that window:</p><pre>await browser.windows.create({<br>  url: message.url,<br>  type: &quot;popup&quot;,<br>  incognito: false,<br>});</pre><p>I tested a small popup extension first. In my Firefox setup, it hid the browser controls I wanted hidden, including the sidebar, while keeping the ordinary profile session available.</p><p>That became the foundation of the replacement.</p><h3>Pass the URL to Firefox and let Firefox open it</h3><p>The new setup has three parts: the Omarchy launcher override, a small Python helper, and the <strong>Omarchy Web Apps</strong> extension.</p><p>The extension connects to the helper through Firefox native messaging. When an Omarchy shortcut runs, the launcher sends its full URL to that helper over a private local Unix socket. The helper forwards it to the extension, which opens the popup and reports success or an error.</p><p>There is no hostname lookup or Taskbar Tabs app ID in this path. Paths, query strings, and fragments are passed through to the popup API. A website can still redirect after navigation, but the launcher supplies the URL configured in the shortcut.</p><p>Each launch opens a new window. Those windows use the connected profile’s ordinary, non-private cookie store. Container-specific sessions are not selected.</p><p>Omarchy owns the desktop shortcuts and handles removal. This implementation creates no additional Firefox-generated app shortcuts.</p><h3>The local override stayed</h3><p>The part of the original design I kept was the user-local installation. The launcher lives at ~/.local/bin/omarchy-launch-webapp, with a managed PATH block making it take precedence for Omarchy&#39;s desktop actions.</p><p>The installer also places the native helper and Firefox host manifests in user directories. It reloads Hyprland and checks for configuration errors. When the default browser isn’t Firefox, the wrapper delegates to Omarchy’s original launcher.</p><p>The replacement doesn’t enable Taskbar Tabs, edit Firefox’s profile preferences, or modify its app registration files. No files under /usr/share/omarchy are changed.</p><h3>Install the replacement</h3><p>You need native Firefox as your default browser, Python 3, and Omarchy’s Lua Hyprland configuration. The installer does not support Flatpak or Snap Firefox.</p><p>For a new installation:</p><pre>git clone https://github.com/superb-striker/omarchy-firefox-web-apps.git<br>cd omarchy-firefox-web-apps<br>./install.sh</pre><p>If you already cloned the repository for the earlier version, run git pull inside it and rerun ./install.sh.</p><p>Next, install the signed extension:</p><ol><li>Download the signed .xpi asset from <a href="https://github.com/superb-striker/omarchy-firefox-web-apps/releases/latest">GitHub Releases</a>.</li><li>If you loaded the temporary extension or popup-test prototype, remove it through about:debugging#/runtime/this-firefox.</li><li>Open about:addons, click the gear icon, and select <strong>Install Add-on From File…</strong>.</li><li>Select the downloaded file and approve installation of <strong>Omarchy Web Apps</strong>.</li></ol><p>Install the extension in only the Firefox profile you want to use. The first connected profile owns the bridge. Both the extension and the local helper are required.</p><p>The signed extension stays installed when Firefox restarts. Loading the source through <strong>Load Temporary Add-on</strong> is only a development option; that installation disappears when Firefox fully exits. The installer’s closing message still describes temporary loading, so follow the signed-file steps above for everyday use.</p><p>Now try <strong>Ctrl+Space → Learn → Omarchy</strong>. Use <strong>Install → Web App</strong> for additional shortcuts, giving different apps distinct names. Use <strong>Remove → Web App</strong> to remove them.</p><h3>What upgrading doesn’t clean up</h3><p>The new implementation stops creating extra Firefox shortcuts, but it doesn’t remove the ones left by the old approach. Existing Taskbar Tabs registrations, preferences, and generated shortcuts remain untouched.</p><p>If an old app exists only as a Firefox-generated shortcut, recreate it through Omarchy’s installation menu so Omarchy can manage it. Removing an Omarchy shortcut doesn’t close an already-open window or erase website data.</p><h3>Checking the bridge and keeping it updated</h3><p>To check whether the extension has connected:</p><pre>&quot;${XDG_DATA_HOME:-$HOME/.local/share}/omarchy-firefox-web-apps/bridge.py&quot; --status</pre><p>Fully quit and reopen Firefox, then launch an app from Omarchy. The signed extension should reconnect without being loaded manually. If Firefox isn’t running, the launcher starts it and waits up to 12 seconds for the bridge.</p><p>Extension updates are currently manual. Install a newer signed .xpi through about:addons; for helper updates, pull the repository and rerun the installer. To remove the integration, run ./uninstall.sh and remove the extension from Firefox.</p><h3>A better test than opening the manual</h3><p>Getting the manual to open proved that I could launch a window. Using ntfy topics and a Letterboxd profile exposed the behavior that mattered in daily use: preserving the destination, keeping the existing session, and being able to find and remove the shortcut afterward.</p><p>The popup extension gives Firefox responsibility for opening the window and leaves shortcut management with Omarchy. That division removed the registration workarounds that made the first implementation fragile.</p><p>The <a href="https://medium.com/@nipunkothari04/running-omarchy-web-apps-on-firefox-without-installing-chromium-6018d6bbe012">original article</a> documents where this started. The current code, signed extension, and setup instructions are in <a href="https://github.com/superb-striker/omarchy-firefox-web-apps">my repo on GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d910ece1aa6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Omarchy Web Apps on Firefox, Without Installing Chromium]]></title>
            <link>https://medium.com/@nipunkothari04/running-omarchy-web-apps-on-firefox-without-installing-chromium-6018d6bbe012?source=rss-462d887dc3be------2</link>
            <guid isPermaLink="false">https://medium.com/p/6018d6bbe012</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[firefox]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[hyprland]]></category>
            <category><![CDATA[arch-linux]]></category>
            <dc:creator><![CDATA[Nipun Kothari]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 04:57:06 GMT</pubDate>
            <atom:updated>2026-10-07T04:57:06.896Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A user-local launcher built on Firefox Taskbar Tabs, with no changes to </em><em>/usr/share/omarchy.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dux1MTszZIZZUbjdwp3Q8w.png" /><figcaption>Web App Launcher built through Firefox Taskbar Tabs</figcaption></figure><p>Omarchy’s web apps assume Chromium. Launch one while Firefox is your default browser and Chromium isn’t installed, and you get a desktop error like this:</p><pre>Path &quot;--app=https:/omarchy.org/manual&quot; does not exist!</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*LoN1fDZPJabKLR0JIebXyg.png" /><figcaption>Error notification while launching Omarchy Manual without Chromium browsers</figcaption></figure><p>I hit this when opening the Omarchy manual from the menu. This post covers why it happens, what I built to fix it locally, and where the fix falls short.</p><h3>The failure</h3><p>Omarchy’s omarchy-launch-webapp is built around Chromium&#39;s --app=URL flag, which opens a site in a window with no tab strip or address bar. When Firefox is the default browser, it falls back to a chromium.desktop entry. Without Chromium, that entry doesn&#39;t exist. uwsm-app then receives --app=&lt;url&gt; as its first argument and tries to run it as an executable path, which produces the error above. The upstream tracker has this as <a href="https://github.com/omacom/omarchy/issues/7034">omacom/omarchy#7034</a>.</p><p>Several open pull requests approach it differently. One adds Firefox to the --app path. Others look for another installed Chromium-family browser or fail with a clearer message. Another opens web apps in a normal tab through xdg-open.</p><h3>The mechanism: Firefox Taskbar Tabs</h3><p>Firefox has an experimental feature called <strong>Taskbar Tabs</strong>. It opens a site in its own window with its own application identity and no normal tab strip. On Linux it’s gated behind browser.taskbarTabs.enabled, and it has a command-line handler:</p><pre>firefox -taskbar-tab &lt;id&gt; -new-window &lt;url&gt; -profile &lt;path&gt; -container 0</pre><p>That’s the equivalent of Chromium’s --app. The project&#39;s job is to make Omarchy call it.</p><h3>Design: override, don’t patch</h3><p>I didn’t want to edit anything under /usr/share/omarchy, since package updates would overwrite it. Instead, the installer does four things in user space:</p><ol><li><strong>Installs a replacement launcher</strong> at ~/.local/bin/omarchy-launch-webapp.</li><li><strong>Puts </strong><strong>~/.local/bin first in </strong><strong>PATH</strong> for actions Omarchy dispatches, through an environment.d file and a marked block appended to hyprland.lua.</li><li><strong>Enables the pref</strong> by appending browser.taskbarTabs.enabled to the active profile&#39;s user.js.</li><li><strong>Reloads Hyprland</strong> and checks hyprctl configerrors.</li></ol><p>The PATH step matters because Omarchy invokes the launcher by name. If the system copy wins the lookup, nothing changes. The Hyprland block removes any existing ~/.local/bin entry and re-inserts it at the front:</p><pre>do<br>  local user_bin = (os.getenv(&quot;HOME&quot;) or &quot;&quot;) .. &quot;/.local/bin&quot;<br>  local kept = {}<br>  for entry in (os.getenv(&quot;PATH&quot;) or &quot;/usr/local/bin:/usr/bin&quot;):gmatch(&quot;[^:]+&quot;) do<br>    if entry ~= user_bin then table.insert(kept, entry) end<br>  end<br>  table.insert(kept, 1, user_bin)<br>  hl.env(&quot;PATH&quot;, table.concat(kept, &quot;:&quot;))<br>end</pre><h3>The launcher</h3><p>The launcher has two paths.</p><p><strong>Not Firefox.</strong> It detects the default browser with xdg-settings, falling back to xdg-mime. If it isn&#39;t Firefox, it execs Omarchy&#39;s original launcher unchanged:</p><pre>exec /usr/share/omarchy/bin/omarchy-launch-webapp &quot;$@&quot;</pre><p>Non-Firefox users see no behavior change.</p><p><strong>Firefox.</strong> It does the following:</p><ul><li>Resolves the browser executable from the .desktop file&#39;s Exec= line, checking the user, Nix profile and system application directories.</li><li>Finds the active profile from installs.ini.</li><li>Looks up an existing Taskbar Tab ID by hostname in the profile’s taskbartabs/taskbartabs.json, using jq.</li><li>Calls Firefox through uwsm-app, so the window gets proper session management.</li></ul><p>The ID handling needs a workaround. Firefox assigns the permanent ID when it first registers a site, but the command line requires an ID up front. On first launch, the script derives a valid provisional UUID by hashing the URL:</p><pre>hash=$(printf &#39;%s&#39; &quot;$1&quot; | sha256sum | cut -c1-32)<br>taskbar_id=&quot;${hash:0:8}-${hash:8:4}-${hash:12:4}-${hash:16:4}-${hash:20:12}&quot;</pre><p>Firefox then creates the permanent registration and a firefox.webapp-&lt;id&gt;.desktop entry. On later launches the hostname lookup finds the real ID and passes that instead.</p><h3>Installer hygiene</h3><p>The installer is meant to be safe to run twice and to remove cleanly:</p><ul><li><strong>Marker blocks.</strong> Edits to hyprland.lua and user.js sit between BEGIN/END comments. The installer skips a file that already has the begin marker, and the uninstaller strips only what&#39;s between the markers with awk.</li><li><strong>Backups.</strong> An existing launcher, hyprland.lua and user.js are copied to ~/.local/state/omarchy-firefox-web-apps/backups before modification.</li><li><strong>Launcher provenance.</strong> If a launcher existed before install, its backup path is recorded and restored on uninstall. If there wasn’t one, the installer records that, and the uninstaller deletes the launcher only if it still matches the project’s copy.</li><li><strong>Validation.</strong> After hyprctl reload, any config errors abort the install with a pointer to the backups.</li></ul><p>Firefox needs a restart afterward, because it reads user.js only at startup.</p><h3>If Omarchy fixes this upstream</h3><p>This is a stopgap, and removing it is one command:</p><pre>./uninstall.sh</pre><p>That restores the original launcher, strips the managed blocks and reloads Hyprland. If Omarchy gains native Firefox web-app support, you drop the override and lose nothing.</p><p>The source is at <a href="https://github.com/superb-striker/omarchy-firefox-web-apps">github.com/superb-striker/omarchy-firefox-web-apps</a>, so open an issue there if your Firefox setup breaks it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6018d6bbe012" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Codex Daemon That Remembered a File I Deleted]]></title>
            <link>https://medium.com/@nipunkothari04/the-codex-daemon-that-remembered-a-file-i-deleted-565b19024f48?source=rss-462d887dc3be------2</link>
            <guid isPermaLink="false">https://medium.com/p/565b19024f48</guid>
            <category><![CDATA[openai-codex]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[debugging]]></category>
            <dc:creator><![CDATA[Nipun Kothari]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 20:40:56 GMT</pubDate>
            <atom:updated>2026-10-07T05:14:22.533Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gyPg45IezIRxYotJtYsblQ.png" /></figure><p>Two terminals, same machine, same files, same symlinks. One showed all my Codex tasks. The other showed none. Here’s how a stale daemon that “remembered” a file I’d deleted made my setup look broken when it wasn’t.</p><p>Some context: I was switching between two ChatGPT accounts using one CODEX_HOME per account, rather than a open source switcher tool.</p><h3>Why I didn’t install a switcher</h3><p>~/.codex/auth.json holds credentials that let a client act as my account until they&#39;re revoked. A switcher&#39;s whole job is to read, copy, and rewrite that file. One of these tools documents this plainly: its vault isn&#39;t encrypted, because the credentials inside are bearer credentials, same as Codex&#39;s own file. That&#39;s honest and reasonable, but I hadn&#39;t read any of these tools&#39; source, and I wasn&#39;t going to do a security review to save ten lines of shell.</p><p>(I haven’t audited any of these tools and I’m not claiming they’re unsafe. I just wasn’t willing to bet my credentials on code I hadn’t read.)</p><h3>The setup</h3><pre>mkdir -p ~/.codex-accounts/{account1,account2}<br>CODEX_HOME=~/.codex-accounts/account1 codex login<br>CODEX_HOME=~/.codex-accounts/account2 codex login</pre><pre>alias codex-1=&#39;CODEX_HOME=$HOME/.codex-accounts/account1 codex&#39;<br>alias codex-2=&#39;CODEX_HOME=$HOME/.codex-accounts/account2 codex&#39;</pre><p>Switching worked immediately. But codex-1 and codex-2 showed an empty Agent command center, while plain codex showed all my tasks. Each home has its own state, so the new homes started from nothing.</p><h3>The wrong turns</h3><p>First guess: history lives in sessions/, so symlink it. I did, and the command center stayed empty. The transcripts were shared, but the task index wasn&#39;t.</p><p>The handy ls -la showed state_5.sqlite, thread_history_1.sqlite, queue_1.sqlite and others sitting in ~/.codex, with fresh empty copies in each account home.</p><p>Second guess: delete the empty databases and symlink everything in ~/.codex except auth.json and config.toml. Every link was correct. Still empty.</p><h3>The actual bug</h3><p>Both account homes had app-server-daemon directories, and the timestamps showed they predated my symlinks. I inspected the processes through /proc:</p><pre>for p in $(pgrep -f codex); do<br>  echo &quot;== $p&quot;<br>  tr &#39;\0&#39; &#39;\n&#39; &lt; /proc/$p/environ | grep &#39;^CODEX_HOME=&#39;<br>  ls -l /proc/$p/fd | grep -E &#39;deleted|sqlite&#39;<br>done</pre><p>Two daemons running under the account homes held open handles like this:</p><pre>11 -&gt; .../account1/state_5.sqlite (deleted)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHtylw19jvETW2a9VkjkUg.png" /><figcaption>The terminal output of running /proc</figcaption></figure><p>They were still serving the empty databases I had removed usingrm earlier. The symlinks were right, but a running process keeps its file descriptor to the old inode, and a new file at the same path doesn&#39;t change that. My cleanup step had caused the stale state.</p><p><strong>Here’s the sequence, step by step:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBRpgiDef2rd__M1D1i4TQ.png" /><figcaption>State after each step. The old daemon never sees the symlink.</figcaption></figure><h3>The fix</h3><p>Kill only the daemons whose CODEX_HOME pointed at the account homes, leave the default-home ones alone, and relaunch:</p><pre>kill &lt;pid&gt;<br>codex-1</pre><p>The tasks appeared.</p><h3>What I took away</h3><ul><li><strong>Restart anything holding handles before you replace files under it.</strong> Deleting a file doesn’t change what a running process sees. This applies far beyond Codex.</li><li><strong>/proc/&lt;pid&gt;/fd and </strong><strong>environ answer &quot;what is this process actually using?&quot;</strong> Faster than guessing from config files.</li><li><strong>Correct config plus stale processes looks exactly like broken config.</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=565b19024f48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why My SVG Looked Fine in Chrome but Broke in Neovim]]></title>
            <link>https://medium.com/@nipunkothari04/why-my-svg-looked-fine-in-chrome-but-broke-in-neovim-f378ced86a3f?source=rss-462d887dc3be------2</link>
            <guid isPermaLink="false">https://medium.com/p/f378ced86a3f</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[neovim]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[markdown]]></category>
            <dc:creator><![CDATA[Nipun Kothari]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 18:17:48 GMT</pubDate>
            <atom:updated>2026-09-28T18:17:48.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQel_3KiB25VpdKlZeqnKA.png" /></figure><p>I wanted proper rendered Markdown inside Neovim: LaTeX, badges, images, and eventually SVG diagrams. The setup seemed easy. Kitty supports its graphics protocol, and image.nvim can display images inside the editor.</p><p>Then I tried an SVG. It looked perfect in a browser. In Neovim it was missing, solid black, or wrong.</p><p>After a long detour through ImageMagick, Inkscape, and resvg, I learned the problem wasn’t Neovim. It was the SVG renderer.</p><h3>The setup</h3><ul><li>Arch Linux (btw), Neovim, Kitty</li><li>render-markdown.nvim for rendered Markdown and LaTeX</li><li>image.nvim with ImageMagick for displaying images</li><li>An architecture diagram SVG with light and dark themes</li></ul><p>The Markdown side was the easy part. The SVG was the problem, because it wasn’t a plain collection of paths with hardcoded colors. It used browser-style CSS:</p><pre>:root {<br>  --bg: #ffffff;<br>  --blue-fill: #0c447c;<br>}<br>@media (prefers-color-scheme: dark) {<br>  :root {<br>    --bg: #0b0b0c;<br>    --blue-fill: #042c53;<br>  }<br>}</pre><p>Its elements referenced those variables, for example &lt;rect fill=&quot;var(--bg)&quot; /&gt;. That detail caused everything that followed.</p><h3>Three renderers that failed</h3><p><strong>ImageMagick.</strong> It had librsvg support and produced a PNG without complaint, but the PNG was essentially a black rectangle.</p><p><strong>Inkscape.</strong> It had a similar result and printed warnings like Ignoring CSS variable: --bg.</p><p><strong>resvg.</strong> This one made the cause obvious:</p><pre>&#39;:root&#39; is not supported. Selector skipped.<br>The @media rule is not supported. Skipped.<br>Failed to parse fill value: &#39;var(--bg)&#39;. Fallback to black.</pre><p>There was my black rectangle. resvg targets a static SVG subset, not the full browser CSS model. My SVG wasn’t just SVG. It was SVG plus browser CSS.</p><h3>The fix I didn’t want</h3><p>I could have preprocessed the file, replacing every var(--bg) with a hardcoded color. But a regex doesn&#39;t understand scope, cascade, or media queries. It might work for this one diagram and silently break the next. I wanted something that renders SVGs, not something that patches one.</p><h3>Let a browser render it</h3><p>The SVG already worked in Chrome, and I was overlooking that. Chrome understands CSS custom properties, var(), @media, prefers-color-scheme, and font fallbacks. So instead of teaching a limited renderer to act like a browser, I finally used the browser:</p><pre>SVG ─► headless Chrome ─► PNG ─► Kitty ─► Neovim</pre><pre>google-chrome-stable \<br>  --headless --disable-gpu \<br>  --screenshot=/tmp/architecture.png \<br>  --window-size=680,1045 \<br>  file:///path/to/architecture.svg</pre><p>The diagram rendered correctly, but in light mode. Headless Chrome defaults to a light color scheme, so I added --force-dark-mode and got the dark theme, with the SVG left untouched.</p><h3>Making it reusable</h3><p>I wrapped this in a small script, ~/.local/bin/svg2png. My first version used a fixed window size, which left huge white margins around the diagram. Chrome was doing exactly what I asked. The fix was to read the SVG&#39;s real dimensions first:</p><pre>#!/bin/sh<br>input=&quot;$(realpath &quot;$1&quot;)&quot;<br>output=&quot;$2&quot;<br><br>if [ -z &quot;$input&quot; ] || [ -z &quot;$output&quot; ]; then<br>  echo &quot;usage: svg2png &lt;input.svg&gt; &lt;output.png&gt;&quot; &gt;&amp;2<br>  exit 1<br>fi<br><br>dimensions=$(magick identify -format &#39;%w %h&#39; &quot;$input&quot;) || exit 1<br>width=${dimensions% *}<br>height=${dimensions#* }<br><br>google-chrome-stable \<br>  --headless --disable-gpu \<br>  --force-dark-mode --hide-scrollbars \<br>  --screenshot=&quot;$output&quot; \<br>  --window-size=&quot;${width},${height}&quot; \<br>  &quot;file://$input&quot; &gt;/dev/null 2&gt;&amp;1</pre><p>Finally, svg2png architecture.svg /tmp/test.png followed by kitten icat /tmp/test.png matches what Chrome shows.</p><h3>Where Neovim fits</h3><p>image.nvim handles the display half, and its Markdown integration has a resolve_image_path callback for customizing how image paths are resolved. That lets the pipeline branch by file type:</p><pre>Markdown image path<br>   ├── PNG / JPEG / WebP ─────────────► image.nvim ─► Kitty<br>   └── SVG ─► svg2png ─► headless Chrome ─► PNG ─► image.nvim ─► Kitty</pre><p>Raster formats don’t need a browser, so Chrome stays isolated to the one format that does. The SVG remains the source of truth, and Neovim just gets a browser-rendered PNG when it needs one.</p><h3>What I learned</h3><p>“SVG support” doesn’t mean the same thing everywhere. Modern SVGs can depend on CSS, custom properties, media queries, fonts, and browser behavior. A dedicated renderer that skips those isn’t broken, it just supports a different subset.</p><p>When a file depends on browser CSS, sometimes the most reliable renderer is a browser. Headless Chrome turned out to be a surprisingly good bridge between browser-native SVGs and terminal-native image display.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f378ced86a3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>