$ firefox
You get a bunch of X and Gtk warnings during execution of Firefox, and you can't use that shell anymore. You have to open another tab in konsole. So, this script I wrote is called "sex" for "silent execute." Mainly for the brevity and the humor of having
$ sex dolphin
be a valid command. This script also allows parameters to be sent correctly to an executable, so
$ sex okular A\ document\ with\ spaces.pdf
opens "A document with spaces.pdf" in okular correctly.
#!/bin/sh
CONCAT="${1}"; shift
for ARG in "$@"; do
CONCAT="${CONCAT} \"${ARG}\""
done
eval "$CONCAT >> /dev/null 2>&1 &"
Simply put this in /usr/bin/sex (need root) and do a chmod +x /usr/bin/sex. I recommend adding
alias ff='sex firefox'
to your ~/.bashrc or your /etc/bash.bashrc too. It's a nice shortcut.
1 comment:
If you want a way to run something without it cluttering your current terminal you may be interested in the screen command. It is kind of like a bg/fg or nohup on steriods, allowing multiple windows within one terminal, and a detach reattach capability.
screen -q
gets you started. You can kill that terminal and
screen -ls
gets back all your screen windows.
For what you are describing you can create aliases that start stuff in their own screen windows such as:
# cat `which stv`
#/usr/bin/ksh
cd
screen -t $1 ctsetview -cdtop $1
(something I use at work). I've been meaning to write a blog post on this great tool since I've been blogging about perl and shell stuff as well as my math and physics play... I managed to go 8 years working with Unix every day without knowing about screen, and can't imagine life without it anymore!
Post a Comment