wissel.net

Usability - Productivity - Business - The web - Singapore & Twins

Command line tool for Linux command line junkies


I found a little gem for "Friends of the commandline" TM . Since the autor suggested to improve this with zenity I went ahead and created ~/bin/runthis:
#!/bin/sh
#~/bin/runthis
############################################################################
# Runs the command on the command line or prompts that have been entered in the prompt box
# Originally published here: http://crunchbanglinux.org/forums/topic/2848/bash-at-your-fingertips-nifty-notifysend/
# Replaced command line with zenity dialog
############################################################################
if [ -z "$1" ]; then
    what=$ (zenity   --entry   --text "Type a command" );
else
    what= $1
fi
info=$ ( eval "$what"   2 > /dev /null );
notify-send -t $ ( ( 1000+ 300 *` echo -n $info | wc -w ` ) ) -u low -i gtk-dialog-info "$what" "$info" || exit 2
Make it executable with chmod +r ~/bin/runthis. Final step: go to the CompitzConfig Settings Manager (or the Gnome shortcut settings) and assign it a key combination (I use Ctrl+Alt+r). Now you can hit the combination, enter a command and the result will be shown in a notification dialog. For the rationale, read the original source
As usual YMMV

Posted by on 19 July 2010 | Comments (0) | categories: Linux

Comments

  1. No comments yet, be the first to comment