dcop: tool for controlling stuff, like Konsole
Submitted by rob on Sat, 2009-04-04 23:19
KDE uses DCOP as its tools for automating the interface in KDE 3.X. In KDE 4.X, DBUS is used instead. I use the following program to connect to machines in a "build" network at work. As you can see, it saves some typing, but more important, it shows the name of the machine on the Konsole tab.
#!/bin/bash
set -ue
function usage() {
echo Usage: $0 computername
echo " -" $0 will renamethe current tab after the machine, and ssh to it
echo
exit 1
}
if [ $# -eq "0" ]
then
echo Error: Please supply the computer name
echo
usage
fi
computer=$1
konsole=$( echo $KONSOLE_DCOP | sed 's/.*(\([^,]\+\).*/\1/' )
echo Connecting to: ${computer}.build
session=$( dcop $konsole konsole currentSession )
dcop $konsole $session renameSession $computer
ssh sxdev@${computer}.build
dcop $konsole $session renameSession "shell (was $computer)"
»
- rob's blog
- Login or register to post comments
