paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 71a38517adfc92c90b7b4ec8fff256c1a8941e33
parent d3f3a3cfced6a4440e427d76681d29044003a0d6
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Mon, 29 Jun 2020 00:07:00 -0400

Publish new blog post

Diffstat:
Mpages/blog.md | 1+
Apages/blog/how-i-keep-my-home-directory-clean.md | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpages/home.md | 4++--
Mpublic/feeds/sitewide-feed.xml | 22++++++++++++++++++++++
Apublic/img/home-directory.png | 0
Mpublic/sitemap.xml | 1+
6 files changed, 100 insertions(+), 2 deletions(-)

diff --git a/pages/blog.md b/pages/blog.md @@ -20,6 +20,7 @@ href="https://social.paritybit.ca/@jbauer">Mastodon</a>. ### 2020 <ul> + <li>2020-06-28 <a href="blog/how-i-keep-my-home-directory-clean">How I Keep My Home Directory Clean</a></li> <li>2020-06-27 <a href="blog/my-first-ctf">My First CTF</a></li> <li>2020-06-26 <a href="blog/use-syncthing-to-sync-things">Use Syncthing to Sync Things</a></li> <li>2020-06-26 <a href="blog/why-dwm-swallowing-cant-swallow-tmux">Why dwm's Window Swallowing Patch Can't Swallow tmux</a></li> diff --git a/pages/blog/how-i-keep-my-home-directory-clean.md b/pages/blog/how-i-keep-my-home-directory-clean.md @@ -0,0 +1,74 @@ +## How I Keep My Home Directory Clean + +[//]: # "I am one of those people who likes to keep files organized and directories clean. Here's how I keep my home directory as free of cruft as possible." + +[//]: # "main.min.css" + +[//]: # + +<div class="byline"> +<b>Written By:</b> Jake Bauer | + <b>Posted:</b> 2020-06-28 | + <b>Last Updated:</b> 2020-06-29 +</div> + +_**Update**: The name of the tool mentioned later in the post is +[rehome](https://github.com/lpar/rehome). Also added a screenshot showing the +current state of my home directory._ + +I am one of those people who likes to keep files organized and directories +clean. Unfortunately, it seems many software developers don't care about this +and like to dump their program's configuration and state information into my +home directory, rather than putting it in the proper XDG specified directories. I've +gone through quite a bit of effort, mainly using the [Arch Wiki's page on the +XDG Base Directory +specification](https://wiki.archlinux.org/index.php/XDG_Base_Directory), to +clean up my home directory from a lot of the cruft programs like to leave lying +around. + +<figure> + <a href="/img/home-directory.png"><img src="/img/home-directory.png"/></a> + <figcaption>The current state of my home directory. Only 12 items.</figcaption> +</figure> + +Most programs, if they don't already recognize the `XDG_CONFIG_HOME` environment +variable, have their own environment variables that they look at to find the +location of configuration data. Some examples from my `.profile` are: + +```bash +export XAUTHORITY="$XDG_CONFIG_HOME/X11/Xauthority" +export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +``` + +Which get rid of the `.xinitrc` and `.Xauthority` files which would normally sit +in the home directory. + +Some programs, however, don't have environment variables but can still be told +where to find configuration information using a command line switch. For +example, in my `.bashrc` I have the aliases: + +```bash +alias tmux='tmux -f "$XDG_CONFIG_HOME"/tmux/tmux.conf' +alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' +``` + +Which tell `tmux` to find its configuration in a directory in the `XDG_CONFIG_HOME` +directory, and `wget` to store its history in the `XDG_CACHE_HOME` directory. + +Unfortunately, even with changes in `.profile` and aliases in `.bashrc`, there +are still programs which are hardcoded to put files in the home directory. +Programs like Firefox, SSH, and Vim (although NeoVim respects XDG), are so old +and well-established that the developers are reluctant to change anything for +fear of breaking things that expect the files to be there. + +I have heard of a program designed to trick other programs into thinking the +home is actually in the XDG directories so that they are, in a way, forced to +respect the specification. However, I'm alright with a few programs here and +there in my home directory as long as it doesn't get needlessly cluttered. If +you're developing a brand new application there's no excuse; please respect the +XDG base directory specification! + +_This is my fifty-seventh post for the +[#100DaysToOffload](https://social.paritybit.ca/tags/100DaysToOffload) +challenge. You can learn more about this challenge over at +[https://100daystooffload.com](https://100daystooffload.com)._ diff --git a/pages/home.md b/pages/home.md @@ -20,6 +20,8 @@ extent)! Access through `gopher://paritybit.ca` or `gemini://paritybit.ca`. src="/img/feed-icon.png" width="15" height="15" alt="Click for RSS Feed"/> </a> </div> +2020-06-28 <a class="feed-item" href="blog/how-i-keep-my-home-directory-clean">How I Keep My Home Directory Clean</a> + 2020-06-27 <a class="feed-item" href="blog/my-first-ctf">My First CTF</a> 2020-06-26 <a class="feed-item" href="blog/use-syncthing-to-sync-things">Use Syncthing to Sync Things</a> @@ -37,8 +39,6 @@ extent)! Access through `gopher://paritybit.ca` or `gemini://paritybit.ca`. 2020-06-19 <a class="feed-item" href="blog/how-to-create-an-rss-feed-for-your-blog-2">How to Create an RSS Feed for Your Blog — 2 — The Basics</a> 2020-06-18 <a class="feed-item" href="blog/how-to-create-an-rss-feed-for-your-blog-1">How to Create an RSS Feed for Your Blog — 1 — Why?</a> - -2020-06-16 <a class="feed-item" href="blog/my-beginnings-with-gentoo">My Beginnings with Gentoo</a> ### What is a Parity Bit? It is a bit (in the 1's and 0's sense) used in checking for errors in digital diff --git a/public/feeds/sitewide-feed.xml b/public/feeds/sitewide-feed.xml @@ -7,6 +7,28 @@ <description>The feed that covers all notable additions, updates, announcements, and other changes for the entire paritybit.ca website.</description> <item> + <title>How I Keep My Home Directory Clean</title> + <link>https://www.paritybit.ca/blog/how-i-keep-my-home-directory-clean</link> + <guid>https://www.paritybit.ca/blog/how-i-keep-my-home-directory-clean</guid> + <pubDate>Sun, 28 Jun 2020 23:59:12 -0400</pubDate> + <description><![CDATA[<h2 id="how-i-keep-my-home-directory-clean">How I Keep My Home Directory Clean</h2> +<div class="byline"> +<p><b>Written By:</b> Jake Bauer | <b>Posted:</b> 2020-06-28 | <b>Last Updated:</b> 2020-06-28</p> +</div> +<p>I am one of those people who likes to keep files organized and directories clean. Unfortunately, it seems many software developers don’t care about this and like to dump their program’s configuration and state information into my home directory, rather than putting it in the proper XDG specified directories. I’ve gone through quite a bit of effort, mainly using the <a href="https://wiki.archlinux.org/index.php/XDG_Base_Directory">Arch Wiki’s page on the XDG Base Directory specification</a>, to clean up my home directory from a lot of the cruft programs like to leave lying around.</p> +<p>Most programs, if they don’t already recognize the <code>XDG_CONFIG_HOME</code> environment variable, have their own environment variables that they look at to find the location of configuration data. Some examples from my <code>.profile</code> are:</p> +<div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb1-1" title="1"><span class="bu">export</span> <span class="va">XAUTHORITY=</span><span class="st">&quot;</span><span class="va">$XDG_CONFIG_HOME</span><span class="st">/X11/Xauthority&quot;</span></a> +<a class="sourceLine" id="cb1-2" title="2"><span class="bu">export</span> <span class="va">XINITRC=</span><span class="st">&quot;</span><span class="va">$XDG_CONFIG_HOME</span><span class="st">/X11/xinitrc&quot;</span></a></code></pre></div> +<p>Which get rid of the <code>.xinitrc</code> and <code>.Xauthority</code> files which would normally sit in the home directory.</p> +<p>Some programs, however, don’t have environment variables but can still be told where to find configuration information using a command line switch. For example, in my <code>.bashrc</code> I have the aliases:</p> +<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb2-1" title="1"><span class="bu">alias</span> tmux=<span class="st">&#39;tmux -f &quot;$XDG_CONFIG_HOME&quot;/tmux/tmux.conf&#39;</span></a> +<a class="sourceLine" id="cb2-2" title="2"><span class="bu">alias</span> wget=<span class="st">&#39;wget --hsts-file=&quot;$XDG_CACHE_HOME/wget-hsts&quot;&#39;</span></a></code></pre></div> +<p>Which tell <code>tmux</code> to find its configuration in a directory in the <code>XDG_CONFIG_HOME</code> directory, and <code>wget</code> to store its history in the <code>XDG_CACHE_HOME</code> directory.</p> +<p>Unfortunately, even with changes in <code>.profile</code> and aliases in <code>.bashrc</code>, there are still programs which are hardcoded to put files in the home directory. Programs like Firefox, SSH, and Vim (although NeoVim respects XDG), are so old and well-established that the developers are reluctant to change anything for fear of breaking things that expect the files to be there.</p> +<p>I have heard of a program designed to trick other programs into thinking the home is actually in the XDG directories so that they are, in a way, forced to respect the specification. However, I’m alright with a few programs here and there in my home directory as long as it doesn’t get needlessly cluttered. If you’re developing a brand new application there’s no excuse; please respect the XDG base directory specification!</p> +<p><em>This is my fifty-seventh post for the <a href="https://social.paritybit.ca/tags/100DaysToOffload">#100DaysToOffload</a> challenge. You can learn more about this challenge over at <a href="https://100daystooffload.com">https://100daystooffload.com</a>.</em></p>]]></description> + </item> +<item> <title>My First CTF</title> <link>https://www.paritybit.ca/blog/my-first-ctf</link> <guid>https://www.paritybit.ca/blog/my-first-ctf</guid> diff --git a/public/img/home-directory.png b/public/img/home-directory.png Binary files differ. diff --git a/public/sitemap.xml b/public/sitemap.xml @@ -3,6 +3,7 @@ <url><loc>https://www.paritybit.ca</loc></url> <url><loc>https://www.paritybit.ca/home</loc></url> <url><loc>https://www.paritybit.ca/blog</loc></url> + <url><loc>https://www.paritybit.ca/blog/how-i-keep-my-home-directory-clean</loc></url> <url><loc>https://www.paritybit.ca/blog/my-first-ctf</loc></url> <url><loc>https://www.paritybit.ca/blog/use-syncthing-to-sync-things</loc></url> <url><loc>https://www.paritybit.ca/blog/why-dwm-swallowing-cant-swallow-tmux</loc></url>