
Various KDE 1.-4. Improvements
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
This little script on your ~/.bashrc will change the konsole session name on the fly. Also will put the remote host name if you connect it with ssh wraper kssh.
This can serve you to make more interesting things.
The screenshot is the original 5 minutes script.
16 years ago
0.21:
-Bug fix: now "really" works for root
0.2:
-No magic in konsole detection: use of KONSOLE_DCOP_SESSION enviroment variable
-Only change konsole name only when needed
-Implemented the wintermte's idea as a internal function. Called kssh
0.1:
-Initial release.
16 years ago
0.21:
-Bug fix: now "really" works for root
0.2:
-No magic in konsole detection: use of KONSOLE_DCOP_SESSION enviroment variable
-Only change konsole name only when needed
-Implemented the wintermte's idea as a internal function. Called kssh
0.1:
-Initial release.
marycstewart
1 year ago
Report
bk12
16 years ago
http://kde-look.org/content/show.php?content=6976
Report
Traktopel
16 years ago
Any ideas?
Report
mrthc
16 years ago
Report
romvinot
16 years ago
Could it be possible to get only the last 3 directories instead of the whole path (from $HOME) ?
Report
mrthc
16 years ago
Thanks
Report
pdreker
16 years ago
I have a rather deep directory structure here and using your script would sometimes rename my konsole session to e.g. "~/Desktop/Development/Debian/Packages/somepackage-1.2.3/debian" which is a little bit too long to be really useful (the tabs become really wide)...
Using only the last 2 or 3 components the session would be renamed to "Packages/somepackage-1.2.3/debian" or "somepackage-1.2.3/debian". Still rather long but better than the aforementioned name ;-)
One usually knwos where approximately one is in one's own dir structure, so one only needs a short reminder which session is where. The complete path is uneccessary IMO...
Report
wintermte
16 years ago
Try this in the .bashrc (mostly the same):
# Look if the parent is konsole
dcop konsole-$PPID &> /dev/null
if [ $? -eq 0 ]; then
#OK we are on konsole
PROMPT_COMMAND=touch_konsole
export INKONSOLE=$PPID
else
export INKONSOLE=0
fi#!/bin/sh
# Look if the parent is konsole
echo $INKONSOLE
if [ $INKONSOLE -gt 0 ]; then
#OK we are on konsole
CURRENT_SESSION=`dcop konsole-$INKONSOLE konsole currentSession`
dcop konsole-$INKONSOLE $CURRENT_SESSION renameSession "$1"
fi
/usr/bin/ssh -X $1 # the -X is optional
alias ssh="~/bin/ssh"
Create a script in ~/bin/ called ssh which contains:
#!/bin/sh
# Look if the parent is konsole
echo $INKONSOLE
if [ $INKONSOLE -gt 0 ]; then
#OK we are on konsole
CURRENT_SESSION=`dcop konsole-$INKONSOLE konsole currentSession`
dcop konsole-$INKONSOLE $CURRENT_SESSION renameSession "$1"
fi
/usr/bin/ssh -X $1
Report
aplsin
16 years ago
Btw, do you know if theres any way to make this work when you su to root too?
Report
mrthc
16 years ago
alias su="su -m"
like I have
Report
aplsin
16 years ago
Report