Scripts

Interpreted (desktop) things (Bash/Python) that aren't full-fledged pieces of software. They're only tested on Linux, and most will only work on Linux (and similar, if supported by the dependencies).

Instructions

Make the script executable:

chmod +x path/to/script

Then place the script somewhere on your path: do

echo $PATH

for a list of paths checked by the shell; if none of these are under your home directory, it makes sense to create a ~/bin directory and put something like

export PATH="$PATH:$HOME/bin"

in your shell configuration file (~/.bashrc for Bash).

For Python scripts, change the first line to point to the location of the Python executable for the matching version (2 or 3) (Python 2 or 3 might be python instead of python2, for example).

GPL3

ytsubs

Create an RSS feed from your YouTube subscriptions. (YouTube no longer provides any reliable method of receiving updates.)

Usage: run ytsubs -h.

Dependencies: Python 3.2 or later 3.x.

Download (0.3.1). There's also an Arch package.

BSD-new

audctl/notifaud

Control the volume on an ALSA system. audctl does the controlling, and notifaud sends a desktop notification (via libnotify) indicating the current state; I use these together with xbindkeys to map my keyboard's volume keys. If you want to use both together, uncomment (remove the '#' from) the last line of audctl, and it will run notifaud every time it's called.

Unlike most volume control utilities I've used, audctl does not unmute the volume when it is changed; this is by design.

Configuration: audctl has a couple of things to set: open up the script in an editor and change the variables at the top (7th and 8th lines) if you want to. See man amixer for details on what values these can take. Similarly, open notifaud and change the values of 'TIMEOUT' and 'PID_FILE' to set the duration of notifications and the temporary file to use (lines 15 and 16).

Usage: audctl takes a single argument: 'up' or 'down' to step the volume up or down; 'toggle' to mute/unmute sound; or a number (integer) to set the volume to (a percentage, without the '%'). notifaud takes no arguments.

Dependencies: both depend on alsa-utils (in particular, amixer), and audctl also requires Bash. notifaud depends on notify-python, and won't do much without some sort of notification daemon, like notification-daemon or Xfce Notification Daemon.

Download: audctl/notifaud.

BSD-new

mw-transfer-img

An interactive script for transferring files from one MediaWiki wiki to another. Useful when migrating a wiki that you don't have backend access to.

Dependencies: Python 2.

Download.

BSD-new

dfcustomfix

For many people running Dustforce on Linux, the custom levels menu crashes the game. This is a workaround that adds custom levels to the community map pack. Running the script moves current custom levels into CMP and links the custom levels directory with appropriate permissions for adding new ones. Running the script again reverts the changes made.

Dependencies: Bash, sudo, sudo privileges.

Download.

GPL3

aur-sync

Install Arch Linux packages from AUR.

Usage: takes a list of package names to install or update; passing the '-f' option forces an update for packages already at the latest version. Passing no packages tries to update every foreign package currently installed (the output of pacman -Qmq).

Dependencies: Python 3.

Download.

BSD-new

flash

The Adobe Flash plugin for browsers no longer stores downloaded files (video, say) in /tmp: apparently, it creates them there, then deletes them straight away so that they exist only in memory. This means they can be accessed through /proc (part of the filesystem that exists only in memory). This script (of which the important part is something I found rather than wrote myself) finds those files and lets you run a program with them as an argument.

If the reason for doing this isn't clear: Flash video players are not as advanced as desktop ones. Besides demanding a lot more CPU time, they (at least, those I've come across) don't support things like a lot more keyboard shortcuts, frame advance, free resizing (and resizing in full-screen), disabling the audio and video independently, running faster or slower than real-time (with audio still intact), and whatever other wonderful things you like your desktop video player to do.

Usage:

flash

prints all available files (and their sizes) as numbers to use below.

flash num

prints file num and its size, if it exists.

flash num prog

runs the command prog num. So, for a video, you might do flash 17 vlc; or to copy a file to the current directory, try flash 17 "cp -t ." (17 seems to be the number given to the first file loaded for me, every time). Printing the actual filename of the file is as simple as flash 17 echo.

You might find it useful to have a Bash alias or function play the flash video with your default player; I use the following:

fl () {
    if [ -z "$1" ]; then
        n=`flash`
        if [ -z "$n" ]; then
            # nothing to play
            return
        else
            # play first video
            n=`echo $n | head -n1 | cut -d" " -f1`
        fi
    else
        # got video to play
        n=$1
    fi
    flash $n vlc
}

Then you can do fl to play the first file in VLC, if any, or fl num for any other number.

Dependencies: Bash.

Download.