I love Linux, but as we all know we have to work on windows computers usually on a day-to-day basis. We have servers we constantly have to RDP (remote desktop) into to work with active directory, etc. The Terminal server client in 10.04 was all buggy and when you closed the window it would reconnect in 30 seconds. This was especially annoying when you left a session open on your locked computer on the other side of the building and needed to hop on real quick to do something.
I found out that the problem was that certain libraries had bee updated and caused this bug. I decided using rdesktop for a while would suffice and created a launcher on my panel to run this command. It wasn’t pretty for the longest time, a bash terminal asking for usernames, etc. I really didn’t like it. I stumbled across zenity a while ago and decided to use that to hide the password and pass that to the rdesktop command. It is pretty simple actually.
I prefer to hard-code my username and domain in so that I don’t have to constantly fill it out, however more zenity windows could easily be added if more security or flexibility would be needed. I saved this into a script, made it executable, and then created a launcher to run the script. I haven’t spent much time on it but I could not just put this code into a launcher and run it (on XFCE, I suppose other frontends like gnome2 or unity might work).
rdesktop -u <Username> -d <domain> -g 1280x1024 $(zenity --entry --text="Hostname/IP please...") -p $(zenity --password --text="Password Please...")
The code above in a launcher provides these dialogue boxes:
Zenity provides a lot of flexibility in bash scripting so end users don’t have to see a techy/confusing bash window to do something simple. Zenity options:
OPTIONS
This program follows the usual GNU command line syntax, with long
options starting with two dashes (`-').
Dialog options
--calendar
Display calendar dialog
--entry
Display text entry dialog
--error
Display error dialog
--file-selection
Display file selection dialog
--info Display info dialog
--list Display list dialog
--notification
Display notification
--progress
Display progress indication dialog
--question
Display question dialog
--text-info
Display text information dialog
--warning
Display warning dialog
--scale
Display scale dialog
--color-selection
Display color selection dialog
--password
Display password dialog
--forms
Display forms dialog
We will definitely be using zenity to make some things more user friendly…





Recent Comments