Repository navigation
Add X11 global shortcuts - #8
Merged
Merged
Conversation
A settings file can move between the two apps, and the grab plan refuses a bare typing key.
The hotkey thread does not share Avalonia's Display. A chord the desktop already owns is skipped, and changing a shortcut grabs the keyboard only until the next chord.
On X11 the Shortcuts page edits the chords. Wayland keeps the command list, and the tray names the snip shortcut.
# Conflicts: # .github/workflows/build.yml # README.md # linux/App.cs # linux/SettingsWindow.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On X11, OpenSnip now uses the same global shortcuts as Windows. The defaults are Win + Shift + S, PrtSc, Shift + PrtSc, and Ctrl + PrtSc. Settings → Shortcuts edits them. Wayland still uses the desktop's own bindings for
opensnip --snip,--snip-delay, and--repeat.Why
The Linux app could capture a region, but only after something else launched it. The shortcut strings already live in the shared settings file, so an X11 session can honor the same chords without a new settings format.
A chord the desktop already owns is left alone, and the others still register. Alt + PrtSc and Win + PrtSc stay with the desktop. Changing a shortcut grabs the keyboard only until the next chord, so a bare letter can be rejected and the next try still lands.
How tested
dotnet test tests/OpenSnip.Hotkeys.Tests/OpenSnip.Hotkeys.Tests.csproj -c Release— 8 passed. The live test grabs a chord, checks that a plain key stays free, captures a shortcut, then fires the chord that was just captured. It returns immediately whenDISPLAYis unset, which is what CI has.dotnet build src/OpenSnip.csproj -c Release -p:EnableWindowsTargeting=true— succeeded, 0 warnings. No Windows source changed.error.logstayed empty.