Re: [gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-07 Thread Martins Steinbergs
On Friday 06 October 2006 04:15, James wrote:
 Martins Steinbergs mar at ml.lv writes:
  This konsolescript does what you need. Logging to remote it shows on tab
  user at host , on local it shows user or programm runing.
 
  http://www.kde-apps.org/content/show.php?content=43873

 OK, I got this installed. It spits out a bunch of parameter readings
 like:



 ssh: KONSOLESCRIPTS_KONSOLE_sessionName: Name or service not known

snip

 Password:
 Last login: Thu Oct  5 21:54:10 2006 from 192.168.2.23



 But puts nothing in the tab. Any ideas what I'm missing


 James

here it works ok, have you got dcoprss installed?

martins
-- 
gentoo-user@gentoo.org mailing list



[gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-06 Thread James
Bo Ørsted Andresen bo.andresen at zlin.dk writes:


 To get only the hostname (\h is substituted with the hostname as you can read
 in `man bash`) ...

 # export PS1=$PS1'\[\033]0;\h\007\]'

Well I tryied this command by puting it in the .bashrc file on both
the host system and the target remote. It did not alter the
kde-session-tab at all. Then I tried just issuing the command
from the CLI and it did nothing either. So I'm not sure
I'm trying this solution as intended.


 Or for the ip you can try this evil command... ;) (it depends on
 sys-apps/iproute2 and will be overridden by $PS1 -- try in another terminal if
 you just typed the above command) ...
 
 # export PROMPT_COMMAND=ip -o -4 addr show scope global | sed -r 's/.*
([12]?[0-9]?[0-9](\.[12]?[0-9]?[0-9]){3})\/.*/\x1b]0;\1\x7/'

From the command line I get this error:
bash: ip: command not found

 Anyway, what's wrong with Mike Williams' suggestion? That's works fine for me.

OK, I'm going to respond to this, directly from Mike's email. I had
not gotten around to trying what he suggested, yet.


James






-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-06 Thread Bo Ørsted Andresen
On Friday 06 October 2006 13:18, James wrote:
  To get only the hostname (\h is substituted with the hostname as you can
  read in `man bash`) ...
 
  # export PS1=$PS1'\[\033]0;\h\007\]'

 Well I tryied this command by puting it in the .bashrc file on both
 the host system and the target remote. It did not alter the
 kde-session-tab at all. Then I tried just issuing the command
 from the CLI and it did nothing either. So I'm not sure
 I'm trying this solution as intended.

Are you absolutely certain that this option is enabled:

Settings - Configure Konsole - General - 
Set tab title to match window title

? And make sure you don't make a typo...

Try it in e.g. an xterm also. You should see your hostname in the title. It 
works for me at least...

  Or for the ip you can try this evil command... ;) (it depends on
  sys-apps/iproute2 and will be overridden by $PS1 -- try in another
  terminal if you just typed the above command) ...
 
  # export PROMPT_COMMAND=ip -o -4 addr show scope global | sed -r 's/.*
 ([12]?[0-9]?[0-9](\.[12]?[0-9]?[0-9]){3})\/.*/\x1b]0;\1\x7/'

 From the command line I get this error:
 bash: ip: command not found

Uh, I forgot that I have created this symbolic link to allow users to execute 
ip (without giving the full path):

# ls -l /bin/ip
lrwxrwxrwx 1 root root 8  1 jun 11:28 /bin/ip - /sbin/ip

Prepending the command by /sbin/ should work too (if sys-apps/iproute2 is 
installed).

-- 
Bo Andresen


pgpfd2yOfKeoA.pgp
Description: PGP signature


[gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-06 Thread James
Bo Ørsted Andresen bo.andresen at zlin.dk writes:


 Are you absolutely certain that this option is enabled:

 Settings - Configure Konsole - General - 
 Set tab title to match window title

 ? And make sure you don't make a typo...

yes, absolutely certain.

 Try it in e.g. an xterm also. You should see your hostname in the title. It 
 works for me at least...

yes the hostname is work. What I could not get working is just
the ip address.

 

thanks very much Bo, the hostname is working. 
I'll live with that for now.


James


-- 
gentoo-user@gentoo.org mailing list



[gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-05 Thread James
Bo Ørsted Andresen bo.andresen at zlin.dk writes:


 Heh, and then I find the setting: Settings - Configure Konsole - General - 
 Set tab title to match window title. :p


Hello Bo,

This works very good, but it's a bit long.
I prefer just the host name or  just the ip address. Using this technique
I get something like this:
[EMAIL PROTECTED]:~/projects/manuals - Shell

Is it way to long.

I think I'll keep searching for a way to just either the hostname
or the IP in the tab

thanks.

James






-- 
gentoo-user@gentoo.org mailing list



[gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-05 Thread James
Martins Steinbergs mar at ml.lv writes:

 This konsolescript does what you need. Logging to remote it shows on tab 
 user at host , on local it shows user or programm runing.

 http://www.kde-apps.org/content/show.php?content=43873


OK, I got this installed. It spits out a bunch of parameter readings
like:



ssh: KONSOLESCRIPTS_KONSOLE_sessionName: Name or service not known
ssh: KONSOLESCRIPTS_getCommand: Name or service not known
ssh: type: Name or service not known
bash: [: missing `]'
bash: function: command not found
konsole-12133
konsole-12134
kwin
kicker
kded
knotify
korgac
klauncher
khotkeys
kdesktop
klipper
ksmserver
kaccess
bash: DCOPRef(konsole-12133,session-2): command not found
konsole-12133
konsole-12134
kwin
kicker
kded
knotify
korgac
klauncher
khotkeys
kdesktop
klipper
ksmserver
kaccess
bash: DCOPRef(konsole-12133,session-2): command not found
Password:
Last login: Thu Oct  5 21:54:10 2006 from 192.168.2.23



But puts nothing in the tab. Any ideas what I'm missing


James



-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-05 Thread Bo Ørsted Andresen
On Friday 06 October 2006 02:41, James wrote:
 This works very good, but it's a bit long.
 I prefer just the host name or  just the ip address. Using this technique
 I get something like this:
 [EMAIL PROTECTED]:~/projects/manuals - Shell

To get only the hostname (\h is substituted with the hostname as you can read
in `man bash`) ...

# export PS1=$PS1'\[\033]0;\h\007\]'

Or for the ip you can try this evil command... ;) (it depends on
sys-apps/iproute2 and will be overridden by $PS1 -- try in another terminal if
you just typed the above command) ...

# export PROMPT_COMMAND=ip -o -4 addr show scope global | sed -r 's/.* 
([12]?[0-9]?[0-9](\.[12]?[0-9]?[0-9]){3})\/.*/\x1b]0;\1\x7/'

(If anyone knows a better way to get the ip and only the ip I'm interested...)

Anyway, what's wrong with Mike Williams' suggestion? That's works fine for me.

-- 
Bo Andresen


pgpyJbYsz3ISl.pgp
Description: PGP signature


Re: [gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-04 Thread Etaoin Shrdlu
On Wednesday 4 October 2006 03:57, james wrote:

 Well when I ssh into a remote system, bash detects this (hostname)
 and displays the hostname in the prompt(command line)
 automatically. So it is possible,

I'd say that you got the remote hostname in the prompt because you are in 
effect running bash *on the remote system* and seeing its output, not 
because bash detects the hostname.
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-04 Thread Bo Ørsted Andresen
On Wednesday 04 October 2006 22:51, Boyd Stephen Smith Jr. wrote:
 You may be able to put some magic into your PS1 to send the right escape 
code(s) to your terminal to set the window title xterm and/or screen style.

http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/xterm-title-bar-manipulations.html

 konsole uses the window title to set the tab text.

It does?? Not on my system.

-- 
Bo Andresen


pgpxNFgxBl0Hp.pgp
Description: PGP signature


Re: [gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-04 Thread Neil Bothwick
On Thu, 5 Oct 2006 00:01:45 +0200, Bo Ørsted Andresen wrote:

  konsole uses the window title to set the tab text.  
 
 It does?? Not on my system.

Probably because you haven't ticked the Set tab title to match window
title box.


-- 
Neil Bothwick

Yeah, but you're taking the universe out of context!


signature.asc
Description: PGP signature


[gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-04 Thread Michael Mauch
james wrote:

 Well when I ssh into a remote system, bash detects this (hostname)
 and displays the hostname in the prompt(command line) 
 automatically. So it is possible, another way to pose the question
 is how to transfer this information 'automatically' from bash
 to the kde-session-tab-name?

You can set the tab title of konsole with something like

setkonsoletabtitle () {
echo -en \e]30;$*\a
}

For ssh I have another shell function:

ssh () {
setkonsoletabtitle $1
command ssh $@
cd .
# that sets the tab title back to the normal local look here
}

Of course this only works nicely if you use ssh host or ssh
[EMAIL PROTECTED] and not ssh -l user host.

Regards...
Michael
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-04 Thread Boyd Stephen Smith Jr.
On Wednesday 04 October 2006 17:15, Bo Ørsted Andresen 
[EMAIL PROTECTED] wrote about 'Re: [gentoo-user]  Re: OT: auto rename 
konsole session tabs?':
 On Thursday 05 October 2006 00:01, Bo Ørsted Andresen wrote:
   konsole uses the window title to set the tab text.
  It does?? Not on my system.
 Heh, and then I find the setting: Settings - Configure Konsole -
 General - Set tab title to match window title. :p

To be fair, I'd completely forgotten about that option and would have 
qualified my statement with that information if I had remembered.

-- 
If there's one thing we've established over the years,
it's that the vast majority of our users don't have the slightest
clue what's best for them in terms of package stability.
-- Gentoo Developer Ciaran McCreesh


pgpMF0sDhZYIz.pgp
Description: PGP signature


[gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-03 Thread Harm Geerts
On Tuesday 03 October 2006 19:04, James wrote:
 Hello

 OT:  I use kde and quite a lot of konsole sessions for  admin of many other
 systems.  I currently manually use 'rename' in kde to put the system's
 hostname into the tab (located at the bottom of the window), for quick
 reference. Is there a way (trick) to automatically do this?

 My prompt (command line) does this automatically, I just want the hostname
 of the remote host(or IP address)  I ssh into to replace the 'shell #'
 that is there by default. If not ssh'd into a remote system, then the
 default 'shell #' is ok as the default.

Not sure if you can rename them based on what you run in the session.
But you can name them when you start a session.

Click on the menu entry Settings-Configure Konsole
Choose the Session tab.

Create a new session for each remote machine

Name is used in the tabname, so you can enter the hostname.
Execute is used to start the session, if you want to start ssh directly 
enter ssh host here.

There are a few examples present you can look at.
You probably haven't used them yet, otherwise you wouldn't be asking this :)

When you want a new session you should choose the session you configured 
instead of the default session named Shell.
-- 
gentoo-user@gentoo.org mailing list



[gentoo-user] Re: OT: auto rename konsole session tabs?

2006-10-03 Thread james
Harm Geerts harmgeerts at home.nl writes:


  OT:  I use kde and quite a lot of konsole sessions for  admin of many other
  systems.  I currently manually use 'rename' in kde to put the system's
  hostname into the tab (located at the bottom of the window), for quick
  reference. Is there a way (trick) to automatically do this?

  My prompt (command line) does this automatically, I just want the hostname
  of the remote host(or IP address)  I ssh into to replace the 'shell #'
  that is there by default. If not ssh'd into a remote system, then the
  default 'shell #' is ok as the default.

 Not sure if you can rename them based on what you run in the session.
 But you can name them when you start a session.

Well when I ssh into a remote system, bash detects this (hostname)
and displays the hostname in the prompt(command line) 
automatically. So it is possible, another way to pose the question
is how to transfer this information 'automatically' from bash
to the kde-session-tab-name?

 Click on the menu entry Settings-Configure Konsole
 Choose the Session tab.
 Create a new session for each remote machine
 Name is used in the tabname, so you can enter the hostname.
 Execute is used to start the session, if you want to start ssh directly 
 enter ssh host here.
 There are a few examples present you can look at.
 You probably haven't used them yet, otherwise you wouldn't be asking this :)
 When you want a new session you should choose the session you configured 
 instead of the default session named Shell.

Yes, but if I ssh into a new system with a previoulsly unknow name or IP, 
then I have to manually change this information?  If that is true, then
it is not what I want/need. I need auto_discovery of either the hostname
or IP address of the remote target, passed to the kde-session-tab-name.
That's the challenge. It's for newly installed machines with
new names and IP. Or some remote machine, I have never ssh'd into before.
Furthermore, as the list grows very large, I it will become a pain doing this
before remote access. Many are gentoo based but other are not. I can modify
some files on the remotes, if necessary, but many will only be remotely
admin'd one or twice a year (hopefully).

Auto_magically maybe it's easier to auto_magically discover (pass) 
the remote's ip address to the kde-session-tab-name parameter?


James




-- 
gentoo-user@gentoo.org mailing list