<?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>Linux on Haseeb Majid</title>
    <link>https://haseebmajid.dev/tags/linux/</link>
    <description>Recent content in Linux on Haseeb Majid</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sat, 15 Jun 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://haseebmajid.dev/tags/linux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>TIL: How to Fix Did No Resolve Alias Errors in Podman</title>
      <link>https://haseebmajid.dev/posts/2024-06-15-til-how-to-fix-did-no-resolve-alias-errors-in-podman/</link>
      <pubDate>Sat, 15 Jun 2024 00:00:00 +0000</pubDate>
      <author>Me</author>
      <guid>https://haseebmajid.dev/posts/2024-06-15-til-how-to-fix-did-no-resolve-alias-errors-in-podman/</guid>
      <description>&lt;p&gt;&lt;strong&gt;TIL: How to Fix Did No Resolve Alias Errors in Podman&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Recently, I was trying to pull docker images using &lt;code&gt;podman&lt;/code&gt;, on an Ubuntu laptop and was getting an error which
looked something like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Error: error creating build container: short-name &lt;span class=&#34;s2&#34;&gt;&amp;#34;node:18.17&amp;#34;&lt;/span&gt; did not resolve to an &lt;span class=&#34;nb&#34;&gt;alias&lt;/span&gt; and no unqualified-search registries are defined in &lt;span class=&#34;s2&#34;&gt;&amp;#34;/etc/containers/registries.conf&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is because Podman doesn&amp;rsquo;t allow us to use short names, by default we need to specify the registry i.e. &lt;code&gt;docker.io/node:18.17&lt;/code&gt;.
But for existing &lt;code&gt;docker-compose.yml&lt;/code&gt; files, this would be a pain to edit. Especially because most people use Docker
not Podman. So, in the end, you can edit a config file in home directory to enable the old way of pulling images.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><strong>TIL: How to Fix Did No Resolve Alias Errors in Podman</strong></p>
<p>Recently, I was trying to pull docker images using <code>podman</code>, on an Ubuntu laptop and was getting an error which
looked something like:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">Error: error creating build container: short-name <span class="s2">&#34;node:18.17&#34;</span> did not resolve to an <span class="nb">alias</span> and no unqualified-search registries are defined in <span class="s2">&#34;/etc/containers/registries.conf&#34;</span>
</span></span></code></pre></div><p>This is because Podman doesn&rsquo;t allow us to use short names, by default we need to specify the registry i.e. <code>docker.io/node:18.17</code>.
But for existing <code>docker-compose.yml</code> files, this would be a pain to edit. Especially because most people use Docker
not Podman. So, in the end, you can edit a config file in home directory to enable the old way of pulling images.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">nvim ~/.config/containers/registries.conf
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Add the following</span>
</span></span><span class="line"><span class="cl">unqualified-search-registries<span class="o">=[</span><span class="s2">&#34;docker.io&#34;</span><span class="o">]</span>
</span></span></code></pre></div><p>You could also do it machine wide by editing the file <code>/etc/containers/registries.conf</code>.</p>
<p>That&rsquo;s it! Real short one today! This just stumped me today for like 20 minutes.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>TIL: How to Set Network Manager Priority to Use Wired Connection Over WIFI</title>
      <link>https://haseebmajid.dev/posts/2023-11-10-how-to-set-network-manager-priority-to-use-wired-connection-over-wifi/</link>
      <pubDate>Fri, 10 Nov 2023 00:00:00 +0000</pubDate>
      <author>Me</author>
      <guid>https://haseebmajid.dev/posts/2023-11-10-how-to-set-network-manager-priority-to-use-wired-connection-over-wifi/</guid>
      <description>&lt;p&gt;&lt;strong&gt;TIL: How to Set Network Manager Priority to Use Wired Connection Over Wi-Fi&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you use network manager on Linux and have both Wi-Fi and wired connection. You may want to prefer using
a wired connection over Wi-Fi, due to stability. To do open the &lt;code&gt;nm-connection-editor&lt;/code&gt;, if you are using Nix, you can
download it from nixpkgs like usual.&lt;/p&gt;
&lt;p&gt;&lt;img
        loading=&#34;lazy&#34;
        src=&#34;../../posts/2023-11-10-how-to-set-network-manager-priority-to-use-wired-connection-over-wifi/images/priority.png&#34;
        type=&#34;&#34;
        alt=&#34;Network Manager Priority&#34;
        
      /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Higher number means higher priority.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So for our wired connection I set the priority to &lt;code&gt;100&lt;/code&gt; (it was previously -1) and then for our Wi-Fi connection
I set the priority to &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><strong>TIL: How to Set Network Manager Priority to Use Wired Connection Over Wi-Fi</strong></p>
<p>If you use network manager on Linux and have both Wi-Fi and wired connection. You may want to prefer using
a wired connection over Wi-Fi, due to stability. To do open the <code>nm-connection-editor</code>, if you are using Nix, you can
download it from nixpkgs like usual.</p>
<p><img
        loading="lazy"
        src="/posts/2023-11-10-how-to-set-network-manager-priority-to-use-wired-connection-over-wifi/images/priority.png"
        type=""
        alt="Network Manager Priority"
        
      /></p>
<blockquote>
<p>Higher number means higher priority.</p>
</blockquote>
<p>So for our wired connection I set the priority to <code>100</code> (it was previously -1) and then for our Wi-Fi connection
I set the priority to <code>1</code>.</p>
<p>That&rsquo;s it! We should now see network manager prefer to use Ethernet over Wi-Fi.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Why I moved to NixOS</title>
      <link>https://haseebmajid.dev/posts/2023-06-25-why-i-moved-to-nixos/</link>
      <pubDate>Sun, 25 Jun 2023 00:00:00 +0000</pubDate>
      <author>Me</author>
      <guid>https://haseebmajid.dev/posts/2023-06-25-why-i-moved-to-nixos/</guid>
      <description>&lt;p&gt;Recently I decided to move from Arch Linux to NixOS. Rather than doing what I should&amp;rsquo;ve done which was
try to use NixOS in a VM first and learn Nix properly. I decided to jump into the deep end and completely delete my
current Arch Linux build with Nix. This included replacing my dotfiles setup using DotBot moving them to Nix flakes and
home-manager (more on this in a bit). In this post, I&amp;rsquo;ll go over why I moved over to NixOS, and why I am staying put for now.
What I like about it and some difficulties I have had.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Recently I decided to move from Arch Linux to NixOS. Rather than doing what I should&rsquo;ve done which was
try to use NixOS in a VM first and learn Nix properly. I decided to jump into the deep end and completely delete my
current Arch Linux build with Nix. This included replacing my dotfiles setup using DotBot moving them to Nix flakes and
home-manager (more on this in a bit). In this post, I&rsquo;ll go over why I moved over to NixOS, and why I am staying put for now.
What I like about it and some difficulties I have had.</p>
<p>Also, NixOS is the new Arch meme.</p>
<p><img
        loading="lazy"
        src="/posts/2023-06-25-why-i-moved-to-nixos/images/arch-vs-nixos.webp"
        type=""
        alt="Arch vs NixOS"
        
      /></p>
<details
  class="notice warning"
  open="true"
>
    <summary class="notice-title">New to NixOS</summary>
  
  I&rsquo;m pretty new to NixOS so there is a chance something I have said isn&rsquo;t quite correct.
Please let me know via Gitlab Issue (click on the edit button).
</details>

<h2 id="background">Background</h2>
<p>I first heard about NixOS last year at EuroPython 2022, when I went to a round table discussion around tooling. This was
mostly focused on CLI tools that people used. But someone mentioned they used NixOS and you could have your entire machines config
in a single repository. I was intrigued. I personally love reproducibility, and I have enjoyed using Docker for that very reason.
Though I have since learnt Docker is repeatable but Nix with Flakes is far more reproducible. Anyways tangent aside, I want and explored
but I just couldn&rsquo;t be bothered to swap. So I stuck with Arch Linux the main reason being it seemed like Arch with its AUR (arch user repository)
had far more packages.</p>
<p>Then recently I have been looking to improve my developer workflow, I have moved mostly to neovim with tmux (see previous posts in the series).
I was using pop shell as a &ldquo;pseudo&rdquo; tiling manager, and it was fine, to begin with. Then I started to explore more and came across Hyprland,
a Wayland compositor. Which looked quite powerful, and more flexible than what I had. For example, I had it set up so that workspaces could only
change my primary display. AFAIK on Gnome you couldn&rsquo;t have workspaces per monitor, changing workspace would change it on both monitors.</p>
<p>However, with Hyprland (and many other such window managers etc) you can set a workspace per monitor. I had tried to use qtile before but soon
found myself not wanting to configure everything. But I am much more experienced with Linux and said why not.
So essentially my initial reasons for moving were I wanted to have my machine configured via a single git repo and have it reproducible and also
try a new window manager, so I thought let us do both at once :laugh:</p>
<p>Around this time to make it even more interesting I decided to try and see if I could live just working on my Framework laptop which I barely used since
I bought it. In theory, moving back to my desktop should be a lot easier if I use NixOS.</p>
<h2 id="nix-vs-nixos">Nix vs NixOS</h2>
<p>The language can be a bit confusing so let&rsquo;s define what we mean: <sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<ul>
<li>nix: The package manager, think like apt or Pacman</li>
<li>nixlang: The nix programming language, a functional language</li>
<li>nixos: An operating system built around nix package manager</li>
<li>machine/system/laptop/desktop: I use these words interchangeably, for NixOS I&rsquo;ve only set it up on my Laptop</li>
</ul>
<p>You can run Nix in any Linux distribution (and even macOS), so what I probably should have done is started using the Nix package manager first.
Then tried NixOS in a virtual machine (on my Arch machine). Then after I was comfortable with nix and nixlang, assuming I liked it, move properly
NixOS on my system.</p>
<h2 id="moving-to-nixos">Moving to NixOS</h2>
<p><img
        loading="lazy"
        src="/posts/2023-06-25-why-i-moved-to-nixos/images/we-not-the-same.webp"
        type=""
        alt="NixOS Immutable"
        
      /></p>
<p>So I moved to NixOS using their graphical installer, which was very easy to use and set up. Even setting up hibernate with ease, which I remember being
a pain on Arch Linux (mainly due to my lack of understanding but none the less nixos made it pretty easy).</p>
<p>Now Arch Linux is a rolling release distribution which means rather than getting &ldquo;big&rdquo; updates every 6 months with say POP!_OS (my previous distro).
You receive updates far more frequently, so you have a more up-to-date system. The down-side things can break, my most recent issue being
Plymouth breaking and me not being able to type in my password to decrypt my LUKs disk, so not being able to boot.
I then need to use a live USB to remove the Plymouth config from my grub setup.</p>
<p>So one of the features that convinced me to move to nixos was the ability to roll back to previous generations.
So if I install or update a package and it breaks my system I can roll back to the previous generation.
So the way my Arch system broke would not happen in NixOS alongside this and the ability to define the state of my system
in &ldquo;code&rdquo; was enough to convince me.</p>
<p><img
        loading="lazy"
        src="/posts/2023-06-25-why-i-moved-to-nixos/images/generations.png"
        type=""
        alt="NixOS Generations"
        
      /></p>
<p>Another feature I liked was able to define my system state in code (nixlang). The idea being I could setup
on a new machine a lot quicker than I could with another Distro.</p>
<p>My dotfiles setup at the time used dotbot which did help me get set up faster but still involved lots of manual steps.
I thought about using Ansible to help configure my setup, but in the end, never got around to doing it.
So having the ability to define my system state in nixlang was a nice feature to have.</p>
<p>The final feature that I liked was the ability of atomic updates. So nix never overwrites packages it simply adds them to a new path
(in the /nix/store directory). It means we can maintain multiple versions of the same library (think like in Golang). It also means
there is no team where we have some of the old files and new ones. So if your upgrade fails in the middle, we can simply revert to the older version. <sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<h3 id="summary">Summary</h3>
<ul>
<li>Define system state in Nixlang</li>
<li>Roll back to previous generations</li>
<li>Atomic updates</li>
</ul>
<h2 id="learnings">Learnings</h2>
<p>In this section, I will go over a few of my learnings, since picking up NixOS a month ago. It is not a beginner-friendly distribution.
If you are new to Linux I recommend trying a distribution like POP!_OS first then after you are more comfortable with Linux you can try
nix as a package manager and after that move to NixOS. I will go over more why later in this post.</p>
<p>There was a bunch of confusion about how to set up my repository to configure my system. What I ended up with was the following <sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup></p>
<ul>
<li>Use Nix Flakes <sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup></li>
<li>Improves reproducibility</li>
<li>Use home-manager to configure dotfiles</li>
<li>Use NixOS configuration for the rest of the system
<ul>
<li>Such as bootloader</li>
<li>Luks encryption</li>
</ul>
</li>
<li>Allow multiple different host machines (laptop, desktop, etc)
<ul>
<li>Share common config</li>
</ul>
</li>
<li>Separate home-manager config
<ul>
<li>So can use machines that won&rsquo;t run NixOS (like work laptop)</li>
</ul>
</li>
</ul>
<h3 id="imperative-vs-declarative">Imperative vs Declarative</h3>
<p>I wanted my config to be declarative, which means I tell NixOS I want x,y,z i.e. Grub, Mullvad VPN and then NixOS works out how to get the system into the correct state.
Nix/NixOS have some imperative operations <sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup> like using <code>nix-env</code> is which more similar to other package managers to install packages. But I avoid using those.
Except <code>nix-shell -p &lt;pkg&gt;</code>, which creates a shell with the package installed temporarily which is great for quickly trying out the package without committing to an install.
Essentially I want to define my system state in code, so it can be reproduced on other machines.</p>
<h3 id="nix-flakes">Nix Flakes</h3>
<p>Again I&rsquo;m pretty new to Nix but I think from what I&rsquo;ve seen Nix flakes are the recommended way to use Nix.
Flakes essentially provide us with a lot more reproducibility. They are self-contained units which have inputs and outputs.
A flake needs a <code>flake.nix</code> file, which contains inputs and outputs.
The inputs can be other flakes (like home-manager), and these get locked to specific versions in a <code>flake.lock</code> file.</p>
<p>Where out flake file may look like this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-nix" data-lang="nix"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="n">description</span> <span class="o">=</span> <span class="s2">&#34;My NixOS Config&#34;</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">  <span class="n">inputs</span> <span class="o">=</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="n">nixpkgs</span><span class="o">.</span><span class="n">url</span> <span class="o">=</span> <span class="s2">&#34;github:nixos/nixpkgs/nixos-unstable&#34;</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">    <span class="n">home-manager</span><span class="o">.</span><span class="n">url</span> <span class="o">=</span> <span class="s2">&#34;github:nix-community/home-manager&#34;</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">  <span class="p">};</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">  <span class="n">outputs</span> <span class="o">=</span> <span class="p">{</span> <span class="n">self</span><span class="o">,</span> <span class="n">nixpkgs</span><span class="o">,</span> <span class="n">home-manager</span><span class="o">,</span> <span class="n">nur</span><span class="o">,</span> <span class="o">...</span> <span class="p">}</span><span class="o">@</span><span class="n">inputs</span><span class="p">:</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>They also help with structuring nix repositories acting as a &ldquo;main&rdquo; function [4]. When I start doing programming projects
I will likely look into using flakes for even better reproducibility as compared with Docker.</p>
<h3 id="home-manager">Home Manager</h3>
<p>Home Manager makes it easier to manage the user environment using the Nix package manager (again declaratively). Anything related to the user
is managed here. Things like dotfiles, which applications to install and which config such as alacritty as my terminal.</p>
<p>In theory, my config is set up to support multiple users but at the moment there is only one user <code>haseeb</code>.
One nice feature I didn&rsquo;t consider was how it would be to swap back to Gnome from Hyprland. This makes it much easier to experiment
and try out new window managers or desktop environments. My current config has both my gnome config and hyprland config and with a few lines
I should be able to back to Gnome, if I want (and vice versa).</p>
<p>As you can probably imagine most of my config is here, as most changes happen in userland. I can run this separately to NixOS because
I will have machines where I cannot use NixOS, like my work laptop but can use the nix package manager.</p>
<p>command: <code>home-manager switch --flake ~/dotfiles#haseeb@framework</code></p>
<h3 id="nixos-configuration">NixOS Configuration</h3>
<p>This is like home manager except for system-wide changes, split up via device (currently only my framework laptop).
Things like the bootloader, and fingerprint reader. I only put config here if it needs to be system-wide.</p>
<p>This also builds the home manager config</p>
<p><a href="https://gitlab.com/hmajid2301/dotfiles/-/blob/6f2bac80e57999c793eb8ae48ca1dfc8dafa8f9e/hosts/framework/default.nix">Click here for an example</a>.
The common config can be shared</p>
<p>command: <code>sudo nixos-rebuild switch --flake ~/dotfiles#framework</code></p>
<h3 id="issues">Issues</h3>
<p>Some issues I encountered whilst moving to NixOS. Lots of docs still refer to nix-env and nix-channel as a way to install packages.
But from what I&rsquo;ve read and my personal preference it seems the preferred way is the declarative way I described above.
However, when you first get started this is not always clear</p>
<p>Docs are a bit messy in my opinion, I often find myself reading multiple different blog posts to understand what to do.
Or looking through <a href="https://sourcegraph.com">sourcegraph</a> for code examples and working it out that way.
As I said you will still see references to the imperative way to use nix.</p>
<p>I also think the error messages that home-manager and NixOS configuration can throw, can at times be a bit obtuse and hard to
understand (at least for me).</p>
<p>Overall these are just small issues, which I hope will get better over time. Nix/NixOS can be infuriating at times, when you know
on another distribution/package manager would be much quicker. However knowing that my builds are more reproducible is worth it!</p>
<p>That&rsquo;s it! Some reasons why I&rsquo;ve moved to NixOS and why I will be staying for now. In a future article, I will break down my own
NixOS configuration.</p>
<h2 id="appendix">Appendix</h2>
<ul>
<li><a href="https://gitlab.com/hmajid2301/dotfiles/-/tree/6f2bac80e57999c793eb8ae48ca1dfc8dafa8f9e">Nix Config</a></li>
<li><a href="https://thiscute.world/en/posts/nixos-and-flake-basics/#iii-nix-flakes-and-the-old-nix">NixOS Basic, a great read imo!</a></li>
</ul>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://news.ycombinator.com/item?id=23251895">https://news.ycombinator.com/item?id=23251895</a>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://nixos.org/guides/how-nix-works.html">https://nixos.org/guides/how-nix-works.html</a>&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>Heavily inspired by this repo: <a href="https://github.com/Misterio77/nix-config">https://github.com/Misterio77/nix-config</a>&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p><a href="https://www.tweag.io/blog/2020-05-25-flakes/">https://www.tweag.io/blog/2020-05-25-flakes/</a>&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:5">
<p><a href="https://nixos.wiki/wiki/Overview_of_the_NixOS_Linux_distribution">https://nixos.wiki/wiki/Overview_of_the_NixOS_Linux_distribution</a>&#160;<a href="#fnref:5" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded>
    </item>
    
    <item>
      <title>My Development Workflow With Linux</title>
      <link>https://haseebmajid.dev/posts/2023-05-08-my-development-workflow-with-linux/</link>
      <pubDate>Mon, 08 May 2023 00:00:00 +0000</pubDate>
      <author>Me</author>
      <guid>https://haseebmajid.dev/posts/2023-05-08-my-development-workflow-with-linux/</guid>
      <description>&lt;p&gt;Following on from my previous post about dotfiles and my development workflow (WIP), in this post I will go over my
operating system.&lt;/p&gt;
&lt;p&gt;&lt;img
        loading=&#34;lazy&#34;
        src=&#34;../../posts/2023-05-08-my-development-workflow-with-linux/images/dev.png&#34;
        type=&#34;&#34;
        alt=&#34;Development Window&#34;
        
      /&gt;
&lt;img
        loading=&#34;lazy&#34;
        src=&#34;../../posts/2023-05-08-my-development-workflow-with-linux/images/fun.png&#34;
        type=&#34;&#34;
        alt=&#34;Fun Window&#34;
        
      /&gt;&lt;/p&gt;
&lt;h2 id=&#34;arch&#34;&gt;Arch&lt;/h2&gt;
&lt;p&gt;As the name implies I use Linux as my main operating system. I am a big fan of Linux because not only is free and
open-source, it provides a great developer experience where I find tools that just work on Linux. It also is a lot more
customisable as compared with Windows or MacOS. Finally, I tend to find it more lightweight as well and takes fewer
resources to run especially if you are using Docker.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Following on from my previous post about dotfiles and my development workflow (WIP), in this post I will go over my
operating system.</p>
<p><img
        loading="lazy"
        src="/posts/2023-05-08-my-development-workflow-with-linux/images/dev.png"
        type=""
        alt="Development Window"
        
      />
<img
        loading="lazy"
        src="/posts/2023-05-08-my-development-workflow-with-linux/images/fun.png"
        type=""
        alt="Fun Window"
        
      /></p>
<h2 id="arch">Arch</h2>
<p>As the name implies I use Linux as my main operating system. I am a big fan of Linux because not only is free and
open-source, it provides a great developer experience where I find tools that just work on Linux. It also is a lot more
customisable as compared with Windows or MacOS. Finally, I tend to find it more lightweight as well and takes fewer
resources to run especially if you are using Docker.</p>
<p><a href="https://github.com/overmighty/i-use-arch-btw"><em>Insert meme about how I use arch btw</em></a>.
More seriously the main reason I use Arch is because of access to the [Aur]((<a href="https://aur.archlinux.org/)">https://aur.archlinux.org/)</a>, the Arch user
repository.</p>
<p>The AUR provides an easy way for us to install any package using a package manager like <code>yay</code> or <code>pamac</code>.
It is similar to <code>brew</code> that people use on MacOS. If I want to install a package I can usually do something like</p>
<p><code>yay -S &lt;package&gt;</code> some of the recent things I have installed can be seen below</p>
<p><img
        loading="lazy"
        src="/posts/2023-05-08-my-development-workflow-with-linux/images/aur.png"
        type=""
        alt="AUR Installs"
        
      /></p>
<p>So if I didn&rsquo;t use the AUR I would&rsquo;ve had to say git clone the project and then run a command. It also then means updating
is a pain as I need to do it manually by remembering to do it. Rather than leaving it to a package manager to tell us
when to update.</p>
<h2 id="gnome">Gnome</h2>
<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden">
  <iframe src="https://yewtu.be/embed/AVv4q84FGpw"
    style="position:absolute;top:0;left:0;width:100%;height:100%;border:0" allowfullscreen></iframe>
</div>

<p><a href="https://gitlab.com/hmajid2301/dotfiles/-/blob/8da9d515234d050dc34703e94f647fd9cb40c61a/linux/gnome/settings.ini">Link to config</a></p>
<p>I use gnome as my desktop environment (with Wayland), I tried using Qtile and AwesomeWM but found I didn&rsquo;t enjoy tinkering
with things at that low of a level and prefer just having a lot of the basics set up for me. For example, even something as
simple as the volume indicator I could never style it to how I wanted it to look. So I eventually came back to Gnome
and I have been able to customise it enough to my liking.</p>
<h3 id="shortcuts">Shortcuts</h3>
<p>Some shortcuts I use:</p>
<ul>
<li><code>super + t</code>: Opens an alacritty terminal</li>
<li><code>super + a</code>: Opens search light for opening apps similar to spotlight search in MacOS</li>
</ul>
<h3 id="extensions">Extensions</h3>
<p>The main way I customise gnome is by using extensions</p>
<p><a href="https://github.com/pop-os/shell">Pop Shell</a> is used for tiling I tried a tiling window manager in the past and to be honest
this extension is good enough for me whilst not being as powerful as say Qtile or AwesomeWM. For my use case, it is
absolutely fine.</p>
<p>I can navigate windows just using my keyboard <code>super + h j k l</code> to move between windows similar to how we would in vim.
It also has some shortcuts to maximise a window so it can ignore the tiling when needed. But again the main thing is
I don&rsquo;t need to use my mouse I can use my keyboard.</p>
<p><a href="https://extensions.gnome.org/extension/5338/aylurs-widgets/">Aylurs Widgets</a> You can think of this as a collection of
extensions which provides features such as making the top bar look nicer and the drop-down settings menu.</p>
<p><a href="https://extensions.gnome.org/extension/615/appindicator-support/">AppIndicator</a> shows app indicators in the top bar
for different applications like Discord or mullvad vpn.</p>
<p><a href="https://extensions.gnome.org/extension/1010/archlinux-updates-indicator/">Updates Indicator</a> lets me know via an app
indicator that updates are available then when we click the button it will open a terminal and run <code>yay</code> to update.</p>
<p><a href="https://extensions.gnome.org/extension/5090/space-bar/">Space Bar</a>: I replace Aylurs workspace with this extension.
It is a bit more powerful and I think it looks better.</p>
<p><a href="https://extensions.gnome.org/extension/5489/search-light/">Search Light</a>: Like spotlight search for MacOS.</p>
<p>Some other extensions I use include:</p>
<ul>
<li><a href="https://extensions.gnome.org/extension/5237/rounded-window-corners/">Rounded Window Corners</a>: Purely for
aethestic purposes</li>
<li><a href="https://extensions.gnome.org/extension/5279/pano/">Pano</a>: A better clipboard manager</li>
<li><a href="https://extensions.gnome.org/extension/3843/just-perfection/">Just Perfection</a>: Allows you to tweak almost everything in gnome</li>
<li><a href="https://extensions.gnome.org/extension/3193/blur-my-shell/">Blur my Shell</a>: Blur shell when viewing context menu</li>
<li><a href="https://extensions.gnome.org/extension/4451/logo-menu/">Logo Menu</a>: Adds a logo to top bar, similar to MacOS.</li>
</ul>
<h2 id="cli-tools">CLI Tools</h2>
<p>I have added all of the <a href="https://github.com/ibraheemdev/modern-unix">modern unix cli tools</a>.
Some CLI tools I use daily include:</p>
<ul>
<li><a href="https://github.com/junegunn/fzf">fzf</a>: Fuzzy search tool, especially for reverse search in my terminal with <a href="https://github.com/PatrickF1/fzf.fish">fish shell</a></li>
<li><a href="https://github.com/ajeetdsouza/zoxide">zoxide</a>: Smarter cd tool, integrated well with fzf, nvim and tmux</li>
<li><a href="https://github.com/ogham/exa">exa</a>: A replacement for <code>ls</code> with better syntax highlighting</li>
<li><a href="https://github.com/BurntSushi/ripgrep">ripgrep</a>: A faster <code>grep</code></li>
<li><a href="https://github.com/denisidoro/navi">navi</a>: Interactive cheat sheet</li>
<li><a href="https://restic.net/">restic</a>: Backup tool used to backup my home directory to the cloud (off-site).</li>
</ul>
<h2 id="misc">Misc</h2>
<p>Some other &ldquo;fun&rdquo; things I have set up in Linux.</p>
<h3 id="wallpaper">Wallpaper</h3>
<p>I found some nice <a href="https://old.reddit.com/r/wallpapers/comments/3ueq55/lakeside_day_night_transition_credit_louis_coyle/">wallpaper</a>
which can change throughout the day depending on the sun. I use this with a script called <a href="https://github.com/hexive/sunpaper">sunpaper</a>.
This script lets us change the wallpaper depending on the time of day and the very cool it does is it uses the sun.
So it changes depending on where the sun is. For example, 15 minutes before the sunset it will change the wallpaper
and then after the sunset it will change it to another wallpaper you just need to set up a directory will wallpapers
named <code>1.jpg</code>, <code>2.jpg</code> &hellip;</p>
<p><img
        loading="lazy"
        src="/posts/2023-05-08-my-development-workflow-with-linux/images/wallpaper.gif"
        type=""
        alt="Wallpaper"
        
      /></p>
<p>Where my directory looks like (ignore the png files you don&rsquo;t need those):</p>
<p><img
        loading="lazy"
        src="/posts/2023-05-08-my-development-workflow-with-linux/images/wallpaper-directory.png"
        type=""
        alt="Wallpaper Directory"
        
      /></p>
<p>You can find my copy of the <a href="https://gitlab.com/hmajid2301/dotfiles/-/tree/8da9d515234d050dc34703e94f647fd9cb40c61a/wallpaper">script here</a>.</p>
<p>That&rsquo;s it! That&rsquo;s a quick blog post on my current Linux set-up.</p>
<h2 id="appendix">Appendix</h2>
<ul>
<li><a href="https://gitlab.com/hmajid2301/dotfiles">My Dotfiles</a></li>
</ul>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
