Mail from ILUG-BOM list (Non-Digest Mode)
_______________________________________________
Satya wrote:
>
> Mail from ILUG-BOM list (Non-Digest Mode)
> _______________________________________________
>
> What is the escape sequence to get a color border in a vterm?
>
> I figure a root login with a red border and a red cursor might be
> good. I've got the cursor, now how do I get the border?
If you're working out of xterm/eterm/gnome-terminal/putty/foo, put this
in your /etc/bashrc:
-----
if [ "$DISPLAY" = ":0" ] || [ "$DISPLAY" = ":1" ] \
|| [ "$DISPLAY" = ":0.0" ] || [ "$DISPLAY" = ":1.0" ];
then
PROMPT_COMMAND='echo -ne "\033]0;Terminal: \
${USER} in ${PWD}\007"'
else
PROMPT_COMMAND='echo -ne "\033]0;Terminal: \
${USER}@${HOSTNAME%%.*} in ${PWD}\007"'
fi
export PROMPT_COMMAND
fi
-----
I've tried to avoid wordwrap by splitting with \ characters. Please put
them back in one line. I recommend putting this code in the /etc/bashrc
file of all the machines you work on.
This code will change the title of the window to "Terminal: <your
username> in <current directory>". If you're on a remote shell, it uses
<username>@<hostname> instead (minus the full domain, that's what the
%%.* is for). Bash executes the command specified in PROMPT_COMMAND
before displaying the command prompt.
Makes it really easy to find the correct terminal window when you have a
dozen of them open.
The Helix GNOME tasklist applet shows a terminal icon for all
gnome-terminal windows. This makes the "Terminal: " part unnecessary and
cramped on the limited space each button has. For this, I use some
sawfish code to reverse the window title to read as "jace in /home/jace
- Terminal". Check the lisp repository link at sawmill.sourceforge.net.
Issue: "su" does not change the value of $USER. It correctly modifies
$UID though. Does anyone want to modify this code to retrieve the
correct username given UID?
--
Kiran Jonnalagadda
http://lunateks.com
baby.sh: while true; do echo "^G^G^G^G^G"; sed -e 's/food/poop/';
sync; sync; sleep 15; done
_______________________________________________
Website: http://www.ilug-bom.org.in/ilug
Linuxers mailing list
[EMAIL PROTECTED]
http://ilug-bom.org.in/mailman/listinfo/linuxers