[Konsole-devel] [Bug 80235] New: Want way to find session name from shell

Rob Sims robsims at fc.hp.com
Fri Apr 23 21:30:27 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=80235      
           Summary: Want way to find session name from shell
           Product: konsole
           Version: unspecified
          Platform: Debian stable
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
        AssignedTo: konsole-devel kde org
        ReportedBy: robsims fc hp com


Version:            (using KDE KDE 3.2.0)
Installed from:    Debian stable Packages
OS:          Linux

When I log in to KDE, my desktop is restored complete with tab names.  I would like to use those tab names to modify each shell's startup behavior.  I can find the name of all sessions that the parent konsole contains (see below), but can't quite associate the shell with a particular tab.  One possible fix is to add the ability to fetch the shell PID per session vi DCOP.
============================
#!/bin/sh

SHELLPID=`ps -p $$ -l | tail -1 | awk "{ print \\\$5 }"`
KONSPID=`ps -p $SHELLPID -l | tail -1 | awk "{ print \\\$5 }"`

#printf "Shell is $SHELLPID, konsole is $KONSPID\n"

SESSIONS=`dcop konsole-$KONSPID | grep ^session`

for SESSION in $SESSIONS; do
  SNAME=`dcop konsole-$KONSPID $SESSION sessionName`
  # Nice to have:
  # SPID=`dcop konsole-$KONSPID $SESSION sessionPID`
  echo Session $SESSION name is $SNAME
done



More information about the konsole-devel mailing list