Friday, 4 March 2011

Screenshot when active on a menu

When trying to take a screenshot with gnome-screenshot whilst you are active on some menu, I've found it doesn't tend to work.

Well, a couple of weeks ago I decided to do some research and managed to find a work-around. As you may know, pushing the Print Screen button causes the Ubuntu program gnome-screenshot to fire (which is can be changed to an alternative program if you with wish), resulting in a captured image of your current workspace. As like most software, there are a number of arguments that can be passed – one of which happens to be a delay, where you can specify when gnome-screenshot will fire, with the parameter: –delay=x where x is the number of seconds to wait. By adding this parameter, it gives you enough time between when you push it and when the delay finishes to navigate onto the appropriate menu, so that it can be included in the screenshot.

So, if you fire up gconf-editor, and navigate to:

/apps/metacity/keybinding_commands

You will find 2 configuration items associated with screenshots. I decided to edit the command_window_screenshot setting, so as not to mess-up the standard one. This way, whenever I want a screenshot with a menu involved, I just hit the alternative key combination – by default it is Alt+Print Scrn. So, I edited the property so that it reads

gnome-screenshot --window --delay=3

3 seconds tends to give me just enough time to navigate to the menu, but to be on the safe side, you may like to increase this to 5.

If you do not like the default key combination of Alt+Print Scrn, you can change this by going to:

/apps/metacity/global_keybindings

And editing the property for run_command_window_screenshot.

Tuesday, 14 September 2010

Enable Network Manager after a failed Resume from Suspend

Occasionally my system will decide it doesn't want to properly resume after a successful suspend. All well and good, I can just reboot my machine. However, there I encounter one problem. NetworkManager applet is disabled. All I see is this:








Then if I click on the networking icon, I just see text that says Networking disabled.

Thankfully, this is a relatively easy fix. Run the following commands:


sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service network-manager restart

When the service starts up again, that file will be re-created with the property NetworkingEnabled set to true. Of course, you could avoid deleting that file and just modify the property yourself – setting it to true – but I feel it is quicker to just remove the file and restart the service.