pbrisbin dot com
XMonad Scratchpad
Apr 10, 2010
It’s been a while since I’ve made an XMonad post. Thought a good one might be details regarding the scratchpad extension from -contrib. This can be confusing to set up, but oh-so useful. If you’ve ever used a quake (or yakuake?) terminal (I have not), you’ll know what I’m talking about. It’s a small terminal that sits idle on a non-visible workspace. You can call it up with a quick keybind, use it for whatever, then banish it away again with the same keybind.
Controlling MPlayer
Apr 8, 2010
MPlayer 🔗MPlayer is an extremely versatile media player, I’ve begun to use it for absolutely any media that I’m not already piping through mpd. One day while going through my XMonad config, I decided it’d be convenient to bind my media keys to control MPlayer. I already had them bound to control volume/mpd, but I figured Meta + key combinations could be the MPlayer equivalents.
A bit of googling later and I had the solution: a fifo!
Irssi
Mar 20, 2010
Irssi is an IRC client. If that sentence made no sense, then read no further. This post outlines my current irssi setup as I think it’s quite nice and others may wish to copy it.
Note: I’ve since moved to weechat. If anyone’s interested, that config can be found [here][weechat]. Screenshot 🔗 Config 🔗For the longest time I didn’t really touch ~/.irssi/config except to set up auto connections etc. Then I started using awl.pl (which I’ll describe in the scripts section). This meant I no longer had a use for one of the statusbars. So for the sake of completeness, here is the change I made to get the statusbar look you see in the screenshot:
Automounting
Jan 12, 2010
It seems as users (myself inclusive) progress through the stages of using a distribution like Arch linux, they reach certain stages. Like when you realize how amazing find -exec is. Or crossing over from god, vim is a pain in the ass! to jesus, why doesn’t everyone use this?
I find one well-known stage is how can I automount my USB drives? This usually comes early on as a new Arch user ditches GNOME or KDE in favor of something lighter, something more minimalistic, something they can actually be proud to show off in the screenshot thread. Well, ditch the DE and you lose all those nifty little automagical tools, like gnome-volume-manager and the like.
Backups
Jan 3, 2010
This post is very out of date. The scripts which are its subject no longer exist as I now use two much simpler scripts which can be found in my scripts repo. Backups are extremely important. In linux, with a little effort and hardrive space, one can easily come up with a fully automated backup solution to suit any needs. Here, I’d like to outline my setup. Feel free to take it and adapt to your needs.
Aurget
Dec 5, 2009
A simple pacman-like interface to the AUR written in bash.
About 🔗Aurget is designed to make the AUR convenient and speed up tedious actions. The user can decide to search, download, build, and/or install packages consistently through a configuration file or dynamically by passing arguments on the command-line.
Sourcing user-created PKGBIULDs comes with risks. Please, if you’re worried about this, be sure to view all PKGBUILDs before proceeding.
You have been warned.
Display Manager
Dec 5, 2009
GDM, KDM, SLiM; they all serve one purpose: accept a username/password and start X. The below accomplishes the same in the cleanest, simplest, most transparent way I know.
# Note: a $SHELL of either bash or zsh is assumed if [[ $TTY == /dev/tty1 ]] && [[ -z $DISPLAY ]]; then exec startx fi These are the last lines of my ~/.zprofile, but they would work as well in ~/.bashrc if that’s your preferred shell.
One added benefit here is that if X dies for any reason, you aren’t left logged in on tty1 like you might be using some other display managers. This is since the built-in exec replaces the current process with the one specified.
Downgrade
Dec 5, 2009
Downgrade eases downgrading packages in Arch Linux.
Examples 🔗Downgrade some packages, checking both local cache and the A.R.M.:
$ downgrade foo bar Downgrade a package, looking in only local cache:
$ NOARM=1 downgrade foo Downgrade a package, looking in only the A.R.M.:
$ NOCACHE=1 downgrade foo Downgrade a package, looking only in local cache, and favoring su over sudo even when sudo is available:
$ NOARM=1 NOSUDO=1 downgrade foo Installation 🔗Install the AUR package here.
For more details, reporting Issues, etc, see the GitHub project.
Dvdcopy
Dec 5, 2009
Do not use this for bad things, m’kay? What it looks like 🔗 Usage 🔗usage: dvdcopy [ --option(=<argument>) ] [...] ~/.dvdcopy.conf will be read first if it's found (even if --config is passed). for syntax, see the help entry for the --config option. commandline arguments will overrule what's defined in the config. invalid options are ignored. options: --config=<file> read any of the below options from a file, note that you must strip the '--' and set any argument-less options specifically to either true or false there is no error if <file> doesn't exist --directory=<directory> set the working directory, default is ./dvdcopy --keep_files keep all intermediate files; note that they will be removed the next time dvdcopy is run regardless of this option --device=<file> set the reader/burner, default is /dev/sr0 --title=<number> set the title, default is longest --size=<number> set the desired output size in KB, default is 4193404 --limit=<number> set the number of times to attempt a read/burn before giving up, default is 15 --mpeg_only stop after transcoding the mpeg --dvd_only stop after authoring the dvd --iso_only stop after generating the iso --mpeg_dir=<directory> set a save location for the intermediate mpeg file, default is blank -- don't save it --dvd_dir=<directory> set a save location for the intermediate vob folder, default is blank -- don't save it --iso_dir=<directory> set a save location for the intermediate iso file, default is blank -- don't save it --mencoder_options=<options> pass additional arbitrary arguments to mencoder, multiple options should be quoted and there is no validation on these; you'll need to know what you're doing. the options are placed after '-dvd-device <device>' but before all others --quiet be quiet --verbose be verbose --force disable any options validation, useful if ripping from an image file --help print this What’s it do? 🔗Pop in a standard DVD9 (~9GB) and type dvdcopy. The script will calculate the video bitrate required to create an ISO under 4.3GB (standard DVD5). It will then use mencoder to create an authorable image and burn it back to a disc playable on any standard player.
Goodsong
Dec 5, 2009
If you’re like me, (which you’re probably not…) you enjoy listening to your music with the great music playing daemon known as mpd. You also have your entire collection on shuffle.
Occasionally, I’ll fall into a valley of bad music and end up hitting next far too much to get to a good song. For this reason, I wrote goodsong.
What is it? 🔗Essentially, you press one key command to say the currently playing song is good; then press a different key to say play me a good song.