Useful Scripts

In which I write about some useful shell scripts/Fish Shell functions that I use.

I have a small collection of scripts/Fish Shell functions that I use to ease the burden of getting things done. Not all of them are worth of a post, but I’d like to share what I have, because if it can help someone over a hurdle, then all the better.

Fetch from AUR

function aur -d "Fetch a package from AUR4"
    set -l projdir "/home/ndegruchy/Documents/AUR/"
    set -l appldir $projdir/$argv
    git clone$argv.git $projdir/$argv
    cd $appldir

This particular snippet simply creates a new directory in my documents/AUR folder, then clones the specified AUR program to that directory, changing directory into it to make it faster to get up and building. I don’t have much use for this now, since I use pikaur to manage my AUR packages.

Blurred Screen Locker



ffmpeg -loglevel quiet -f x11grab -video_size $RES -y -i $DISPLAY -filter_complex "boxblur=10" -vframes 1 $IMAGE

i3lock --image=$IMAGE --ignore-empty-password --show-failed-attempts


This bash script uses ffmpeg to take an X11 screenshot, and apply some blur to it before invoking my screen locker (i3lock), using the image as the image. Looks pretty nice and it doesn’t require much in the way of resources/tooling to get going.

Resume Builder

function -d "Compresses and retitles my resume PDF"
	exiftool -Title="Nathan DeGruchy's Resume" main.pdf
	gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=ndegruchy-resume.pdf main.pdf

I often have several steps after I rebuild my resume out of LaTeX to make it ready for sending out. This Fish Function takes my resume, fixes the ‘title’ field, uses ghostscript to compress the whole thing and optimize it for screen reading. I should probably generate a Makefile for this to be honest…

By Nathan

Hello! My name is Nathan and I'm a technologist living and working in the south east. I love breaking crap and fixing it. I tend to break more than I fix. When I'm not breaking and fixing stuff, I'm playing games with my son or going to Disney with my family. I strongly support open source software, hardware and greater transparency in government.