Skip to content

screenshot: add grim for promptless screenshots in testing#1694

Merged
brianmcgillion merged 1 commit intotiiuae:mainfrom
kajusnau:grim
Jan 21, 2026
Merged

screenshot: add grim for promptless screenshots in testing#1694
brianmcgillion merged 1 commit intotiiuae:mainfrom
kajusnau:grim

Conversation

@kajusnau
Copy link
Copy Markdown
Collaborator

Description of Changes

The currently used cosmic-screenshot talks to the XDG Desktop Portal to capture the screen.
This works fine for normal user interaction, but can sometimes cause hangups in test automation due to the portal sometimes asking for permission to capture the screen.

We add grim here as a CLI alternative, which talks to the Wayland compositor directly to capture the screen.
To mimic cosmic-screenshot screenshot output as a normal logged in user, one can run:

grim "$XDG_PICTURES_DIR/Screenshot_$(date '+%Y-%m-%d_%H_%M_%S').png"

Type of Change

  • New Feature
  • Bug Fix
  • Improvement / Refactor

Related Issues / Tickets

https://jira.tii.ae/browse/SSRCSP-7876

Checklist

  • Clear summary in PR description
  • Detailed and meaningful commit message(s)
  • Commits are logically organized and squashed if appropriate
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • Author has run make-checks and it passes
  • All automatic GitHub Action checks pass - see actions
  • Author has added reviewers and removed PR draft status

Testing Instructions

Applicable Targets

  • Orin AGX aarch64
  • Orin NX aarch64
  • Lenovo X1 x86_64
  • Dell Latitude x86_64
  • System 76 x86_64

Installation Method

  • Requires full re-installation
  • Can be updated with nixos-rebuild ... switch
  • Other:

Test Steps To Verify:

N/A

Signed-off-by: Kajus Naujokaitis <kajus.naujokaitis@unikie.com>
Copy link
Copy Markdown

@milva-unikie milva-unikie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I tested that grim is working nicely. cosmic-screeshot has caused a lot of trouble for us recently.

Since cosmic-screeshot is still available, this PR can be merged and we will switch in the test-automation once I have time to properly test my PR.

@brianmcgillion brianmcgillion merged commit ce10c5d into tiiuae:main Jan 21, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants