Skip to content

Add omarchy-screenshot #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

ryanrhughes
Copy link
Contributor

Throughout the conversation yesterday in Discord, @dhh mentioned "...But would prefer if there was just one hotkey and then you could toggle. Don't recall the mac one I was using, but on space you could toggle between region/window/screen..." which got me thinking about ways to get as close to that experience as we can. omarchy-screenshot aims to provide that flexibility, and a bit of the best of all worlds.

By default, omarchy-screenshot invokes a smart selection (via slurp) that allows you to click a window, a whole display, or drag a region and presents a menu of options of what to do after with the default location being Copy allowing for a Print Screen, Enter command sequence to net you whatever you chose to your clipboard.

untitled

Defaults

The default state is that you get smart selection, a menu after you snap your screenshot, and the edit action opens in Gradia. Those can be changed by setting the mode, passing in an editor to --editor, or passing in an action to --actions.

The border and overlay colors attempt to extract from ~/.config/omarchy/current/theme/wofi.css with a fallback if that fails allowing them to better match the active theme but also not fail if something didn't line up.

Usage Examples

  omarchy-screenshot                              # Smart selection, show menu
  omarchy-screenshot --action=copy                # Smart selection, auto-copy
  omarchy-screenshot --editor="satty --filename"  # Use Satty for editing
  omarchy-screenshot smart --action=copy          # Same as above (explicit mode)
  omarchy-screenshot windows                      # Window selection, show menu

Keybinds

Keybinds were kept matched to what the targets are now, but I believe it's feasible to reduce to two but would like feedback prior to making that change since it'll change expected behaviors.

Since the smart mode effectively combines 3, while not locking you into any one path from the outset, we don't need multiple specialized keybinds.

I would recommend we go with this.

# Screenshots
bindd = , PRINT,Take a screenshot (smart selection) , exec, ~/.local/share/omarchy/bin/omarchy-screenshot smart
bindd = SHIFT, PRINT,Take a screenshot (fullscreen), exec, ~/.local/share/omarchy/bin/omarchy-screenshot fullscreen

# Eliminate these (changing fullscreen from ctrl + print scr --> shift + print scr)
# bindd = SHIFT, PRINT,Take a screenshot (window), exec, ~/.local/share/omarchy/bin/omarchy-screenshot windows
# bindd = CTRL, PRINT,Take a screenshot (fullscreen), exec, ~/.local/share/omarchy/bin/omarchy-screenshot fullscreen
# bindd = ALT, PRINT,Take a screenshot (region), exec, ~/.local/share/omarchy/bin/omarchy-screenshot region  

Possible Improvement

I didn't set it in the defaults but I find that having the screenshot editor floated brings the best experience since I likely want to carry out some quick actions, then move on right from there. Something like this could be added to the default windows.conf.

windowrule = float, class:^(be.alexandervanhee.gradia)$
windowrule = center, class:^(be.alexandervanhee.gradia)$

@ryanrhughes ryanrhughes changed the title Add omarchy screenshot Add omarchy-screenshot Jul 12, 2025
@anoldguy
Copy link
Contributor

After checking out the branch, the requirement that I always have to make a choice instead of 'copy to clipboard' is kinda rough.

Speaking for myself, I'd love to have the default give me the smart selection, and then drop it into my clipboard and on disk.

Let the Shift version prompt and have all of the bells and whistles, IMO.

Just my personal $.02.

@ryanrhughes
Copy link
Contributor Author

@anoldguy I don't mind that either. To your point, 90% of the time, I want to do nothing but get it to my clipboard so perhaps keybinds like this would make sense.

# Screenshots
bindd = , PRINT,Copy a screenshot to clipboard (smart selection) , exec, ~/.local/share/omarchy/bin/omarchy-screenshot smart --action=copy
bindd = SHIFT, PRINT,Take a screenshot with options (smart selection) , exec, ~/.local/share/omarchy/bin/omarchy-screenshot smart
bindd = CTRL, PRINT,Take a screenshot (fullscreen), exec, ~/.local/share/omarchy/bin/omarchy-screenshot fullscreen

@ryanrhughes
Copy link
Contributor Author

I pushed up a new change that feels a little nicer to add a post-copy menu option as well. The workflow is that if you choose copy, or just use a keybind that auto-copies like bindd = , PRINT,Copy a screenshot to clipboard (smart selection) , exec, ~/.local/share/omarchy/bin/omarchy-screenshot smart --action=copy, you get a notification that the screenshot was taken and have the option to click on it to get other options.

This allows for those moments where you snap a screenshot then remember you do want to edit it or just allow for true single screenshot button flow.

image

@ryanrhughes
Copy link
Contributor Author

After living with the screenshot tool and taking over 200 screenshots, I've found a couple of minor things that the most recent commit seeks to fix.

Wofi Stacking and Resizing

If you took two screenshots back to back, the Wofi selectors would stack on top of each other. Additionally, if you received a notification while it was open, it would do this weird resizing action that was strange. Adding a couple of flags solved this issue.

These issues also appear in the power menu but I'll push that up later.

Note: While Wofi has ways to hide the search box, it doesn't have a way (or at least I haven't found one documented) to disable it. This means that if you hit a key that isn't in the words displayed, the menu will go blank until you backspace. I don't love this and it may mean a need to find a Wofi replacement for prompt menus in the future but I'll open an issue to track it. This also impacts the Power Menu.

Copy Path on Save

Another workflow I found myself doing was wanting to get the path of the image I just took and saved sometimes instead of copying to the clipboard. While attempting to address #99, I had the idea that if I added a simple step change to the workflow, it'd allow the user to screenshot, save, then paste the path solving, in a bit of a workaround, that issue as well.

I made it a flag so it can be set or unset at will but provides a solution in the event that's a thing that's of value to the individual.

@dhh dhh changed the base branch from master to dev July 17, 2025 22:47
@dhh
Copy link
Member

dhh commented Jul 17, 2025

Thanks for working on this! I think there's definitely something here, but I need a little more time to really walk through the flows.

@ryanrhughes
Copy link
Contributor Author

No worries. It's given me some time to live with it and really polish up the flow and feel.

The latest add I had solved an issue where you click and move ever so slightly with a sensitive mouse or because you're moving quickly resulting in a screenshot of a couple of pixels when you clearly wanted the window. Adding a minimum area requirement solved this and feel much better.

Goal of how it's designed is to have a good set of defaults, but easily tailored to an individual by just changing a flag or two on a keybind if they should so choose.

If we do go with #218, I have that update to the menu here already available I'll need to push up.

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.

3 participants