Name: Travis Hartwell
Member since: 2000-07-18 16:40:40
Last Login: 2006-12-06 04:04:38
Homepage: http://www.travishartwell.net/
Iswitch-window handler update
I keep meaning to announce that my iswitch-window deskbar handler as described here, has now been included in the core Gnome Deskbar Applet distribution, as seen in the 2.15.1 announcement. Any further changes or improvements will go directly into deskbar cvs.
Enjoy! Thanks Raph and team for a great project and including my contribution!
Syndicated 2007-07-27 00:46:00 from Travis B. Hartwell / Software Craftsman
Redirecting stderr and stdout to a file plus displaying them
It has taken me ages to figure this out. Googling has been fruitless. Finally, after some tinkering, I was able to figure out how to properly redirect stdout and stderr to a file plus display them from within a script. Here's the idiom:
#!/bin/bash
OUTPUT_LOG=output.log
OUTPUT_PIPE=output.pipe
if [ ! -e $OUTPUT_PIPE ]; then
mkfifo $OUTPUT_PIPE
fi
if [ -e $OUTPUT_LOG ]; then
rm $OUTPUT_LOG
fi
exec 3>&1 4>&2
tee $OUTPUT_LOG < $OUTPUT_PIPE >&3 &
tpid=$!
exec > $OUTPUT_PIPE 2>&1
echo "This is on standard out"
echo "This is on standard err" >&2
exec 1>&3 3>&- 2>&4 4>&-
wait $tpid
rm $OUTPUT_PIPE
It works but it might not be entirely correct, particularly the exec &> /dev/null. Improvements or suggestions are welcome.
Update: Figured it out. I had to store stderr and then restore stdout and stderr and close the fd that I stored them in.
Update update: Looked back and realized I had a typo on my first exec line.
Syndicated 2007-07-27 00:46:00 from Travis B. Hartwell / Software Craftsman
Quick pop-up of Tomboy notes
I've started using Tomboy to keep track of my tasks lists, to keep random notes, whatever. I've found it to be very useful.
I am always seeking to be more productive and find ways to reduce the amount of distraction in my life. One example: if I am in the middle of working on a project and remember I have to pick something up on my way home from work, I want to quickly jot that down so I don't forget. But I don't want to interrupt the concentration that I have on the task at hand. Tomboy is an ideal solution for this. I am trying to implement a GTD-like system, so I have a Tomboy note titled "GTD Inbox". The idea is to put all of those things that need to be processed and remembered in my "GTD Inbox" to be dealt with later.
Normally, to get to do this, I would have to click on the Tomboy icon in the notification area and select the note title. Alternately, I would hit Alt-F12 to pop up the same menu and move down with the arrow keys and hit Enter. If I am trying to minimize the interruption of the original task, that's too much. I'd rather rely on "muscle memory" -- something that is as natural as pressing Alt-Tab to switch between windows.
With the help of Alex Gravely (thanks Alex!), I was able to come up with a popup_note.sh that uses dbus-send to open up a specified note. With that, I could set a hotkey in Metacity for each of the important notes. For example, at work Windows-i opens "GTD Inbox", Windows-n opens "Next Actions" (my list of next actions for all of my projects, GTD-style), and Windows-t opens "Today" (my list of goals and tasks for the day).
So, back to my "remember to pick up the milk" example. All I'd do is hit Windows-i, type "Pick up Milk", and hit Escape. The Note goes away and I'm back at doing whatever I was doing previously. Wonderful.
To use the script, just pass the title of the note on the commandline, like so:
$ popup_note.sh GTD Inbox
If you want to set up global hotkeys in Metacity, do this:
$ gconftool-2 -t string -s /apps/metacity/global_keybindings/run_command_1 "<Mod4>i"
$ gconftool-2 -t string -s /apps/metacity/keybinding_commands/command_1 "popup_note.sh GTD Inbox"
Download popup_note.sh.
This and other scripts will be linked from my Random Code page. Hopefully something there will be useful.
Syndicated 2007-07-27 00:46:00 from Travis B. Hartwell / Software Craftsman
New Blog
I'm moving my blog from LiveJournal to my own domain. I'm using PyBlosxom, and so far I'm pretty pleased.
I plan on blogging more now that I have greater flexibility and control.
Watch this space.
<!-- ckey="2C693952" -->
Syndicated 2007-07-27 00:46:00 from Travis B. Hartwell / Software Craftsman
Handy script to search for and install Debian packages
I often find myself searching for a package with apt-cache search and then installing interesting matches with apt-get install. Whenever I find myself doing something over and over again, I want to automate it, to make it easier, faster, repeatable. To this end, I have come up with search_and_install.sh.
Some may say that I should just use synaptic or a similar tool. I find doing this is much quicker and easier to use for this use case. <h2>To Use</h2>
To use, just run search_and_install.sh or search_and_install.sh <search terms>. If you leave off the search terms, a dialog box will prompt you for the search terms. If there are matches, a dialog box will come up listing the matching packages with their name and the short description returned by apt-cache search. Each will have a checkbox beside it. Check the packages you want to install and then hit OK. You will then be prompted for your password (or your root password, if you are on a non-Ubuntu system), and synaptic will run, downloading and installing the selected packages.
<h2>Caveat</h2>
Currently, packages you already have installed are shown in the list. In future versions, I'd like to filter those out. <h2>Dependencies</h2>
bash, zenity, apt, synaptic, gksu
A standard Ubuntu install should have these, and these are easily installable on any other Debian-derived distro.
Download search_and_install.sh.
This and other scripts will be linked from my Random Code page. Hopefully something there will be useful.
Syndicated 2007-07-27 00:46:00 from Travis B. Hartwell / Software Craftsman
Nafai77 certified others as follows:
Others have certified Nafai77 as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!