Hello, and welcome to my blog! I post sporadically on random subjects from Linux to Emacs. Check out my tags if you want to browse posts on a specific subject.

If you want to be notified about new posts, this blog has an Atom feed feed. However, unless you want to read my every rant, you may want to subscribe specific tags instead, each of which has its own Atom feed. Most feed readers will correctly deduplicate entries so you shouldn’t run into any issues if you subscribe to multiple tags.

Make Gksu and Policykit red

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

I was bored one day and decided to make my gksu(do) and policykit dialogs red. The results are actually quite nice.

Add this to the bottom of your gtkrc file:

style "gksu" {
    bg[NORMAL] = "#770000"
    bg[ACTIVE] = "#550000"
    bg[PRELIGHT] = "#990000"
    bg[SELECTED] = "#550000"
    bg[INSENSITIVE] = "#220000"
}

widget "GksuuiDialog*" style "gksu"widget "PolkitGnomeAuthenticationDialog*" style "gksu"

Packagekit with apturl

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

Although I no longer use packagekit, I still have my apturl script so I thought I would post it. This script will allow you to open apt:// scripts with packagekit. (Just save this to a file, mark it executable, and tell your browser to open apt scripts with it).

#!/bin/bash
/usr/bin/gpk-install-package-name $(echo $* | sed -e 's/apt:\/\?\/\?//')

Useful Bash functions

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

cdd: cd and list the files.

function cdd(){ cd $*  ls --color}

changelog: get the change log for a program

changelog() {
    log=/usr/share/doc/"$*"/changelog*
    if [ -r $log ]; then
        less $log
        unset log
    else
        log=/usr/share/doc/"$*"/CHANGELOG*
        if [ -r $log ]; then
            less $log
        fi
    fi
}

mkdircd: make a directory and move in.

function mkdircd() {
  mkdir $* cd ${!#}
}

Screenshot of Arch

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

I have been trying Arch Linux in VirtualBox and will probably switch when I get around to it (or at least duel boot along with Ubuntu).

Here is what it looks like so far; if you have any questions about tools, configs, etc., ask and I will post.

Kupfer Plugins

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

After getting frustrated with GNOME-Do’s memory hogging, I switched to Kupfer. Kupfer is a lightweight, extensible application launcher like Do (as it is now called) but much more powerful and easier to extend (it is written in python).

My Plugins

So far, I’ve written the following plugins:

  1. gwibber\_plugin.py: This plugin allows you to send messages from Kupfer through Gwibber (with no configuration).

  2. exaile\_plugin.py: This plugin allows you to pause, play, skip, and go backwards in Exaile. It is based on the Rhytmbox plugin.

+1: evolution\_plugin.py: I did not write this plugin (although I did do a fair bit of editing). The Evolution plugin adds an evolution contact source (and works with the built in email plugin).

Download: kupfer-plugins.tar.gz

Start conky only after the root window loads

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

Every time I logged in, conky would start up before nautilus loaded the desktop. This caused conky to load as a floating window that stayed on top of all other windows. I have finally gotten around to fixing this problem.

Here (gone, email if found) is a simple python script that waits for nautilus to load the desktop before starting conky.

I stored the script referenced in this post in a paste-bin and now it’s gone. Live and learn…

This script is probably very inefficient but it gets the job done.

Humanity Icon for Caffeine

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

For those who don’t know, Caffeine is a small program for Linux that lets a user prevent his or her computer from entering a power save state. If a user wishes, he or she can even configure caffeine to automatically inhibit power-saving when watching a flash movie, or running VLC, Totem etc. For more information, visit its website here.

As a user of both Caffeine and the new Humanity icon theme (the default icon theme in karmic), I made a very basic gray-scale version of the Caffeine icon. You can download it here.

Service Manager for Karmic

> Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

Annoyingly, as karmic has mostly switched to Upstart, it does not include a service manager. While I hope that the gnome service-manager will be updated to include support for upstart soon I have, for the interim, written a very simple service manager.

Be warned: When I say “very simple” I mean “very simple, noob unfriendly, and potentially dangerous”. While it should not harm your computer, I make no guarantees because it is my first PyGTK program and was written in my spare time over a couple of days. A word of warning, the code is very messy and inefficient (understatement).

Link

New Desktop Theme

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

Just in case anyone is interested, here is my new desktop layout.

Screenshot

This theme works with 1280x800 screens. (If you have a different size screen, you will have to modify it)

Download: theme.tar.gz

Font: Droid Sans

Panel: tint2

  • Install from this PPA
  • The tint2rc file (from my theme package) to “~/.config/tint2/”

Background: custom (includes panel and conky backgrounds)

  • Either use my background (background.png) or replace the background layer in background.xcf with your own image and save it as a png.

Conky:

System Information and Calendar.

You can find them in the theme package.

To install:

  • Create a new folder “~/.conky/”
  • Copy “cal.conkyrc”, “cal.py” and “system.conkyrc” to “~/.conky/”
  • Add a new startup item sh -c "conky -d -c ~/.conky/system.conkyrc; conky -d -c ~/.conky/cal.conkyrc"

Theme:

  • Metacity: Nooto
  • GTK2: Ghostship
  • Icons: Elementary

Write a file as root from a non-root vim.

Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.

Problem

I often edit config files in vim, try to save them, and then realize that I ran vim as a normal user and the config file is in /etc. In the past I would close vim and redo all of my changes as root (using sudo). This is a real pain especially if I had made a lot of changes.

Solution

Add the following to your ~/.vimrc:

cmap w!! w !sudo tee % >/dev/null<CR>:e!<CR><CR>

A while ago I came across this post that describes how to save a file as root from a non-root vim by adding cmap w!! w !sudo tee % >/dev/null to my .vimrc.

The problem is that, after running this command, vim will notice that the file has changed on disk and ask the user if he or she wants to reload it. After a while this got annoying, therefore the multiple CRs (enters) and the :e! (reloads the file).