Skip to content

Commit a36dcfe

Browse files
authored
Merge pull request #79 from devmobasa/qol-improvements
Qol improvements
2 parents 48ddd1e + c556fa1 commit a36dcfe

File tree

15 files changed

+698
-61
lines changed

15 files changed

+698
-61
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ journalctl --user -u wayscriber.service -f
296296
| <kbd>Ctrl+Shift+C</kbd> | Select region → clipboard |
297297
| <kbd>Ctrl+Shift+S</kbd> | Select region → save PNG |
298298
| <kbd>Ctrl+Shift+O</kbd> | Capture active window |
299+
| <kbd>Ctrl+Alt+O</kbd> | Open last capture folder |
299300

300301
Requires `wl-clipboard`, `grim`, `slurp`. Falls back to xdg-desktop-portal if missing.
301302

@@ -354,6 +355,9 @@ Press <kbd>F1</kbd> or <kbd>F10</kbd> at any time for the in-app cheat sheet.
354355
|--------|-----|
355356
| Undo | <kbd>Ctrl+Z</kbd> |
356357
| Redo | <kbd>Ctrl+Shift+Z</kbd> / <kbd>Ctrl+Y</kbd> |
358+
| Copy selection | <kbd>Ctrl+Alt+C</kbd> |
359+
| Paste selection | <kbd>Ctrl+Alt+V</kbd> |
360+
| Select all | <kbd>Ctrl+A</kbd> |
357361
| Eraser | <kbd>D</kbd> |
358362
| Toggle eraser mode | <kbd>Ctrl+Shift+E</kbd> |
359363
| Clear all | <kbd>E</kbd> |

config.example.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,13 @@ redo = ["Ctrl+Shift+Z", "Ctrl+Y"]
504504
# Duplicate currently selected annotations
505505
duplicate_selection = ["Ctrl+D"]
506506

507+
# Copy/paste selected annotations
508+
copy_selection = ["Ctrl+Alt+C"]
509+
paste_selection = ["Ctrl+Alt+V"]
510+
511+
# Select all annotations
512+
select_all = ["Ctrl+A"]
513+
507514
# Reorder selected annotations within the stack
508515
move_selection_to_front = ["]"]
509516
move_selection_to_back = ["["]
@@ -518,7 +525,7 @@ nudge_selection_right = ["ArrowRight", "Shift+PageDown"]
518525
nudge_selection_up_large = ["PageUp"]
519526
nudge_selection_down_large = ["PageDown"]
520527

521-
# Move selection to edges (left/right by default; top/bottom after a vertical nudge)
528+
# Move selection to horizontal edges (left/right)
522529
move_selection_to_start = ["Home"]
523530
move_selection_to_end = ["End"]
524531

@@ -596,6 +603,9 @@ capture_file_selection = ["Ctrl+Shift+S"]
596603
capture_clipboard_region = ["Ctrl+6"]
597604
capture_file_region = ["Ctrl+Shift+6"]
598605

606+
# Open the most recent capture folder
607+
open_capture_folder = ["Ctrl+Alt+O"]
608+
599609
# Toggle frozen mode
600610
toggle_frozen_mode = ["Ctrl+Shift+F"]
601611

