diff options
| author | Lin Xianyi <iynaix@gmail.com> | 2025-10-19 11:22:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-19 14:22:31 +0300 |
| commit | 23cd5aa78a26ccf57c6a7993313e42a5c39d43d8 (patch) | |
| tree | fff3ad5057850bf916c404cc95437e1058c56a20 /niri-config | |
| parent | 8c8447918f4fd7bc6c86a8622b1db52417fbbbbd (diff) | |
| download | niri-23cd5aa78a26ccf57c6a7993313e42a5c39d43d8.tar.gz niri-23cd5aa78a26ccf57c6a7993313e42a5c39d43d8.tar.bz2 niri-23cd5aa78a26ccf57c6a7993313e42a5c39d43d8.zip | |
Add --path argument for niri msg screenshot* commands (#2126)
* Check for empty screenshot parent before creating
Avoids a warning.
* Add --path argument for niri msg screenshot* commands
* fix
---------
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'niri-config')
| -rw-r--r-- | niri-config/src/binds.rs | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/niri-config/src/binds.rs b/niri-config/src/binds.rs index 37ac1665..71181fc0 100644 --- a/niri-config/src/binds.rs +++ b/niri-config/src/binds.rs @@ -118,16 +118,27 @@ pub enum Action { CancelScreenshot, #[knuffel(skip)] ScreenshotTogglePointer, - Screenshot(#[knuffel(property(name = "show-pointer"), default = true)] bool), + Screenshot( + #[knuffel(property(name = "show-pointer"), default = true)] bool, + // Path; not settable from knuffel + Option<String>, + ), ScreenshotScreen( #[knuffel(property(name = "write-to-disk"), default = true)] bool, #[knuffel(property(name = "show-pointer"), default = true)] bool, + // Path; not settable from knuffel + Option<String>, + ), + ScreenshotWindow( + #[knuffel(property(name = "write-to-disk"), default = true)] bool, + // Path; not settable from knuffel + Option<String>, ), - ScreenshotWindow(#[knuffel(property(name = "write-to-disk"), default = true)] bool), #[knuffel(skip)] ScreenshotWindowById { id: u64, write_to_disk: bool, + path: Option<String>, }, ToggleKeyboardShortcutsInhibit, CloseWindow, @@ -364,19 +375,28 @@ impl From<niri_ipc::Action> for Action { niri_ipc::Action::Spawn { command } => Self::Spawn(command), niri_ipc::Action::SpawnSh { command } => Self::SpawnSh(command), niri_ipc::Action::DoScreenTransition { delay_ms } => Self::DoScreenTransition(delay_ms), - niri_ipc::Action::Screenshot { show_pointer } => Self::Screenshot(show_pointer), + niri_ipc::Action::Screenshot { show_pointer, path } => { + Self::Screenshot(show_pointer, path) + } niri_ipc::Action::ScreenshotScreen { write_to_disk, show_pointer, - } => Self::ScreenshotScreen(write_to_disk, show_pointer), + path, + } => Self::ScreenshotScreen(write_to_disk, show_pointer, path), niri_ipc::Action::ScreenshotWindow { id: None, write_to_disk, - } => Self::ScreenshotWindow(write_to_disk), + path, + } => Self::ScreenshotWindow(write_to_disk, path), niri_ipc::Action::ScreenshotWindow { id: Some(id), write_to_disk, - } => Self::ScreenshotWindowById { id, write_to_disk }, + path, + } => Self::ScreenshotWindowById { + id, + write_to_disk, + path, + }, niri_ipc::Action::ToggleKeyboardShortcutsInhibit {} => { Self::ToggleKeyboardShortcutsInhibit } |
