Tips and Tricks for Ubunuts
- Ubuntu Precise Pangolin 12.04 LTS for desktop users
- Ubuntu Tweak
- Move Window Control Buttons to the Right
- Two-Finger Scrolling
- Autokey in Unity
- Disabling the Guest Account
- Citrix Receiver
- Screen Locks
- Scheduling automatic system reboots
It's here at last ! The long anticipated new long term support (LTS) release of Ubuntu, Precise Pangolin 12.04 LTS was officially rolled out on Thursday, 26 Apr 2012.
Initial impressions seem to suggest that Ubuntu's developers have taken the previous criticisms of their much maligned Unity Desktop seriously, and it has seen a fair amount of spit and polish since the previous update. Unity is now quite slick (once you get use to the launcher stuck to the left side of your screen, and the Mac style windows title integration in the top panel). For the first time I am actually excited to use it. The new context sensitive heads up display "HUD" search function looks pretty snazzy, is totally innovative and a real pleasure to use.
With 20 million users in 80 languages in 140 countries, and resolutely heading off in its own new development direction, it seems that Ubuntu is now, at age 7, properly grown up.
If you're not scared of trying something new, just jump in, hit
that distribution upgrade button or download Ubuntu Precise from here. If your
machine has an i3 processor or better, it should be fine to go for
the 64 bit version. But keep in mind that the Citrix receiver runs better on the 32 bit iteration. If in doubt, VirtualBox is your
Install Ubuntu Tweak:
If you, like me, really can't live with those Mac style window buttons on the top left, Ubuntu Tweak has been updated with support for 12.04. Open a terminal (CTRL+T), then copy and paste the following commands in sequence (CTRL+SHIFT+V to paste).
sudo add-apt-repository ppa:tualatrix/ppa sudo apt-get update sudo apt-get install ubuntu-tweak
The easy way to do this is to simply install Ubuntu Tweak and do it through the provided GUI. However, if you don't want to bother with Ubuntu Tweak, and for the sake of comprehensiveness, the old fashioned way (the one we used since Ubuntu Lucid 10.04) still works.
Since the Gnome configuration editor or "gconf-editor" doesn't come pre-installed in 12.04 any more you have to go and get it: So open a terminal (CTRL +Alt + T) and type:
sudo apt-get install gconf-editor
Next, open gconf-editor, by simply typing that in your Terminal. Or open it from the dash. Hit the SUPER (Windows) key and type:
Now you have to browse to the relevant line in gconf-editor: Apps > metacity > general and then look for "button_layout" in the right panel. Now edit the line next to button layout as follows:
Don't forget to hit ENTER
There you go! Those window control buttons are back in their proper position and order. The only catch is that when the window is maximized, then the window controls will still integrate in the top panel on the left. No way to change that...yet.
Spice things up with Cinnamon:
If you just can't warm up to Unity, fear not. The intrepid LinuxMint developers have followed their philosophy of "in the end the people always get what they want" and they have built a kick-ass traditional style desktop for you called Cinnamon. Even better, you can install it on top of Ubuntu 12.04!
sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable sudo apt-get update sudo apt-get install cinnamon
Or head back to the familiar GNOME classic:
sudo apt-get install gnome-panel
So, at log-in time, you get to pick the desktop you want to load by default
One Mac-style feature I really do like is two-finger scrolling on the touch pad. In 12.04 with Unity that really does seem to work properly now on my Lenovo T510 laptop. What's more, the horizontal scrolling works properly too. In the past I had to install a hack to get this to work. To enable two-finger-scrolling head over to Unity's mouse and touchpad configuration utility. Press the Super Key (Windows key) and type "touchpad".
Get Autokey to work properly. For the stable build, just grab it from the Ubuntu Software Center:
For the bleeding edge build you can install via PPA:
sudo add-apt-repository ppa:cdekter/ppa sudo apt-get update sudo apt-get install autokey
Next you need to make the Autokey icon appear in the system panel at the top.
gsettings set com.canonical.Unity.Panel systray-whitelist "['Autokey']" setsid unity
Next, restore your snippets and text macros: You can paste your existing autokey.json file with your scripts and snippets into the Autokey configuration folder of a fresh Autokey installation at ~/.config/autokey (in other words: Home Folder > Press CTRL+H to reveal hidden folders > .config > autokey). If you already see an autokey.json file there, just delete and replace with yours. I actually keep a backup copy of my Autokey json file in my OSCAR e-Docs.
If you want to save, restore and share just indivual phrases, or collections of them to other computers, rather than your entire Autokey configuration file as a whole, then that's really easy too. Autokey has an Export and Import feature for individual phrases (or groups/folders of phrases) accessible from the Autokey file menu: File > Export/Import. You can also export a phrase (or group/folder of phrases) by right clicking it in the Autokey main window. The thus exported phrase (or folder) can then be saved as a .bin file, and moved to other computers. Then use the File > Import feature in the Autokey on the other computer to add it in.
Next, set Autokey to start with your computer, under Startup Applications:
Finally you need to tweak the Autokey Preferences to use X Record for key stroke monitoring:
Now you should be back in business with Autokey running in Unity on Precise Pangolin.
Ubuntu 12.04 comes with a passwordless guest account pre-installed. Some might see that as a security issue. I have found that some non tech savvy colleagues and staff will occasionally lose their bearings when they end up logging into this account by accident after restarting a workstation computer. They are then bewildered by the lack of configuration and bookmarks in the account.
Disabling the guest account involves making some changes to a desktop configuration file under the hood. Open a terminal (CTRL + Alt + T) and open this file with the text editor (called gedit) as root for editing with the following command
sudo gedit /etc/lightdm/lightdm.conf
the contents of the file will look like this:
[SeatDefaults] user-session=ubuntu greeter-session=unity-greeter
Type an extra line below this as follows
So now you have this:
That's it! Click save. And when you reboot your computer the guest account login option will be gone.
Citrix is a widely used proprietary enterprise level virtualization interface that is a fact of life for many of us, when we remote-connect to our area hospital information systems or health authority networks from our office computers. For Ubuntu 12.04 there finally is a Citrix client/receiver solution that runs on both the 32 bit and the 64 bit version of the OS (via multiarch support on 64 bit). In my experience the Citrix ICA client launches instantly on a 32 bit install of Ubuntu 12.04 and runs well, but has a lag time of around 30 seconds or so when launched on a 64 bit Ubuntu 12.04 install, although it runs snappily once launched. For some doctors a 30 second lag time after clicking is just not acceptable in the context of a patient visit, so for this reason alone I run 32 bit Ubuntu 12.04 on exam room workstations. The installation process for the Citrix receiver is nicely described on the official Ubuntu wiki here. But for the sake of completeness I will re-post the process for Ubuntu 12.04 below:
First you have to install a dependency. Open a terminal (CTRL+Alt+T) and paste the following line:
sudo apt-get install libmotif4:i386
Then go to the official Citrix download site and grab the Debian package for the 32 bit Citrix client for Linux (here). Save the .deb file to your downloads folder. Then click it to open with the Ubuntu Software Center to install it. Be sure to check the box to accept the Eula when prompted.
Once you have installed the Citrix client, there is one more crucial step to do! The Linux version of the Citrix client ships with many security certificates missing, so you might be faced with a "you have chosen not to trust..." error message when trying to launch your Citrix receiver. To fix this, you have to copy your certificate authorities' root certificates from your Firefox directory to the freshly installed Citrix client's keystore directory. This is easily done by simply copying and pasting the line below into your terminal window.
sudo cp /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts
That's it! You should be able to log into your health authority portal and launch the Citrix XenApp desktop interface.
Screen locks are basic but important privacy tools in the medical office. When you step away from a given exam room workstation, you do want to protect your EMR from prying eyes and probing fingers. While the Ubuntu developers have ditched the old Gnome screen-saver in 12.04, the screen lock still exists. There are several different ways to lock the screen in Unity.
1) Set up the screen lock timeout: Head over to the dash and type lock to open the "Brightness and Lock" configuration window:
Set the screen lock to activate automatically after 5 or 10 minutes
2) Use the drop-down in menu item in the top panel to manually lock the screen:
3) Use a keyboard shortcut: You can use the default keyboard shortcut to lock the screen which out of the box is CTRL+ALT+L. The problem I have with this shortcut is that you need three fingers and two hands for it. I prefer using a single key to lock the screen, since that saves me half a second every time. Luckily this is easy to set up in Unity. Head over to your dash (or hit the Super/Windows key) and type "keyboard" to open keyboard short cuts. Now navigate to the System shortcuts and click on the Lock Screen item.
Now just touch the new key you want to assign to this shortcut. I like one of the function keys for this, e.g F2 or F12.
4) Set up a desktop or launcher icon: Many MOAs and doctors find it easier to click a desktop icon to lock the screen than having to remember a keyboard shortcut. I have previously described how to set this up in Windows XP, Windows 7, Mac OSX and Ubuntu with Gnome2 here. Setting this up in Unity is a little different, but still easily doable.
Just follow the steps below:
- Find a nice icon image of a lock on the Internet (or use the one below) and save it in your Pictures folder with the filename "screenlock.png"
- Now open your text editor (look for the app. called "Gedit" in the dash).
- Copy and paste the entire block of text below exactly as it is written, into the text editor window.
[Desktop Entry] Name=Screenlock GenericName=screenlock Comment=Lock the screen! Keywords=lock;screen;screensaver;password;desktop Exec=gnome-screensaver-command --lock Terminal=false Type=Application StartupNotify=true Icon=/home/Pictures/screenlock.png
- Next, and this is important, save the file in your home folder with the filename Screenlock.desktop
- Now you have to set the permissions for your screenlock script you have created and assign the icon picture. So open your file browser and navigate to the file you have so created, right click on it and select Properties:
And set the permissions to allow the the file to execute as a program (check the Execute box).
- Now go back to the "Basic" Tab above and click on the empty icon picture placeholder in the left top corner:
- Click the square and navigate to your Pictures folder where you have previously saved the icon image for the lock and load that like so:
Done here, click close, tricky part's over.
- Now navigate to your home folder again in your file browser. Simply drag the Screenlock.desktop file you have created file to your Unity launcher/dock and drop it!
Now you can single click this to lock your screen.
- If you want a desktop icon for the same purpose, that's easy too. Just open your home folder again, right click the Screenlock.desktop file and select Make Link. Then just drag the link/shortcut/launcher you have just created to your desktop like so:
You can now double click the desktop shortcut to lock the screen
Keep in mind that this might not work in future updates of Ubuntu, since there is talk of a custom screensaver and lock for Unity. So this is not the last word.
Office computers are often left running overnight. One of the reasons to do this, besides the time savings, is that hard-drive wear is accelerated by regular shut downs and cold boot procedures, so you should theoretically get more life out of your drives by leaving your boxes running permanently. On the other hand we all know what happens to a Windows machine that is left booted up for a few days, so Windows computers are often set to do an automatic reboot every night, to keep the operating system stable.
In theory Linux boxes are stable enough not to require this. I have on occasion gone for periods of 3 to 4 months between requiring restarts of my exam room computers. There are however some reasons to schedule regular restarts on your Ubuntu machines anyway, not least because some users occasionally forget to log out of OSCAR on all workstations at the end of each day. Occasionally some of the more graphics intensive applications can get leaky too and things can get quirky with time, even on Linux systems.
It is actually very easy to set your Ubuntu workstations to restart regularly. The built-in utility for this is called "cron" (short for "chronograph"). The Ubuntu system looks for cron instructions in a configuration text file called "crontab", located in the "etc" directory. All you do is add a line of text to the file to instruct your system to reboot itself regularly when you tell it to. The syntax for the crontab scheduling commands is:
Minute (1 to 60), Hour (0 to 23), Day of Month (1 to 31), Month (1 to 12), Day of Week (1 to 6 is Mon to Sat, Sunday is 0), User (must be "root" for this), Command. An asterisk is a placeholder. #s are comment tags.
So here is what you do: First you need to open the crontab file on your system as "root" for editing with the Ubuntu default text editor called "gedit". Open a terminal window (CTRL+ALT+T), copy the line below and paste it into the terminal (CTRL+SHIFT+V):
sudo gedit /etc/crontab
Now you can copy the lines below and paste them into a new line at the bottom into your crontab file (the one you just opened):
# Schedule a system restart every Monday morning at 04.05 am 5 4 * * 1 root reboot
The first line is "commented out" with a leading #, and so will be ignored by cron. You can vary the day of the week. Monday to Saturday are numbered 1 to 6. Sundays are a 0. If you want to restart once a month, say on the 15th of the month, with 5 minutes warning before the reboot, you would use the following command instead:
# Schedule a system restart on the 15th of every month at 11.30 pm, with 5 minutes warning 30 23 15 * * root shutdown -r +5
Don't forget to click save. Then close gedit.