Since I write a lot of articles about Backtrack Linux it is nice to have keyboard shortcuts for different screenshot commands. The two screenshot commands that I use most in Backtrack are “gnome-screenshot -w” and “gnome-screenshot”. The gnome-screenshot command will take a screenshot of the entire desktop while “gnome-screenshot -w” will take a screenshot of the active window only. Below I describe setting up keyboard shortcuts for each of these commands on Backtrack Linux. The below information will work the same on Ubuntu 10.04 as it does on Backtrack Linux since that is what the current Backtrack Linux version (Backtrack 5 release 3) is built on.
Setup Custom Keyboard Shortcuts For Screenshots In Backtrack Linux:
There are various switches that can be used with gnome-screenshot however the most common are -w for taking a screenshot of the active window and -a which will allow you to select a specific area of the Backtrack desktop to take a picture of. The -a switch for gnome-screenshot was not working properly with a custom keyboard shortcut so it is not included below. This is not a big deal since you can just take a screenshot of the entire desktop and then edit it with gimp or something like Photoshop on a different OS.
Launch Keyboard Shortcuts In Backtrack Linux:
First launch the Keyboard Shortcuts configuration window by clicking on System in the top menu bar, selecting Preferences from the drop down menu, and then selecting Keyboard Shortcuts from the pop out menu. This will launch the Keyboard Shortcuts configuration window as shown in the below example window.
Backtrack Linux Keyboard Shortcuts:
Once the Keyboard Shortcuts window is launched click on the Add button near the lower right corner to add a new keyboard shortcut. Clicking the Add button will launch the below window where you will be able to name the new keyboard shortcut and set the command that will run when this keyboard shortcut is activated.
Add Custom Keyboard Shortcut To Backtrack Linux:
Since I added two different custom keyboard shortcuts in my scenario I used the below information for the two.
Custom Keyboard Shortcut One: Screenshot Of Entire Desktop
- Name: screenshot desktop
- Command: gnome-screenshot
Custom Keyboard Shortcut Two: Screenshot Of Active Window
- Name: screenshot window
- Command: gnome-screenshot -w
So once you have added all of the screenshot related keyboard shortcuts you want to add you will need to assign the actual keyboard shortcut that will activate the command. I personally use Ctrl-Z and Ctrl-Q for each of the above keyboard shortcuts mostly because of the fact that the key combinations are easy to reach with my left hand. You attach the key combination to the keyboard shortcuts you have added by clicking on Disabled in the Shortcut column of the Keyboard Shortcuts configuration window as shown in the below example image.
Attach Key Combination To Keyboard Shortcut In Backtrack Linux:
When you click on Disable in the Shortcut column of the added keyboard shortcut Disabled will change to “New shortcut…”. Once it changes that means it is waiting for your keyboard input to record as the new key combination associated to this keyboard shortcut. So punch the key combination you want to be set for that keyboard shortcut to have it recorded and set and then move on to the other keyboard shortcuts you have added for screenshots on Backtrack Linux. Once you have set all of the key combinations for each of the keyboard shortcuts the Keyboard Shortcuts configuration window should look similar to the below and Disabled should no longer be displayed for any of the new keyboard shortcuts as shown in the below example image.
Custom Keyboard Shortcuts – Key Combinations Configured
Now you should be able to close the Keyboard Shortcuts configuration window and click the key combinations you have set for each custom keyboard shortcut to test them out. In my example when I click Ctrl+q a screenshot is taken of the entire desktop and when I click Ctrl+z a screenshot is taken of the active window on the Backtrack Linux desktop.
Hopefully this information makes your life a little easier!