You are not logged in.
Pages: 1
Topic closed
Does anyone know how I could set urxvt's title set to say my $PS1, I tried declaring it in my .XDefaults but it literally says echo $PS1 in the title when I do that....
Or also I remember when I used xfce4-terminal I think it showed dynamically what was going on in the term title, is this achievable somehow?
I'm bash btw.
Thanks,
bladdo
Last edited by bladdo (2008-05-11 00:42:27)
bladdo / mil / Miles
userbound.com - blog and projects
Offline
Try putting echo -ne "\033]0;${USER}@${HOST}\007" somewhere it might get executed when the terminal is started.
Offline
I have in my .bashrc:
# Change the window title of X terminals
if [[ $TERM =~ "xterm|*rxvt*" ]]; then
# set -o functrace
trap 'set_title' DEBUG
fi
I 'm sorry - I do not remember from where I grabbed it... Anyway - my urxvt window titles are changing dynamically. Don't forget to source your .bashrc after editing it though...
I hope it will help you,
tami
"Possession means worries and luggage bags one has to drag along." Little My
Offline
Maybe this section from the bash-prompt howto helps. You should also read the next page if u use screen in you urxvt.
I haven't tried it myself, but i think it should work if you change
case $TERM in
xterm*)
into
case $TERM in
xterm*|*rxvt*)
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
Hi! I have this is my .bashrc and it works great.
PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$ \[\e[m\]\[\e[1;37m\] '
# X Terminal titles
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac
Look at my dotfiles.org folder for more configs: http://dotfiles.org/~paralaX/
Last edited by paralax (2008-05-09 08:22:21)
Offline
its already in /etc/profile.bash
Last edited by dolby (2008-05-09 15:45:37)
There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums. That is why we avoid it. -- ewaller (arch linux forum moderator)
Offline
Thanks I got it working but I wanna add in another feature.
I'm trying to make it so I can see the tty in the title too, but its not quite working I don't know bash that well so bare with me.
PS1='[\[\033[1;31m\]\u@\h \[\033[1;34m\]$(/usr/bin/tty | /bin/sed -e '\''s:/dev/::'\'')\[\033[0m\]] \[\033[0m\]'
TTY='$(/usr/bin/tty | /bin/sed -e '\''s:/dev/::'\'')\';
export BROWSER='firefox'
export EDITOR=vim
export PS1
export TTY
# urxvt title
case "$TERM" in
xterm*|rxvt-256color)
PROMPT_COMMAND='echo -ne "${TTY}\\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac
And it errors out and the title is set to default again.
Thanks,
bladdo
bladdo / mil / Miles
userbound.com - blog and projects
Offline
I have in my .bashrc:
# Change the window title of X terminals if [[ $TERM =~ "xterm|*rxvt*" ]]; then # set -o functrace trap 'set_title' DEBUG fi
I 'm sorry - I do not remember from where I grabbed it... Anyway - my urxvt window titles are changing dynamically. Don't forget to source your .bashrc after editing it though...
I hope it will help you,
tami
At first I settled for it just showing my username/host/pwd in the titlebar. Then I really wanted dynamic, I looked and everywhere I saw online it said it was only achievable through zsh. Tami, your code error'd my term for some reason.
Eventually I found out how to do it
# urxvt title
case $TERM in
rxvt-256color)
trap 'echo -ne "\e]0;$USER@$HOSTNAME: $BASH_COMMAND\007"' DEBUG
;;
esac
Will display as :
user@host: command
PWD and TTY can be added in but it looks to stuffed then in my opinion. Just change the rxvt-256color to any term and it should work for you too
-bladdo
bladdo / mil / Miles
userbound.com - blog and projects
Offline
At first I settled for it just showing my username/host/pwd in the titlebar. Then I really wanted dynamic, I looked and everywhere I saw online it said it was only achievable through zsh. Tami, your code error'd my term for some reason.
After posting and reading the tread I found out that actually, as others pointed out, the function to show dynamically working directory is set system-wide in Arch. Posted by me function from .bashrc ("heritage" from previous installations of other distro) doesn't "spit out" any errors here. (The reason perhaps is that I'm not running rxvt-unicode-256color from AUR - only simple rxvt-unicode from extra - but: this is just a guess! I really did not want to confuse you or your system! ). So - sorry if it errors at your place. I also probably misunderstood what you really needed...
Anyway - I'm glad you found out yourself how to achieve the effect you wanted.
Have a nice day,
tami
"Possession means worries and luggage bags one has to drag along." Little My
Offline
PROMPT_COMMAND='DEFTITLE="${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}"; echo -ne "\033]0;${TITLE:-$DEFTITLE}\007"'
this way i just have to set $TITLE and if i unset it, it goes back to whatever DEFTITLE is
☃ Snowman ☃
Offline
bloom,
thanks for the info, but this thread is fairly old and thus should not be necrobumped: https://wiki.archlinux.org/index.php/Fo … Bumping.27
Closing
To know or not to know ...
... the questions remain forever.
Offline
Pages: 1
Topic closed