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

    Using kmsgrab and triggerhappy for full-screen screenshots

    Scheduled Pinned Locked Moved Help and Support
    kmsgrabtriggerhappysudoframebuffer
    2 Posts 2 Posters 147 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
      last edited by roslof

      Referring to an older thread

      In the past we could use raspi2png for screengrabs, but the tech is obsolete for modern OSes. Would like to combine a modern capture tool with triggerhappy for keyboard-triggered screen captures using the method in the thread linked above.

      In 2025, it seems that kmsgrab might be a good alternative with Bookworm, but it needs sudo/root access, which may prohibit it from running in a script. Wondering if there is a way to run kmsgrab in this fashion, or if a different tool would be required.

      I've already configured a triggerhappy conf file and it tries to run kmsgrab with a filename param, but it definitely needs sudo, which I think is a non-starter.

      Is there a clever way to make this work?

      Cheers!
      -Ros

      EDIT: I'm realizing that this may be a Pi 5 / Bookworm issue and thus is probably not ready for this forum.

      1 Reply Last reply Reply Quote 0
      • LolonoisL
        Lolonois
        last edited by

        You may succeed with giving the kmsgrab system admin capabilities, it does no longer require explicit sudo then.

        sudo setcap cap_sys_admin+ep /path/to/kmsgrab

        https://linux.die.net/man/8/setcap
        https://linux.die.net/man/3/cap_from_text
        https://man7.org/linux/man-pages/man7/capabilities.7.html

        I did not debug to the end, but I strongly assume at some point DRM hits this method, which bails out with -EACCES ("Operation not permitted") when privileges are not met.

        1 Reply Last reply Reply Quote 1
        • 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.