Skip to content

Support jpg, ppm file format preference for screenshots#1650

Open
hurlbutt wants to merge 1 commit into
mylinuxforwork:mainfrom
hurlbutt:screenshot-file-format
Open

Support jpg, ppm file format preference for screenshots#1650
hurlbutt wants to merge 1 commit into
mylinuxforwork:mainfrom
hurlbutt:screenshot-file-format

Conversation

@hurlbutt
Copy link
Copy Markdown
Contributor

@hurlbutt hurlbutt commented Jun 2, 2026

Description

Today the screenshot utility uses grim and grimblast without specifying the --type parameter, resulting in all files being saved as PNG even if the preferred file format is JPG. This pull request modifies the screenshot logic to read the file format from ~/.config/ml4w/settings/screenshot-filename and attempt to use that file format preference when using grim to save images.

Changes

  • Modified dotfiles/.config/ml4w/bin/ml4w-screenshot utility to extract file extension from preference and extended support to JPG and PPM file formats.
  • Modified dotfiles/.config/hypr/scripts/screenshot.sh script to extract file extension from preference and extended support to JPG and PPM file formats (when applicable).
  • Updated dotfiles/.config/hypr/scripts/screenshot.sh script to use same default logic for folder and file preference as laid out in dotfiles/.config/ml4w/bin/ml4w-screenshot.

Context

How Has This Been Tested?

  • Tested on Arch Linux/Based Distro.
  • Tested on Fedora Linux/Based Distro.
  • Tested on openSuse.

Checklist

Please ensure your pull request meets the following requirements:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • My changes do not introduce new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes.

Additional Notes

  • grimblast only supports PNG file formats when copying the image to the clipboard. As a result, any request to "Copy" or "Copy & Save" will result in the file format always being PNG.
  • grim and grimblast only support PNG, JPG, and PPM formats. Any other file format (e.g. WEBP) will result in the image being saved as a PNG. A potential future enhancement may be to allow for the script to convert the image via imagemagick, but that should require it's own PR with thought put towards any lossy issues with file format conversions.

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.

1 participant