<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://joelchrono.xyz/feeds/dotfiles.xml" rel="self" type="application/atom+xml" /><link href="https://joelchrono.xyz/" rel="alternate" type="text/html" /><updated>2026-07-11T12:34:20-06:00</updated><id>https://joelchrono.xyz/feeds/dotfiles.xml</id><title type="html">joelchrono’s blog</title><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><entry><title type="html">Back to dwm</title><link href="https://joelchrono.xyz/blog/back-to-dwm/" rel="alternate" type="text/html" title="Back to dwm" /><published>2023-01-13T08:48:38-06:00</published><updated>2023-01-13T08:48:38-06:00</updated><id>https://joelchrono.xyz/blog/back-to-dwm</id><content type="html" xml:base="https://joelchrono.xyz/blog/back-to-dwm/"><![CDATA[<p>Pretty much a year ago, I switched to dwm and made a post about <a href="https://joelchrono.xyz/blog/ricing-dwm-2022/">my configuration for it</a>. The reason for doing so, as I explained, was that spectrwm wasn’t on its latest version and I couldn’t use some features I liked, because of Linux Mint.</p>

<p>Now I am on Void Linux though, and even if I have access to the latest and greatest software. I decided to return for dwm for a while. Maybe permanently?</p>

<p>I managed to patch everything I ever wanted. Even if I had to do quite a bit of manual work. What I did was use <a href="https://youtu.be/UEmPboaTDpQ">the patching guide by uoou</a>, which used git branches for every patch you apply, and, in my case as suggested <a href="https://www.youtube.com/watch?v=UEmPboaTDpQ&amp;lc=Ugw_pRQitdmlgNpMcbx4AaABAg">by a comment</a>. A “build” branch where I merge all the branches into one, which leads to less errors? Maybe its a placebo, but its quite easy to do.</p>

<h1 id="patches-applied">Patches applied</h1>

<p>In the post I mentioned before, I had already mentioned some of my reasoning behind the patches I’ve used. Here I’ll just list them again in case you are too lazy to check that other post. They can be found in <a href="https://dwm.suckless.org/patches/">dwm’s website</a>.</p>

<ul>
  <li>alwayscenter</li>
  <li>attachbottom</li>
  <li>autostart</li>
  <li>functionalgapps(+pertag)</li>
  <li>movestack</li>
  <li>shift-tools</li>
  <li>systray</li>
</ul>

<h1 id="other-changes">Other changes</h1>

<p>For my bar, I went with the default and used <a href="https://notabug.org/dm9pZCAq/aslstatus">aslstatus</a>. Its pretty good! I am using the same configuration I shared in my previous post. Pretty much exactly, even though some more features were added to the tool that you may wanna check out.</p>

<p>Picom, the compositor I use, makes window borders transparent. <a href="https://github.com/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8">A couple of lines fix it pretty nicely</a>.</p>

<p>Right now I am still using some systray stuff, like <code class="language-plaintext highlighter-rouge">volumeicon</code>, which kinda duplicates the volume info. I will fix it one of these days…</p>

<p>Regardless, here’s how its looking!</p>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2023-01-13-dwm.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2023-01-13-dwm.png" type="image/png" />
    <img class="mx-auto" src="/assets/img/blogs/2023-01-13-dwm.png" alt="My dwm rice" />
  </picture>
  <figcaption class="caption">My current dwm rice</figcaption></figure>

<h1 id="final-words">Final words</h1>

<p>In the end I am quite happy with my current setup. Everything works just fine. I had heard that the systray patch was hard to apply. I don’t know if its the relatively recent patch for dwm 6.4 or if its just that the patching method I mentioned is better. All I did was create a branch with every c+patch applied, then a branch specifically for the systray patch, and I  merged them both, there were no errors at all. Thankfully I doubt I’ll add any more patches anytime soon. This is great as it is.</p>

<p><strong><a href="https://tildegit.org/chrono/dwm">You can find my configuration here</a></strong>. Just build it and it will be good to go.</p>

