Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 03-09-2011, 05:13 PM   #1
LQ Newbie
Registered: Feb 2009
Posts: 4

Rep: Reputation: 0
Custom Application Launcher/Keyboard Shortcuts (with flags)

I'm trying to recreate some of the functionality of OneNote (winKey+S = screen grab area), on my linux laptop. Given that gnome-screenshot exists and has a 'grab area' function, available from the command line, gnome-screenshot --area (-a), this seemed like a step in the right direction.

So my first attempt was to create a keyboard shortcut with that command but it didn't work, and after a bit of googling I came across a suggestion (or three) to create a bash script, and have the keyboard shortcut call that bash script.
#! /bin/bash
gnome-screenshot --area
exit 0
Then take my keyboard shortcut and call that script /home/<user>/scripts/

Well that works insofar as the screen capture dialog pops up, asking where I would like to save the captured picture (output is identical to pushing the print screen button, i.e. the entire view, not just current window as alt+printscreen would provide)

Executing this script directly from the command line works successfully and will provide the area-grab crosshairs.

Creating a custom launcher (This is where it gets interesting..)

Given a launcher on the desktop, type: application, command: /home/<user>/scripts/ double clicking on the launcher, immediately after created will sometimes result in the desired behavior, there is no method to the madness as far as I can tell.

Right click the launcher, and click 'Open' will result in the desired behavior every single time.

Adding the launcher to the gnome-panel and clicking it will result in the desired behavior every time.

Clicking on the script in the folder will result in the desired behavior every time, provided you select 'Run' or 'Run in Terminal' (terminal obviously opens up a terminal window along with the behavior)

So I guess my question is, how can I take the results that I'm getting, and combine this all into what I'd like to happen? (keyboard combo -> screen grab)

Did I miss something obvious in the script and what is causing the quirky double click behavior of the launcher? Can anyone else reproduce that?
Old 03-09-2011, 09:31 PM   #2
Registered: Jun 2004
Posts: 71

Rep: Reputation: 9
Try "xbindkeys" to start your script on a keyboard shortcut:

Start the command "/home/<user>/scripts/ > /home/<user>/scripts/screenGrab.txt" and check screenGrab.txt if things don't work as expected.

btw, there seems to be "gnome-screenshot" and "gnome-panel-screenshot". This guy uses gnome-panel-screenshot:


keybinding, screenshot

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not launching spark messenger when created through custom application launcher raju.muppana Linux - Newbie 1 08-16-2010 09:37 AM
Creating Custom Keyboard Shortcuts in Ubuntu lifeafterdeath Linux - Newbie 4 05-13-2010 01:51 PM
how can custom application launcher use my environmental variables tacca Linux - Software 1 06-01-2007 03:48 PM
How can I create custom keyboard shortcuts in Gnome? (not the ones they have set!) DreameR-X Linux - General 2 06-12-2005 06:56 AM
Custom Keyboard Shortcuts in Gnome mvanadel Linux - General 5 09-28-2003 01:20 PM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration