LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 03-09-2011, 04:13 PM   #1
SeaborneClink
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.

screenGrab.sh
Code:
#! /bin/bash
gnome-screenshot --area
exit 0
Then take my keyboard shortcut and call that script /home/<user>/scripts/screenGrab.sh

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/screenGrab.sh 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, 08:31 PM   #2
bluebox
Member
 
Registered: Jun 2004
Posts: 71

Rep: Reputation: 6
Try "xbindkeys" to start your script on a keyboard shortcut:
http://www.nongnu.org/xbindkeys/xbindkeys.html

Start the command "/home/<user>/scripts/screenGrab.sh > /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:
http://tips.webdesign10.com/how-to-t...h-ubuntu-linux
 
  


Reply

Tags
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 08:37 AM
Creating Custom Keyboard Shortcuts in Ubuntu lifeafterdeath Linux - Newbie 4 05-13-2010 12:51 PM
how can custom application launcher use my environmental variables tacca Linux - Software 1 06-01-2007 02: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 05:56 AM
Custom Keyboard Shortcuts in Gnome mvanadel Linux - General 5 09-28-2003 12:20 PM


All times are GMT -5. The time now is 10:24 AM.

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