[SOLVED] keeping terminal window open for scrot keyboard shortcut

Hey,
Im trying to bind a keyboard shortcut to scrot with the -s command (for selecting window). Normal scrot command works fine straight away, but with the -s command a terminal window needs to be open that waits for the selection. i have created a file called lscrot with the following code:
1 #!/bin/bash
/usr/bin/terminal --working-directory=$HOME/dump/ --geometry 0x0-0-0 -e "/usr/bin/scrot -s"
i have put the file in /usr/bin folder with 755 permissions.
if i right click the file and choose "execute", the new terminal window will stay open and i can select an area to take a screenshot of, but when i bind it to a shortcut key (using xfce) the new terminal window will close immediately rendering the shortcut useless.
how does one fix this?
thanks
Last edited by iOfWhy (2012-06-10 13:41:55)

hmmm, ok. binding keys to /usr/bin/scrot works fine, but /usr/bin/scrot -s does not. dont really know where to begin searching for a fix...
EDIT: im assuming there is something elementary i am missing. after further testing, launching for example scrot ~/dump/test.png from console works fine, but not when i bind it to a keyboard shortcut. however, scrot test.png works to bind. does anyone know anything more about XFCe and binding keyboard shortcuts?
EDIT2: ok so im honing in a little bit, i realised that the first times i use the keyboard shortcut it works. forcing the terminal window to stay open after command has been executed i see following error:
giblib error: couldn't grab keyboard:Resource temporarily unavailable
Searching the net i found old bug that was closed without (seemingly) being solved.
https://groups.google.com/group/linux.d … 2056017d9a
Any ideas?
EDIT3: ok so found a solution, "sleep". Adding sleep 0.1 to the top of the screenshot script seemed to help. seems you need to give sometime to release the keyboard for scrot to use. would still be great if anyone knew how to get it to work by using a direct command in the keyboard shortcut bindings. ie binding in straight to "scrot -s". using Alt+F2 then typing in scrot -s works fine, so i really dont see why i cant bind a keyboard command straight to that.
NOTE: how do i see xsession errors? I find no .xsession-errors file in my home directory. been searching for months.
Last edited by iOfWhy (2012-06-10 13:33:56)

