Automatically changing display settings with Autorandr
linux

Automatically changing display settings with Autorandr

I've been using Linux on laptops for over a decade and have got used to some of the rough edges. When I boot my current laptop connected to an external monitor xrandr will extend the displays between the external monitor and the laptop screen. I have my laptop half-shut low on my desk and so the screen is unusable, and so I open up lxrandr, which always opens up on the laptop screen, and so I awkwardly crane my neck and wiggle the mouse until I click the setting to turn off the laptop screen and press apply, then rush to press the confirmation button.

A Command Line Interface for HTML With parsel-cli
python

A Command Line Interface for HTML With parsel-cli

There are many great command line tools for searching and manipulating text (like grep), columnar data (like awk), JSON data (like jq). With HTML there's parsel-cli built on top of the wonderful parsel Python library. Parsel is a fantastic library that gives a simple and powerful interface for extracting data from HTML documents using CSS selectors, Xpath and regular expressions. Parsel-cli is a very small utility that lets you use parsel from the command line (and can be installed with pip install parsel-cli).

Taking Screenshots in Firefox
firefox

Taking Screenshots in Firefox

I find taking screenshots in Linux a bit painful. My current way is to use GIMP to create an image from a screenshot, but it's a bit slow to startup and interrupts my flow. I've had trouble installing Shutter which I haven't worked through yet. However I've just found out that Firefox has a way to take screenshots. All you need to do is press Control-Shift-S and then it brings up a selector where you can pick an element, or a region (like an improved version of Windows Snipping tool).

Previewing changes to LaTeX documents with inotify
linux

Previewing changes to LaTeX documents with inotify

Sometimes it's useful to rerun a task whenever a file changes; whether that's a linter or a test suite, or a preview. I recently wanted to recompile a TeX file to PDF whenever I saved a change, and it was easy with inotify, using instructions from superuser. To install inotify on a Debian derivative you can use sudo apt install inotify-tools. Then you can set it to run a command whenever a file is done saving.

Disk Usage in Linux with du
linux

Disk Usage in Linux with du

When your harddrive is filling up the du utility is a great way of seeing what's taking up all the space. It can recursively walk through directories to a maximum depth, and print it in human readable sizes. I'll normally start by running df to see what space is used and available. It's worth looking at the Mounted On column if you don't administer the machine because sometimes there are special partitions for large files.

Don't manage work email with Emacs
email

Don't manage work email with Emacs

I do a lot of work in Emacs and at the command line, and I get quite a few emails so it would be great if I could handle my emails there too. Email in Emacs can be surprisingly featureful and handles HTML markup, images and can even send org markup with images and equations all from the comfort of an Emacs buffer. However it can be a whole heap of work, and as you get deeper into the features your mail client provides the amount of custom integration required grows very rapidly.