RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    [Solved] How to bind a shell command to a hotkey? (raspi2png)

    Scheduled Pinned Locked Moved Help and Support
    hotkeyshortcutscreenshotraspi2png
    59 Posts 6 Posters 11.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • roslofR
      roslof @Clyde
      last edited by roslof

      @Clyde As requested, I added a note in my previous post about setting the executable permission.

      Also, you're absolutely right about my use of nohup. It's not necessary for such a simple/quick script. nohup ensures the process doesn't stop until it's done. Overkill for the near-instant execution of the script. Again, my newbie-ness is shining through.

      Regardless -- Cool write-up on nohup, its uses, and why output needs to be considered for other, longer tasks:
      https://www.maketecheasier.com/nohup-and-uses/

      I revised my post with the simple path/script and included an edit note with my original nohup line for reference...
      Cheers

      ClydeC 1 Reply Last reply Reply Quote 1
      • ClydeC
        Clyde @roslof
        last edited by

        @roslof Perfect, thanks!

        1 Reply Last reply Reply Quote 0
        • cyperghostC
          cyperghost @Lolonois
          last edited by

          @Lolonois said in [Solved] How to bind a shell command to a hotkey? (raspi2png):

          @hermit triggerhappy is not related to retropie. AFAIK %ROM% or $ROM is not available from the environment. However, to get the rom file name you may start with

          basename `ps a | grep RetroPie/roms | head -1 | awk '{ print $NF }'`
          

          Without a physical keyboard attached the tool jslisten may be an option.

          This is definitly the master path for such purpose. Why it gets so less attention?
          Together with the jslisten tool we can call any script and manipulate filenames (because we aren't restricted to one liners) ;)

          Thx @Lolonois for this nice suggestion ;)

          @mitu @Clyde
          The triggerhappy solution is also nice but imho the joypad usecase is a real fine way to coop with.

          Btw: You can always use GPIO inputs to call commands

          ClydeC 1 Reply Last reply Reply Quote 0
          • ClydeC
            Clyde @cyperghost
            last edited by

            @cyperghost said in [Solved] How to bind a shell command to a hotkey? (raspi2png):

            Btw: You can always use GPIO inputs to call commands

            If you're not like me and prefer USB connections. ;) (because, I don't know, lazyness?)

            cyperghostC 1 Reply Last reply Reply Quote 1
            • cyperghostC
              cyperghost @Clyde
              last edited by cyperghost

              @Clyde Well ... I think it's not lazyness. I think with this Breadboard unit on Amazon.de there is no space for any excuse ;)
              So you develop your scripts and connections on this board and just take them over to your RetroPie ;)

              ClydeC 1 Reply Last reply Reply Quote 0
              • ClydeC
                Clyde @cyperghost
                last edited by

                @cyperghost If I compare this to a ready-to-use usb device like a keyboard or game controller, I think I can still plead lazyness with a clear concience. ;)

                cyperghostC 1 Reply Last reply Reply Quote 0
                • cyperghostC
                  cyperghost @Clyde
                  last edited by

                  @Clyde Now we are getting closer why I entered this thread ;)

                  If I compare this to a ready-to-use usb device like a keyboard or game controller

                  So does triggerhappy work out of the box with joypads? If yes then this would be a real cool deal ;)

                  Maybe I will post a thread of annother solution that's only script based ;) Stay tuned ;)

                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @cyperghost
                    last edited by

                    @cyperghost said in [Solved] How to bind a shell command to a hotkey? (raspi2png):

                    So does triggerhappy work out of the box with joypads?

                    If it's reading the events correctly from /dev/input/eventX, I see why not. You can verify like @clyde did via thd --dump /dev/input/*. Looking at the supported event types (thd --listevents), I think it should work.

                    cyperghostC 1 Reply Last reply Reply Quote 1
                    • cyperghostC
                      cyperghost @mitu
                      last edited by cyperghost

                      @mitu Yes I'm reading the github content now. Sounds feasible for me to get this work with js0 as input source. Even one issue on github explainded that there were inputs of buttons detectable.

                      But I'm also in annother doc for retropie: Take and Scrape Your Own Screenshots. There it is explained

                      1. How to setup the screenshot function with button
                      2. How to retrieve Screenshot name from ROM name
                      3. How to store them per system

                      The only minus point of the raspi2png internal retroarch solution is... this will work (of course) only in lr- core emulatores ;) Or did I misunderstood the whole thread?

                      mituM 1 Reply Last reply Reply Quote 0
                      • H
                        hermit
                        last edited by hermit

                        Rapi2png , I think it works with any emulator.
                        I used it with uae4arm which is not Libretro

                        1 Reply Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @cyperghost
                          last edited by

                          @cyperghost It works with any emulator, since it screenshots the framebuffer. What you should - actually - do is make it work on the 'Droid (i.e. find a raspi2png substitute).

                          cyperghostC 1 Reply Last reply Reply Quote 0
                          • cyperghostC
                            cyperghost @mitu
                            last edited by cyperghost

                            @mitu said in [Solved] How to bind a shell command to a hotkey? (raspi2png):

                            @cyperghost It works with any emulator, since it screenshots the framebuffer. What you should - actually - do is make it work on the 'Droid (i.e. find a raspi2png substitute).

                            Yes... I ment that the retroarch internal solution will only work on lr-cores

                            @hermit @mitu
                            Corrected previous posting

                            But I think the internal screenshot modul of retroarch should not be underestimated, too ;)

                            mituM 1 Reply Last reply Reply Quote 0
                            • mituM
                              mitu Global Moderator @cyperghost
                              last edited by

                              @cyperghost Well, if you're using RA, it gets much easier - like in the wiki page you posted. It's enough to bind a button (for instance B, which is mapped to Reset Content) to take a screenshot via the hotkey.

                              cyperghostC 1 Reply Last reply Reply Quote 1
                              • cyperghostC
                                cyperghost @mitu
                                last edited by cyperghost

                                @mitu so the thread should contain all application purposes.


                                about the odroid.

                                1. I'm not a chip developer
                                2. the device and it's esp. the graphic drivers are barly maintained
                                3. I'm the (proud??) owner of such a device but I prefer the Pie

                                Maybe the device will get better support if more devs will take buisness on development ... but the XU4 is far away from being called a "newcomer" it's in meantime a 4 year old boy ;)
                                But let us talk in other threads about this SBC ;)

                                mituM 1 Reply Last reply Reply Quote 0
                                • mituM
                                  mitu Global Moderator @cyperghost
                                  last edited by

                                  @cyperghost said in [Solved] How to bind a shell command to a hotkey? (raspi2png):

                                  I'm the (proud??) owner of such a device but I prefer the Pie

                                  What I meant - since you have one - maybe you can find an equivalent program to raspi2png for the Droid and be able to test it (not create one from scratch). Something like fbgrab or fbdump maybe.

                                  1 Reply Last reply Reply Quote 0
                                  • roslofR roslof referenced this topic on
                                  • First post
                                    Last post

                                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.