Similar Messages

  • Upgraded from 3.6 to 7 - changed nothing else - now takes 50-60 seconds to for the browser to start - works OK after that as long as I keep a window open. I then diabled all plug ins and extenstions - still 60 seconds to load browser.

    I upgraded from 3.6 to 7 - changed nothing else - now takes 50-60 seconds to for the browser to start - works OK after that as long as I keep a window open. I then disabled all plug ins and extensions - still 60 seconds to load browser. I also keep getting a high memory warning from AVG with mem usage up to 600,000 k

    I upgraded from 3.6 to 7 - changed nothing else - now takes 50-60 seconds to for the browser to start - works OK after that as long as I keep a window open. I then disabled all plug ins and extensions - still 60 seconds to load browser. I also keep getting a high memory warning from AVG with mem usage up to 600,000 k

  • How to keep the field open for input with error message in report program

    Hi,
      Need a help in solving the below issue.
    "How to keep the field open for input with error message in report program"
    Regards,
    C.Shasiraj.

    Hi...
    you have to use the event:
    <b>AT SELECTION-SCREEN ON <FIELD> EVENT.</b>
    u have to give an error message in this event.
    Consider the following <b>Example:</b>
    <b>PARAMETERS : NUMBER TYPE I.
    AT SELECTION-SCREEN ON NUMBER.
      IF NUMBER = 10.
        MESSAGE 'Number vakue is 10' TYPE 'E'.
      ENDIF.
    START-OF-SELECTION.
      WRITE NUMBER.
    </b>
    in this if u give the value of number = 10, it will not proceed further, if u give some other value other than 10 you will proceed further...
    Execute this program once u will understand....
    also Consider the following links :
    <b>Regarding events:</b>
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a237d9b511d1950e0000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a23ad9b511d1950e0000e8353423/frameset.htm
    <b>Regarding messages:</b>
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/aa575426ad11d2954d0000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/aa575426ad11d2954d0000e8353423/frameset.htm
    This is very useful.......
    Reward points if useful....
    Suresh....

  • Todays update! After todays update I can no longer send Safari or Spotify to the task bar without it cutting out (dropping audio in and out). Streams normally if I keep the window open on my desktop. This needs to be fixed immediately.

    Todays update! After todays update I can no longer send Safari or Spotify to the task bar without it cutting out (dropping audio in and out). Streams normally if I keep the window open on my desktop. This needs to be fixed immediately.

    Nevermind. I figured it out.

  • Is there a fix for Mail keeping 4 connections open for one.......?!

    Is there a fix for Mail keeping 4 connections open for one email account setup as IMAP.......?!
    Im just wondering whether this is possible because it means our company website falls over when the processes go over 25! There are a lot of emails.....
    It is a massive pain and ideally we dont want to upgrade our hosting package if we can help it!
    There must be a way round it?! Someone brainy know any tricks?!

    Ernie Stamper wrote:
    Never have encountered this -- more info, please? What are 4 connections, exactly?
    Very simple: Mail opens one connection for each IMAP mailbox on the account. Typically, this means Inbox, Sent Mail, Drafts, and Trash, but also includes Apple Mail To Do and Junk and any mailboxes/folders the user has created.
    The problem is that Mail is keeping these connections open when it's done checking for new mail, even when *Use IDLE command if server supports it* is not enabled. With 4 email accounts on one server, this causes a "500 Internal Server Error" because there are too many processes running. As soon as I quit Mail, my web server resumes serving pages.
    Message was edited by: Don Morris

  • I keep multiple windows opened and minimized. Sometimes when I click on the task bar to Restore, it apparently "disappears" out of view past the upper left corner. From then on, it can only be seen by using Maximize. What can be done to move it back?

    I keep multiple windows opened and minimized. Sometimes when I click on the task bar to restore one, it apparently "disappears" out of view beyond the upper left corner of the screen. From then on, it can only be seen by using Maximize in the task bar. When Restore/Move/Size are clicked, the pointer just goes to the upper left corner of the screen with all combinations of clicking/dragging having no success. What causes this, and what can be done to move it back?

    If a window disappear then using the system menu can make it reappear or make it possible to move that window in view. I don't know what causes it to make the window disappear in your case if it does work correctly if you start Firefox.
    You can check the browser.link.open_newwindow prefs on the about:config page if you want to open all links in tabs in the current window.
    * http://kb.mozillazine.org/browser.link.open_newwindow (3)
    * http://kb.mozillazine.org/browser.link.open_newwindow.restriction (0)

  • Is it possible to have a window open for my library and the Itunes store so that I can toggle between the two?  I want to check my library before I purchase songs to make sure that I don't already own them.

    Is it possible to have a window open for my Itunes Library and Itunes store at the same time so that I can toggle back and forth between the two.  I want to check my library before I buy songs to make sure that I don't duplicate.
    Thanks!

    No.

  • Can you fix , the fact that If you leave the firefox update window open for a long period (say 20 minutes in the background), then close all other windowns, then choose to install, it uses this extra time to estimate the download?

    Can you fix , the fact that If you leave the firefox UPDATE window open for a long period (say 20 minutes in the background), then close all other windows, then choose to download update, it uses this extra time to estimate the download? (Mine said, 12 Hours to start with, but took under 2 minutes!)
    == This happened ==
    Not sure how often
    == When you install update to 3.6.4 (Possibly for every update?)

    The download should happen in the background (before you get an update window). I wonder why that didn't happen for you...\
    Did you manually check for updates?

  • How do I keep multiple windows open and switch back and forth?

    How do I keep multiple windows open and switch back and forth?

    billyg27,
    if you hold down a Command key and press the Tab key, it will show a set of icons representing your currently opened programs. Press Tab until you arrive at the program you’d like to switch to, and then release the Command key.

  • Every time I turn my MBP on, a terminal window opens. Is there any way to stop this from happening?

    Whenever I boot my MPB up, a terminal window opens. It isn't really causing problems, just annoying. Is there any way to stop these windows from popping up?

    Open Accounts preferences, click on the Login Items tab. If you see the Terminal listed then select it and click on the Delete [-] button.

  • Looking for Mac Keyboard Shortcuts.

    I'm looking for Mac Keyboard Shortcut Documents for:
    Acrobat Xi
    After Effects CC 2014
    Bridge CC
    InDesign CC 2014
    Muse CC 2014
    Photoshop CC 2014
    Premiere Pro CC 2014.
    Thanks and let me know where I can download the Software listed above Mac Keyboard Shortcuts
    David Hastings

    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Hi I'm looking for some keyboard shortcut that are Mac but I want PC. Here they are:

    Hi I'm looking for some keyboard shortcut that are Mac but I want PC. Here they are:
    ATL + shift + l
    ATL + q
    ATL + a
    ATL + shift + e
    ATL + z
    ATL + x
    ALT + SHIFT + g
    ALT + SHIFT + f
    they are for mac I them would like for pc... Thank you

    Ah, thanks. Goes to show how carefully I look at keyboards these days...
    So Opt(alt) on the Mac should map to Alt on PC.
    It would actually be helpful if the OP told us waht the shortcuts were meant to do...
    And there's always the help files. A complete list of default shortcusts is at http://helpx.adobe.com/indesign/using/default-keyboard-shortcuts.html

  • Terminal Window asking for password when opening

    I don't know what happens but everytime I open a terminal window its ask me for password. If I type my admin password it starts saying that can't found my ~ directory and starts in :/ instead of :~
    It is also showing ttys001 instead of 000 as usual.
    I don't know what it is, I think it have some relation with closing terminal windows without logging out of a ssh section, but I don't know how to resolve it. I tried reboot, "exit", delete com.apple.terminal
    Any sugestion?

    sgobin wrote:
    I don't know what happens but everytime I open a terminal window its ask me for password. If I type my admin password it starts saying that can't found my ~ directory and starts in :/ instead of :~
    It is also showing ttys001 instead of 000 as usual.
    I don't know what it is, I think it have some relation with closing terminal windows without logging out of a ssh section, but I don't know how to resolve it. I tried reboot, "exit", delete com.apple.terminal
    This is just a wild guess, but might there be a "sudo" command in a file in your home directory that's run when you launch a Terminal session, such as .bash_profile, .bash_login, or .profile? (This list assumes that you're using bash as your shell.)

  • New firefoxis great. i keep many windows open. in ur earlier ver. I used to close it, it would ask for save and shut down as one of the three option,but in this new version it close all my window, how do i save my window tab?

    new firefox is great. I usually have many windows open. in your earlier version, when ever I used to close it, it would ask for save and shut down as one of the three option,but in this new version it close all my window, how do i save my window tab?

    See [[Firefox does not ask to save tabs and windows on exit]].
    Does this work for you?

  • Cant install software from disk. Terminal window opens with a logon and bash message?

    I cannot install software from disk & in some cases download.
    If any software disk is inserted the terminal window appears.
    The Disk has to be clicked to open the contents but install files or package files show as a blank doc and not the usual yellow package icon.
    All that shows is a log on message in the terminal window, but nothing about install.
    I thought Drive issues but the drive plays audio and DVD perfect
    I cannot install:-
    Office for mac updates
    Live Interior 3D (managed to install from download)
    ION Audio Converter
    This has only come to my attention in the last couple of weeks.
    The machine is a late 2011 with Lion installed

    Contact Apple Service, iMac Service or Apple's Express Lane. Do note that if you have AppleCare's protection plan and you're within 50 miles (80 KM) of an Apple repair station, you're eligible for onsite repair since yours is a desktop machine.

Maybe you are looking for

  • How can I enable Enterprise Manager in Oracle 10g?

    Hi, We recently installed Oracle 10g on a MS Window server and after the installation which we created 2 instances each with a default schema from an existing data file (.dmp). After the installation, I realized that somehow, the DBConsole entry is m

  • Query returns different Explain Plan

    Hi, I have two databases that are identical to each other. But I have a query that runs on both and returns different explain plans in both. It runs slower in one than other. How can I troubleshoot this further to get faster times in the slower datab

  • Information to user who creates PR for spare parts & service PR from order.

    Hi experts, Is there any standard workflow available by which the maintenance user will get message in his SAP inbox , whether material has been recieved for the Purchase requisition created through maintenance order as well as manual PR by t-code ME

  • Which is more faster - IN or EXISTS?

    Which is more faster - IN or EXISTS?

  • Looking for com.sun.javacard.javax.smartcard.rmiclient

    Hi guys! Im trying to write a smart card host application but im not able to find this com.sun.javacard.javax.smartcard.rmiclient package. It seems that the package is not included into Java Card Development Kit 2.2.2!? I would be grateful for any he