Questions in Arch

I notice myself asking questions about common tasks when I come back to Arch after a long time. I think that makes for a good article as it is possible others have these questions.

I’m running out of space and that’s stupid.

Not a question, but I’ve felt that exact sentiment.

In Arch, this is very likely the Pacman cache going crazy. Every time you upgrade a package in Pacman, it keeps the previous version. All of them. Forever.

You could theoretically roll back to the base installation of your system now if you’ve never cleaned the cache. This is great, but you just need to be aware of the functionality because it will eat up all of /.

Wiki Context

To do this you’ll have to install pacman-contrib, which means you’ll have to do an upgrade with pacman -Syyu, so make sure that you already haven’t run out of space ;)

paccache -rk1
==> Privilege escalation required

==> finished: 2036 packages removed (disk space saved: 8.1 GiB)

Holy Shit. That was a massive difference. From 20.8GB to 13.2GB. My / is back to the expected size.

How do I get rid of this package I know I will never use again?

cough emacs cough

Removing Packages

Remove a package and all of its dependencies that aren’t needed by another package.

pacman -Rs [package name]

Find a package by name and get some information on it.

pacman -Qi [package name]

How do I visualize the usage on my disk?

Wiki

Filelight is what I settled on. It produced those lovely pie charts earlier in the article. I love that you can see everything in a hierarchical order and really see which folders are the worst offenders.

Filelight — Disk usage analyzer that creates an interactive map of concentric, segmented rings that help visualize disk usage on your computer.

How do I take a screenshot?

This one is more complicated. Because I run i3, I have the option to bind keys to scripts in a very convenient way.

My ~/.config/i3/config has the following lines amongst others:

bindsym --release Shift+Print exec --no-startup-id "maim -s -c 1,1,1,0 --format png /home/drone/Pictures/Screenshots/`date | sed 's/ /-/g'`.png"
bindsym --release Print exec --no-startup-id "maim -s -c 1,1,1,0 --format png /dev/stdout | xclip -selection clipboard -t image/png"
# Screenshots

Implicitly here, I’m using maim. You’ll need that installed to do anything. With maim, you’ll get cross hairs, you can draw a box to get a selection, or click to get the whole window.

Notice that for Shift+PrtSc I’m saving to a well known location and for the regular, I copy to the clipboard. Take that OSX.

How do I look at this image?

Oh yeah, you can’t just open. I like sxiv for this. It is super clean and small. The Wiki told me so.