<p>This is day 13 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="ricing" /><category term="linux" /><category term="dotfiles" /><category term="foss" /><category term="unix" /><summary type="html"><![CDATA[After a while of being too lazy to try and configure dwm again. I finally decided to journey into setting up this window manager again. And its better than ever for me]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://joelchrono.xyz/assets/img/blogs/2023-01-13-dwm.png" /><media:content medium="image" url="https://joelchrono.xyz/assets/img/blogs/2023-01-13-dwm.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ricing dwm</title><link href="https://joelchrono.xyz/blog/ricing-dwm-2022/" rel="alternate" type="text/html" title="Ricing dwm" /><published>2022-01-26T12:09:03-06:00</published><updated>2022-01-26T12:09:03-06:00</updated><id>https://joelchrono.xyz/blog/ricing-dwm</id><content type="html" xml:base="https://joelchrono.xyz/blog/ricing-dwm-2022/"><![CDATA[<p>When I installed Linux Mint, one of the first things I did was install spectrwm and set it up there. However, I realized that the version available in the repositories does not work with some features I was using, like changing the color of text in my bar.</p>

<p>Because of this, I decided to just stay in XFCE, the Mint edition I got, for a while, until I figured something out. I could build spectrwm from source, but there is no official guide and, while I think its probably super easy, I figured that if I was going to build a WM from source, it would be dwm.</p>

<p>While I don’t really dislike XFCE, I really wanted to go back to tiling, some things just didn’t work as I wanted them to, and some programs didn’t like to stay where I put them, or couldn’t be resized as easily, and XFCE just lets them be, even if I just want them to be smaller or something. During some free time I got, I decided it was finally time to set dwm up once and for all.</p>

<p>I have switched to dwm in the past, in fact I’ve even made a post about the setup <a href="https://fosstodon.org/@joeligj12/106874184595546555">I used back then</a>, but I never wrote something for this blog about it. I guess it was about time.</p>

<h1 id="my-patch-selection">My patch selection</h1>

<p>The patches I’ve decided to use are quite pretty similar to what I would get with spectrwm default keybindings with a few additions. I think its a pretty simple and minimal set.</p>

<ul>
  <li><strong><a href="https://dwm.suckless.org/patches/attachbottom/">attachbottom</a></strong>: This is a really simple patch that I really, really like, I discovered thanks to HexDSL, and I prefer it a lot from the default, since windows appear at the bottom of the stack and don’t move around the rest. Its pretty comfy and easy to apply.</li>
  <li><strong><a href="https://dwm.suckless.org/patches/functionalgaps/">functionalgapps+pertag</a></strong>: I like this patch because it basically applies two in one. This makes it so each tag (or workspace) can have different modes, like, if you have a tag floating, you can have others in master and stack, or another tag maximized. Of course, I also really like gaps, even if they can be a bit useless sometimes, but I can resize them in real time and stuff like that, it makes my brain feel happy.</li>
  <li><strong><a href="https://dwm.suckless.org/patches/movestack/">movestack</a></strong>: This is a basic function that should be there by default, changing the position of a window in a stack is something I consider fairly important. Dwm only allows moving something from the stack to the master position, and a lot of people can only live with that, so you might now actually need this, but I do.</li>
  <li><strong><a href="https://dwm.suckless.org/patches/alwayscenter/">alwayscenter</a></strong>: This makes it so if you have something configured as floating in the config file, it will be centered each time you open it. It does not center stuff you make float manually tho, which fits my needs</li>
  <li><strong><a href="https://dwm.suckless.org/patches/movecenter/">movecenter</a></strong>: This lets me use a keybinding to center whatever window I have floating around, its pretty useful and complements the previous patch nicely.</li>
  <li><strong><a href="https://dwm.suckless.org/patches/shift-tools/">shift-tools</a></strong>: Another useful patch that lets me move around tags with something other than MODKEY+number, for example, drag a window an switch tags alongside it, and other nice features. This is a must for me, might as well be the most important patch, I guess I could live without the rest somehow, but I am just too used to this one, which is available in most tiling window managers by default.</li>
  <li><strong><a href="https://dwm.suckless.org/patches/autostart/">autostart</a></strong>: I decided to have an autostart patch due to some problems I had while using .xinitrc and some programs failing to run properly, but this patch lets me have more control and be completely sure that whatever I want to run will do just do it.</li>
</ul>

<h2 id="notes">Notes</h2>

<p>There is still one patch I have not added, but I used in my previous configuration, and that is <strong><a href="https://dwm.suckless.org/patches/status2d/">status2d</a></strong>, because it lets me use custom colors, which is what I wanted to have in spectrwm in the first place, but I didn’t feel like adding it right now, since I am happy with my current bar.</p>

<p>I also was a bit interested in <a href="https://dwm.suckless.org/patches/swallow/">swallow</a>, but I don’t really need it, I am used to other methods already and the situation where it could be useful isn’t really that common for me.</p>

<h1 id="my-bar">My bar</h1>

<p>There are many ways to customize the bar, from <code class="language-plaintext highlighter-rouge">xsetroot</code>, to <code class="language-plaintext highlighter-rouge">dwmblocks</code> or <a href="https://tools.suckless.org/slstatus/">slstatus</a>, all of them are pretty good ways to make use of it. However, I went ahead and used <a href="https://notabug.org/dm9pZCAq/aslstatus">aslstatus</a>, which is basically the same as suckless’ original tool, but asynchronous, I can make my volume update in real time, while the weather info is only updated every 30 minutes or so. Its pretty good and I really like it, and it works with status2d and colors, whenever I get the time to set it up properly.</p>

<p>It’s what I used in the mastodon post I shared above, so it works great. Its also the reason I went with an autostart patch, since running it from .xinitrc was not reliable.</p>

<h1 id="finishing-up">Finishing up</h1>

<p>There isn’t really a lot else to say, I guess I could share the current config in my git repository. I will probably do it soon enough, there are still some things I want to change but I am pretty happy with how it looks now. I like the simplicity I went for. Sadly, LabVIEW, the program I installed yesterday, hates being told where to stay, so I’ll have to stick with XFCE during those classes.</p>

<p>You can see my <a href="https://tildegit.org/chrono/dotfiles/src/branch/master/stow_home/dwm/.config/dwm/config.def.h">configuration file for dwm here</a>, but its nothing too special. My bar is also just using the defaults, and this is at the bottom:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>static struct arg_t args[] = {

/* function		format		argument	interval (in ms) */

{ netspeed_rx,  "  %sB/s",     IFC,        2 _SEC, END },
{ netspeed_tx,  " -  %sB/s |", IFC,        2 _SEC, END },
{ disk_free,    " %s |",		"/",	    25 _SEC,END },
{ cpu_perc,	    "  %3s%% |",	NULL,		1 _SEC,	END },
{ vol_perc,		" %s |",	    NULL,		0,		END },
{ wifi_perc,	" 直 %3s%% |",	IFC,		2 _SEC,	END },
{ battery_perc,	"   %3s%% |",	"BAT0",		1 _MIN,	END },
{ datetime,		"  %s ",	    "%H:%M:%S",	1 _SEC,	END },

};
</code></pre></div></div>

<p>This has been day 95 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="ricing" /><category term="linux" /><category term="foss" /><category term="dotfiles" /><summary type="html"><![CDATA[I enjoy tiling window managers, and I've used DWM in the past, but after a few weeks on XFCE, I decided to go back to basics]]></summary></entry><entry><title type="html">Return to the Void</title><link href="https://joelchrono.xyz/blog/return-to-the-void/" rel="alternate" type="text/html" title="Return to the Void" /><published>2021-12-20T14:51:16-06:00</published><updated>2021-12-20T14:51:16-06:00</updated><id>https://joelchrono.xyz/blog/return-to-the-void</id><content type="html" xml:base="https://joelchrono.xyz/blog/return-to-the-void/"><![CDATA[<p>Back when <a href="https://joelchrono.xyz/blog/switching-distro-ending-school/">I left Void Linux</a>, I did so because of a couple of reasons:</p>

<p>First, it was a school assignment, I would win some extra points and I was already willing to make the move. But also, I was pretty dumb and couldn’t figure out printing, as well as some graphical issues, where the screen would blink and glitch seemingly at random.</p>

<h1 id="endeavour-os-is-great">Endeavour OS is great</h1>

<p>I really enjoyed my time using Endeavour, it was a really easy to use distribution that provided me with everything I needed out of the box. I was finally able to enjoy a pretty minimal, yet usable Arch configuration, I had everything working almost perfectly, and if something was going wrong it was usually just me being dumb and setting some config incorrectly.</p>

<p>I may go back to this distro in the future, or even finally give a change to pure Arch in my machine, since I found it all pretty smooth and it was always fun to have updates waiting for me almost everyday.</p>

<h1 id="the-problem">The problem</h1>

<p>My main problem has nothing to do with Endeavour or Arch itself, its just an AUR package that required an old Python version, and prevented me from updating my system once Python got an update. There where some comments in the AUR website, but it seems like it can’t be easily fixed until the maintainer decides to step up.</p>

<p>Another slight problem was just the amount of stuff I felt was not needed by me. For example, Endeavour OS comes packaged with a lot of small terminal utilities that can do everything from changing wallpapers, checking for updates, making logs and such. All of these had small dependencies that were quite annoying, because I didn’t really use them. A lot of those packages depended on each other too, and it was difficult to get rid of them all.</p>

<p>But, being honest, I guess the main reason I left Endeavour was because I was no longer able to update it, which is kind of the whole point.</p>

<h1 id="letting-go-of-my-early-tether">Letting go of my early tether</h1>

<p>I have went with many distros for a while now. But something they all had in common was that all of them were dual-booted alongside Windows, and of course, all of them had broken bootloaders at least once in their lifetime, because of some random Windows update.</p>

<p>Funnily enough, as soon as I was done backing up my files and config files to a second hard drive, I rebooted to Windows to do the same to the files I had there. Then rebooted once more, for a second check on my Linux site, and <em>voila</em>, my bootloader was gone.</p>

<p>Frustrated, I decided to just go for it and plug my USB drive, change the boot order and install Void alone, once and for all.</p>

<h1 id="void-everywhere">Void everywhere</h1>

<p>Have you ever heard of Guru Laghima?, he was a wise man, who wrote something I decided to apply here:</p>

<blockquote>
  <p>“New growth cannot exist without first the destruction of the old.”</p>
</blockquote>

<p>I ran the <code class="language-plaintext highlighter-rouge">void-install</code> script, an ncurses screen showed up, I configured everything. It was finally the point of no return, the partitions had to be wiped and reset, I also finally made a new, separate <code class="language-plaintext highlighter-rouge">/home</code> partition, and wrote the changes.</p>

<p>Endeavour was gone, Windows was gone, and even some files I forgot to back up, were also, gone.</p>

<p>But you know what, that is completely fine, as Guru Laghima once said:</p>

<blockquote>
  <p>“Let go your earthly tether. Enter the void. Empty and become wind”</p>
</blockquote>

<p>With nothing installed, I was finally born again, Void was even more beautiful than I remembered, there were a lot of new things and the packages available have grown quite a bit. There are still some problems here and there, but in the end, I know everything is going to be alright.</p>

<p>This has been day 64 of <a href="https://100DaysToOffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="foss" /><category term="linux" /><category term="distro" /><category term="review" /><category term="ramble" /><category term="dotfiles" /><summary type="html"><![CDATA[After some fun times with EndeavourOS, I decided to distrohop once again to Void Linux, and finally, once and for all, get rid of Windows, for good.]]></summary></entry><entry><title type="html">Backup your dotfiles using stow</title><link href="https://joelchrono.xyz/blog/backing-up-my-dotfiles/" rel="alternate" type="text/html" title="Backup your dotfiles using stow" /><published>2021-08-31T16:20:03-05:00</published><updated>2021-08-31T16:20:03-05:00</updated><id>https://joelchrono.xyz/blog/backing-up-my-dotfiles</id><content type="html" xml:base="https://joelchrono.xyz/blog/backing-up-my-dotfiles/"><![CDATA[<p>Managing dotfiles has always been quite annoying to me. But thankfully, I never really had a reason to do it too often. When <a href="/blog/switching-distro-ending-school/">I moved from Void Linux to EndeavourOS</a>, all I did was <code class="language-plaintext highlighter-rouge">tar</code> my whole <code class="language-plaintext highlighter-rouge">.config</code> and copied the file to an external drive.</p>

<p>That works fine,  but it’s not the best way to backup the constant changes I usually do to customize the way my programs look or act, and as a customization freak, that happens <em>quite often</em>.</p>

<p>I had seen many different ways to backup dotfiles: git bare repos, <a href="https://yadm.io">yadm</a>, symlinking scripts, and of course, GNU Stow.</p>

<p>All of these methods have their up and downs, but in the end, <code class="language-plaintext highlighter-rouge">stow</code> convinced me, and I decided to give it a try. According to their <a href="https://www.gnu.org/software/stow/">home page</a>:</p>

<blockquote>
  <p>GNU Stow is a symlink farm manager which takes distinct packages of software and/or data located in separate directories on the filesystem, and makes them appear to be installed in the same place.</p>
</blockquote>

<p>If you don’t really understand it yet, don’t worry, <em>I don’t either!</em> But in this blog, I will do my best to show you the steps to backup your current config files, I hope whoever reads this finds it useful.</p>

<h1 id="creating-a-dotfiles-repository">Creating a dotfiles repository</h1>

<p>The first step to backup your dotfiles, is to create an <strong>empty</strong> repository in some hosting service, such as <a href="https://github.com">GitHub</a>, <a href="https://codeberg.org">Codeberg</a> or <a href="https://sourcehut.org">SourceHut</a>. This is optional if you only want to see how <code class="language-plaintext highlighter-rouge">stow</code> works, but necessary to have an external backup outside your computer. Once you are done, clone the empty repo to your home directory, or in any place you want. (This tutorial will be using the home directory).</p>

<p>To clone a repo, just do:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://site.com/link/to/repo
</code></pre></div></div>

<p>In my case, I use <a href="https://tildegit.org">Tildegit</a>, a Gitea instance, so my command looks like this.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://tildegit.org/chrono/dotfiles.git
</code></pre></div></div>

<p>You can clone my dotfiles if you want to use them, <a href="https://tildegit.org/chrono/dotfiles.git">here</a> they are if you are interested.</p>

<h1 id="using-stow-to-backup-your-configuration">Using stow to backup your configuration</h1>

<p>Before actually backing something up, we need to install <code class="language-plaintext highlighter-rouge">stow</code>, depending on your distribution, you can install it with your package manager of choice. In my case, Endeavor is based on Arch, so I do:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">sudo </span>pacman <span class="nt">-S</span> stow
</code></pre></div></div>

<p>Lets start by backing up the configuration of a single program. While we can backup our whole <code class="language-plaintext highlighter-rouge">.config</code> folder, that’s <strong>not</strong> a good idea, since <strong>some</strong> programs store <strong>important</strong> information that <em>should</em> stay private, and I think its better to only backup what we have actually configured. For this example, I will backup my <code class="language-plaintext highlighter-rouge">picom</code> configurations.</p>

<p>The first step is to create a new directory to use as a base (if you cloned your empty repo, you’ll be using that). You also have to create a folder structure, depending on where you want the configuration to be stored, this depends on the location the program will read its configuration from. We’ll refer to this folder as <code class="language-plaintext highlighter-rouge">dotfiles</code>.</p>

<p>If you want to add a <code class="language-plaintext highlighter-rouge">README</code> file or other stuff that you is not a config files, you can create another directory inside of <code class="language-plaintext highlighter-rouge">dotfiles</code>, in my case, I have made a <code class="language-plaintext highlighter-rouge">stow_home</code> folder, which will be where we’ll run the <code class="language-plaintext highlighter-rouge">stow</code> command. <sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup></p>

<p>Lets explain how <code class="language-plaintext highlighter-rouge">stow</code> works. Picom expects its config file in <code class="language-plaintext highlighter-rouge">~/.config/picom/picom.conf</code>, so, inside of the new <code class="language-plaintext highlighter-rouge">home_stow</code> directory, we recreate that folder structure, but using the program name (<code class="language-plaintext highlighter-rouge">picom</code>) instead of the tilde (<code class="language-plaintext highlighter-rouge">~</code>), which usually refers to the home folder. <sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup></p>

<p>Lets put all of this together in the terminal.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir </span>dotfiles <span class="o">&amp;&amp;</span> <span class="nb">cd </span>dotfiles <span class="c"># mkdir only if you didn't clone it</span>
<span class="nb">touch </span>README.md other_file.txt <span class="c"># optional</span>
<span class="nb">mkdir</span> <span class="nt">-p</span> ~/dotfiles/stow_home/picom/.config/picom/
<span class="nb">mv</span> ~/.config/picom/ ~/dotfiles/stow_home/picom/.config/
</code></pre></div></div>

<p>Once you do that, your picom folder is no longer in the <code class="language-plaintext highlighter-rouge">.config</code> directory, but inside of <code class="language-plaintext highlighter-rouge">dotfiles/home_stow</code>, following <em>the same folder structure</em>, as if <code class="language-plaintext highlighter-rouge">home_stow</code> was the <code class="language-plaintext highlighter-rouge">/home</code> directory, followed by the user <code class="language-plaintext highlighter-rouge">picom</code> and the path to the picom configuration files. <sup id="fnref:4"><a href="#fn:4" class="footnote" rel="footnote" role="doc-noteref">3</a></sup></p>

<p>Now we repeat this process with all of the files and directories we want to back up. Once done, the behavior of the programs you use, such as <code class="language-plaintext highlighter-rouge">vim</code>, should revert to their default configurations, since the user config files are no longer there. So, <strong>now its time to fix that!</strong> Inside of <code class="language-plaintext highlighter-rouge">stow_home</code>, run the following command:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>stow <span class="nt">-vt</span> ~ <span class="k">*</span>
</code></pre></div></div>

<p>This will symlink <strong>everything</strong> inside of <code class="language-plaintext highlighter-rouge">stow_home</code> <sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">4</a></sup>, targetting <code class="language-plaintext highlighter-rouge">~</code> as the starting point. The <code class="language-plaintext highlighter-rouge">-v</code> flag will let you know of everything being done, so you should see an output like this, depending on the programs you backed up:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># $ stow -vt ~ *</span>
LINK: .config/awesome <span class="o">=&gt;</span> ../dotfiles/stow_home/awesome/.config/awesome
LINK: .config/bat <span class="o">=&gt;</span> ../dotfiles/stow_home/bat/.config/bat
LINK: .config/dunst <span class="o">=&gt;</span> ../dotfiles/stow_home/dunst/.config/dunst
LINK: .config/nvim <span class="o">=&gt;</span> ../dotfiles/stow_home/nvim/.config/nvim
LINK: .config/picom <span class="o">=&gt;</span> ../dotfiles/stow_home/picom/.config/picom
LINK: .config/rofi <span class="o">=&gt;</span> ../dotfiles/stow_home/rofi/.config/rofi
LINK: .config/spectrwm <span class="o">=&gt;</span> ../dotfiles/stow_home/spectrwm/.config/spectrwm
</code></pre></div></div>

<h1 id="file-versioning-with-git">File versioning with git</h1>

<p>If you stumbled upon this guide, you probably know the necesary <code class="language-plaintext highlighter-rouge">git</code> commands to backup everything to the service you chose at the beginning of this guide.</p>

<p>Generally, everytime you do changes you only need to follow these three commands, inside of your <code class="language-plaintext highlighter-rouge">dotfiles</code> folder.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git add <span class="k">*</span>
git commit <span class="nt">-m</span> <span class="s2">"Added config files"</span>
git push
</code></pre></div></div>

<p>Remember that the last command will not work if you don’t have an external repository.</p>

<p>The manual of GNU Stow contains a lot more than what I mentioned here, like unlinking and other flags that can be used and might be useful for your use case.</p>

<h1 id="finishing-up">Finishing up</h1>

<p>Anyways, that’s all folks, this has been day 54 of <a href="https://100DaysToOffload.com">#100DaysToOffload</a>, you can check out my dotfiles if you want to see how <code class="language-plaintext highlighter-rouge">stow</code> looks once setup, besides, my <a href="/blog/spectrwm-setup">Spectrwm configuration</a> is quite sick if I do say so myself.</p>

<p>If you feel like a step is not clear enough, please let me know in the comments or via e-mail.</p>

<h2 id="secret-bonus-script">Secret bonus script!</h2>

<p>So, if you read until the end of this blog. I actually did a pretty decent bash script to automate everything here.</p>

<p>All you need to do is configure it to your liking and run it like this</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dotstow file_or_folder
</code></pre></div></div>

<p>The script is as follows, it uses basic tools like <code class="language-plaintext highlighter-rouge">cut</code> and of course, <code class="language-plaintext highlighter-rouge">stow</code></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/usr/bin/bash</span>
<span class="c"># Dotstow - Backup your chosen dotfiles in one go using stow.</span>
<span class="c"># Run it outside of the folder/file you want to back up</span>
<span class="c"># $ dotstow file-or-program</span>
<span class="c"># This program was made by joelchrono12</span>

<span class="nv">STOW_DIR</span><span class="o">=</span><span class="nv">$HOME</span>/dotfiles/stow_home
<span class="nv">DIR</span><span class="o">=</span><span class="si">$(</span><span class="nb">pwd</span> | <span class="nb">cut</span> <span class="nt">-d</span> <span class="s1">'/'</span> <span class="nt">-f4-</span><span class="si">)</span>
<span class="nv">NEW_DIR</span><span class="o">=</span><span class="nv">$STOW_DIR</span>/<span class="nv">$1</span>/<span class="nv">$DIR</span>
<span class="nb">mkdir</span> <span class="nt">-pv</span> <span class="nv">$NEW_DIR</span>
<span class="nb">mv</span> <span class="nt">-v</span> <span class="nv">$1</span> <span class="nv">$NEW_DIR</span>
<span class="nb">cd</span> <span class="nv">$STOW_DIR</span>
stow <span class="nt">-vt</span> ~ <span class="nv">$1</span>
</code></pre></div></div>

<p>The program does not check if a folder already exists or anything like that. So feel free to send any suggestions and changes to it in a comment or using <a href="https://git-send-email.io/">git send-email</a> to my email address.</p>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>You can just use dotfiles as is without a folder inside it, but if you want to be able to quickly deploy everything using <code class="language-plaintext highlighter-rouge">*</code>, you must make a folder where README and other files you don’t want to symlink won’t interfere . <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>Other files, like <code class="language-plaintext highlighter-rouge">.bashrc</code>, are not in the <code class="language-plaintext highlighter-rouge">.config</code> folder, keep in mind that the path to use depends on where the program needs it to be. In this case, it would have to be placed in <code class="language-plaintext highlighter-rouge">~/dotfiles/stow_home/bash/.bashrc</code>. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4">
      <p>You can also move specific files of a configuration folder. For example, <code class="language-plaintext highlighter-rouge">tut</code>, a mastodon client, saves the account data (passwords, etc) inside of another file in its configuration folder. if thats the case. You should move only the files you want, instead of the whole directory. <code class="language-plaintext highlighter-rouge">stow</code> should manage the rest. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3">
      <p>If you are unsure about the paths you created, you can run the <code class="language-plaintext highlighter-rouge">-n</code> flag to <em>simulate</em> the output and see exactly where each symlink <em>would be</em> placed. That way you dont end up symlinking in the wrong place and doing weird stuff to your filesystem. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="linux" /><category term="foss" /><category term="vim" /><category term="tutorial" /><category term="dotfiles" /><category term="coding" /><category term="bash" /><summary type="html"><![CDATA[I finally figured out a nice way to backup my config files, and I decided to upload mine once and for all.]]></summary></entry></feed>