configurator/src/models/keybindings.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ pub enum KeybindingField {
2020
EnterStickyNoteMode,
2121
ClearCanvas,
2222
Undo,
23+
CopySelection,
24+
PasteSelection,
25+
SelectAll,
2326
IncreaseThickness,
2427
DecreaseThickness,
2528
SelectPenTool,
@@ -50,6 +53,7 @@ pub enum KeybindingField {
5053
CaptureFileSelection,
5154
CaptureClipboardRegion,
5255
CaptureFileRegion,
56+
OpenCaptureFolder,
5357
ToggleFrozenMode,
5458
ZoomIn,
5559
ZoomOut,
@@ -128,6 +132,9 @@ impl KeybindingField {
128132
Self::EnterStickyNoteMode,
129133
Self::ClearCanvas,
130134
Self::Undo,
135+
Self::CopySelection,
136+
Self::PasteSelection,
137+
Self::SelectAll,
131138
Self::IncreaseThickness,
132139
Self::DecreaseThickness,
133140
Self::SelectPenTool,
@@ -158,6 +165,7 @@ impl KeybindingField {
158165
Self::CaptureFileSelection,
159166
Self::CaptureClipboardRegion,
160167
Self::CaptureFileRegion,
168+
Self::OpenCaptureFolder,
161169
Self::ToggleFrozenMode,
162170
Self::ZoomIn,
163171
Self::ZoomOut,
@@ -189,6 +197,9 @@ impl KeybindingField {
189197
Self::EnterStickyNoteMode => "Enter sticky note mode",
190198
Self::ClearCanvas => "Clear canvas",
191199
Self::Undo => "Undo",
200+
Self::CopySelection => "Copy selection",
201+
Self::PasteSelection => "Paste selection",
202+
Self::SelectAll => "Select all",
192203
Self::IncreaseThickness => "Increase thickness",
193204
Self::DecreaseThickness => "Decrease thickness",
194205
Self::SelectPenTool => "Select pen tool",
@@ -219,6 +230,7 @@ impl KeybindingField {
219230
Self::CaptureFileSelection => "File selection",
220231
Self::CaptureClipboardRegion => "Clipboard region",
221232
Self::CaptureFileRegion => "File region",
233+
Self::OpenCaptureFolder => "Open capture folder",
222234
Self::ToggleFrozenMode => "Toggle freeze",
223235
Self::ZoomIn => "Zoom in",
224236
Self::ZoomOut => "Zoom out",
@@ -250,6 +262,9 @@ impl KeybindingField {
250262
Self::EnterStickyNoteMode => "enter_sticky_note_mode",
251263
Self::ClearCanvas => "clear_canvas",
252264
Self::Undo => "undo",
265+
Self::CopySelection => "copy_selection",
266+
Self::PasteSelection => "paste_selection",
267+
Self::SelectAll => "select_all",
253268
Self::IncreaseThickness => "increase_thickness",
254269
Self::DecreaseThickness => "decrease_thickness",
255270
Self::SelectPenTool => "select_pen_tool",
@@ -280,6 +295,7 @@ impl KeybindingField {
280295
Self::CaptureFileSelection => "capture_file_selection",
281296
Self::CaptureClipboardRegion => "capture_clipboard_region",
282297
Self::CaptureFileRegion => "capture_file_region",
298+
Self::OpenCaptureFolder => "open_capture_folder",
283299
Self::ToggleFrozenMode => "toggle_frozen_mode",
284300
Self::ZoomIn => "zoom_in",
285301
Self::ZoomOut => "zoom_out",
@@ -311,6 +327,9 @@ impl KeybindingField {
311327
Self::EnterStickyNoteMode => &config.enter_sticky_note_mode,
312328
Self::ClearCanvas => &config.clear_canvas,
313329
Self::Undo => &config.undo,
330+
Self::CopySelection => &config.copy_selection,
331+
Self::PasteSelection => &config.paste_selection,
332+
Self::SelectAll => &config.select_all,
314333
Self::IncreaseThickness => &config.increase_thickness,
315334
Self::DecreaseThickness => &config.decrease_thickness,
316335
Self::SelectPenTool => &config.select_pen_tool,
@@ -341,6 +360,7 @@ impl KeybindingField {
341360
Self::CaptureFileSelection => &config.capture_file_selection,
342361
Self::CaptureClipboardRegion => &config.capture_clipboard_region,
343362
Self::CaptureFileRegion => &config.capture_file_region,
363+
Self::OpenCaptureFolder => &config.open_capture_folder,
344364
Self::ToggleFrozenMode => &config.toggle_frozen_mode,
345365
Self::ZoomIn => &config.zoom_in,
346366
Self::ZoomOut => &config.zoom_out,
@@ -372,6 +392,9 @@ impl KeybindingField {
372392
Self::EnterStickyNoteMode => config.enter_sticky_note_mode = value,
373393
Self::ClearCanvas => config.clear_canvas = value,
374394
Self::Undo => config.undo = value,
395+
Self::CopySelection => config.copy_selection = value,
396+
Self::PasteSelection => config.paste_selection = value,
397+
Self::SelectAll => config.select_all = value,
375398
Self::IncreaseThickness => config.increase_thickness = value,
376399
Self::DecreaseThickness => config.decrease_thickness = value,
377400
Self::SelectPenTool => config.select_pen_tool = value,
@@ -402,6 +425,7 @@ impl KeybindingField {
402425
Self::CaptureFileSelection => config.capture_file_selection = value,
403426
Self::CaptureClipboardRegion => config.capture_clipboard_region = value,
404427
Self::CaptureFileRegion => config.capture_file_region = value,
428+
Self::OpenCaptureFolder => config.open_capture_folder = value,
405429
Self::ToggleFrozenMode => config.toggle_frozen_mode = value,
406430
Self::ZoomIn => config.zoom_in = value,
407431
Self::ZoomOut => config.zoom_out = value,

docs/CONFIG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@ redo = ["Ctrl+Shift+Z", "Ctrl+Y"]
509509
# Duplicate current selection
510510
duplicate_selection = ["Ctrl+D"]
511511

512+
# Copy/paste selection
513+
copy_selection = ["Ctrl+Alt+C"]
514+
paste_selection = ["Ctrl+Alt+V"]
515+
516+
# Select all annotations
517+
select_all = ["Ctrl+A"]
518+
512519
# Nudge selection (hold Shift for a larger step)
513520
nudge_selection_up = ["ArrowUp"]
514521
nudge_selection_down = ["ArrowDown"]
@@ -519,7 +526,7 @@ nudge_selection_right = ["ArrowRight", "Shift+PageDown"]
519526
nudge_selection_up_large = ["PageUp"]
520527
nudge_selection_down_large = ["PageDown"]
521528

522-
# Move selection to edges (left/right by default; top/bottom after a vertical nudge)
529+
# Move selection to horizontal edges (left/right)
523530
move_selection_to_start = ["Home"]
524531
move_selection_to_end = ["End"]
525532

@@ -584,6 +591,9 @@ capture_file_selection = ["Ctrl+Shift+S"]
584591
capture_clipboard_region = ["Ctrl+6"]
585592
capture_file_region = ["Ctrl+Shift+6"]
586593

594+
# Open the most recent capture folder
595+
open_capture_folder = ["Ctrl+Alt+O"]
596+
587597
# Toggle frozen mode
588598
toggle_frozen_mode = ["Ctrl+Shift+F"]
589599

@@ -673,7 +683,9 @@ clear_canvas = ["X"]
673683
- Duplicate keybindings across actions will be detected and reported at startup
674684

675685
**Defaults:**
676-
All defaults match the original hardcoded keybindings to maintain compatibility.
686+
Defaults match the original hardcoded keybindings where possible. Copy/paste selection uses
687+
<kbd>Ctrl+Alt+C</kbd>/<kbd>Ctrl+Alt+V</kbd>, so the clipboard-selection capture shortcut
688+
defaults to <kbd>Ctrl+Shift+C</kbd> to avoid conflicts.
677689

678690
## Creating Your Configuration
679691

src/backend/wayland/backend.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,18 @@ impl WaylandBackend {
922922
message_parts.join(" • ")
923923
};
924924

925+
let open_folder_binding = state
926+
.config
927+
.keybindings
928+
.open_capture_folder
929+
.first()
930+
.map(|binding| binding.as_str());
931+
state.input_state.set_capture_feedback(
932+
result.saved_path.as_deref(),
933+
result.copied_to_clipboard,
934+
open_folder_binding,
935+
);
936+
925937
notification::send_notification_async(
926938
&state.tokio_handle,
927939
"Screenshot Captured".to_string(),

src/config/keybindings.rs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ pub enum Action {
2525
UndoAllDelayed,
2626
RedoAllDelayed,
2727
DuplicateSelection,
28+
CopySelection,
29+
PasteSelection,
30+
SelectAll,
2831
MoveSelectionToFront,
2932
MoveSelectionToBack,
3033
NudgeSelectionUp,
@@ -93,6 +96,7 @@ pub enum Action {
9396
CaptureFileSelection,
9497
CaptureClipboardRegion,
9598
CaptureFileRegion,
99+
OpenCaptureFolder,
96100
ToggleFrozenMode,
97101
ZoomIn,
98102
ZoomOut,
@@ -246,6 +250,15 @@ pub struct KeybindingsConfig {
246250
#[serde(default = "default_duplicate_selection")]
247251
pub duplicate_selection: Vec<String>,
248252

253+
#[serde(default = "default_copy_selection")]
254+
pub copy_selection: Vec<String>,
255+
256+
#[serde(default = "default_paste_selection")]
257+
pub paste_selection: Vec<String>,
258+
259+
#[serde(default = "default_select_all")]
260+
pub select_all: Vec<String>,
261+
249262
#[serde(default = "default_move_selection_to_front")]
250263
pub move_selection_to_front: Vec<String>,
251264

@@ -411,6 +424,9 @@ pub struct KeybindingsConfig {
411424
#[serde(default = "default_capture_file_region")]
412425
pub capture_file_region: Vec<String>,
413426

427+
#[serde(default = "default_open_capture_folder")]
428+
pub open_capture_folder: Vec<String>,
429+
414430
#[serde(default = "default_toggle_frozen_mode")]
415431
pub toggle_frozen_mode: Vec<String>,
416432

@@ -475,6 +491,9 @@ impl Default for KeybindingsConfig {
475491
undo_all_delayed: Vec::new(),
476492
redo_all_delayed: Vec::new(),
477493
duplicate_selection: default_duplicate_selection(),
494+
copy_selection: default_copy_selection(),
495+
paste_selection: default_paste_selection(),
496+
select_all: default_select_all(),
478497
move_selection_to_front: default_move_selection_to_front(),
479498
move_selection_to_back: default_move_selection_to_back(),
480499
nudge_selection_up: default_nudge_selection_up(),
@@ -531,6 +550,7 @@ impl Default for KeybindingsConfig {
531550
capture_file_selection: default_capture_file_selection(),
532551
capture_clipboard_region: default_capture_clipboard_region(),
533552
capture_file_region: default_capture_file_region(),
553+
open_capture_folder: default_open_capture_folder(),
534554
toggle_frozen_mode: default_toggle_frozen_mode(),
535555
zoom_in: default_zoom_in(),
536556
zoom_out: default_zoom_out(),
@@ -617,6 +637,18 @@ impl KeybindingsConfig {
617637
insert_binding(binding_str, Action::DuplicateSelection)?;
618638
}
619639

640+
for binding_str in &self.copy_selection {
641+
insert_binding(binding_str, Action::CopySelection)?;
642+
}
643+
644+
for binding_str in &self.paste_selection {
645+
insert_binding(binding_str, Action::PasteSelection)?;
646+
}
647+
648+
for binding_str in &self.select_all {
649+
insert_binding(binding_str, Action::SelectAll)?;
650+
}
651+
620652
for binding_str in &self.move_selection_to_front {
621653
insert_binding(binding_str, Action::MoveSelectionToFront)?;
622654
}
@@ -863,6 +895,10 @@ impl KeybindingsConfig {
863895
insert_binding(binding_str, Action::CaptureFileRegion)?;
864896
}
865897

898+
for binding_str in &self.open_capture_folder {
899+
insert_binding(binding_str, Action::OpenCaptureFolder)?;
900+
}
901+
866902
for binding_str in &self.toggle_frozen_mode {
867903
insert_binding(binding_str, Action::ToggleFrozenMode)?;
868904
}
@@ -969,6 +1005,18 @@ fn default_duplicate_selection() -> Vec<String> {
9691005
vec!["Ctrl+D".to_string()]
9701006
}
9711007

1008+
fn default_copy_selection() -> Vec<String> {
1009+
vec!["Ctrl+Alt+C".to_string()]
1010+
}
1011+
1012+
fn default_paste_selection() -> Vec<String> {
1013+
vec!["Ctrl+Alt+V".to_string()]
1014+
}
1015+
1016+
fn default_select_all() -> Vec<String> {
1017+
vec!["Ctrl+A".to_string()]
1018+
}
1019+
9721020
fn default_move_selection_to_front() -> Vec<String> {
9731021
vec!["]".to_string()]
9741022
}
@@ -1193,6 +1241,10 @@ fn default_capture_file_region() -> Vec<String> {
11931241
vec!["Ctrl+Shift+6".to_string()]
11941242
}
11951243

1244+
fn default_open_capture_folder() -> Vec<String> {
1245+
vec!["Ctrl+Alt+O".to_string()]
1246+
}
1247+
11961248
fn default_toggle_frozen_mode() -> Vec<String> {
11971249
vec!["Ctrl+Shift+F".to_string()]
11981250
}
@@ -1391,6 +1443,18 @@ mod tests {
13911443
let move_back = KeyBinding::parse("[").unwrap();
13921444
assert_eq!(map.get(&move_back), Some(&Action::MoveSelectionToBack));
13931445

1446+
let copy_selection = KeyBinding::parse("Ctrl+Alt+C").unwrap();
1447+
assert_eq!(map.get(&copy_selection), Some(&Action::CopySelection));
1448+
1449+
let capture_selection = KeyBinding::parse("Ctrl+Shift+C").unwrap();
1450+
assert_eq!(
1451+
map.get(&capture_selection),
1452+
Some(&Action::CaptureClipboardSelection)
1453+
);
1454+
1455+
let select_all = KeyBinding::parse("Ctrl+A").unwrap();
1456+
assert_eq!(map.get(&select_all), Some(&Action::SelectAll));
1457+
13941458
let toggle_highlight = KeyBinding::parse("Ctrl+Shift+H").unwrap();
13951459
assert_eq!(
13961460
map.get(&toggle_highlight),

0 commit comments

Comments
 (0)