Start rdesktop from a Gnome launcher

On Thursday I got a new PC and decided to really try to use Linux as my main operating system.

I’ve made abortive attempts before, but always ended up going back to Windows. I’m no Linux expert (I did use Unix a little as a user back in the 1980s, but never did any scripting or programming in it.)

So far it’s going reasonably well; I decided to try Linux Mint (11, x64) this time instead of Ubuntu – it has a lot of the necessary stuff (like Samba) needed to talk to Windows networks already installed.

One problem I had was I was unable to launch rdesktop (a RDP client) from a Gnome launcher. Nothing happens when I try – I still don’t know why.

I found a workaround – start it from a script launched from the Gnome desktop.

Here’s how. From a terminal window do:

cd ~
mkdir scripts
cd scripts
gedit startRDP.sh

Then paste the following into the file:

#!/bin/sh
# Usage: startRDP ipAddress[:port] [[username [password]]
# Free software by nerdfever.com. Public Domain. 2011-11-13.

if [ “$1” = “” ]; then
echo Usage: startRDP ipAddress[:port] [[username [password]]
return 1
fi

if [ “$2” = “” ]; then
padsp rdesktop -a 32 -g 95% -r clipboard:PRIMARYCLIPBOARD -r sound:local -x 0x80 $1
return 0
fi

if [ “$3” = “” ]; then
padsp rdesktop -a 32 -g 95% -r clipboard:PRIMARYCLIPBOARD -r sound:local -x 0x80 $1 -u $2
return 0
fi

padsp rdesktop -a 32 -g 95% -r clipboard:PRIMARYCLIPBOARD -r sound:local -x 0x80 $1 -u $2 -p $3
return 0

Save the file.

Then in the launcher on the desktop, put in the following command:

scripts/startRDP.sh 192.168.1.111 username password

Substitute the client machine’s IP address (and optionally :port) for 192.168.1.111.

Substitute your username/password for username and password. You can leave off password, or both username and password if you want to get prompted for these manually.

Leave a Reply

Your email address will not be published. Required fields are marked *