diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2025-01-14 09:10:45 +0100 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-01-14 13:39:52 +0300 |
| commit | 0df7a085de6fb0ebfe7af640e60fb496e52656aa (patch) | |
| tree | 78255e74c2989f5a3ba449a80c3cc7a3498bf8d7 /niri-config/src | |
| parent | 6ae51f287cb286a96fcf492444f33b0d6ad4a56a (diff) | |
| download | niri-0df7a085de6fb0ebfe7af640e60fb496e52656aa.tar.gz niri-0df7a085de6fb0ebfe7af640e60fb496e52656aa.tar.bz2 niri-0df7a085de6fb0ebfe7af640e60fb496e52656aa.zip | |
add write-to-disk argument to screenshot actions
Diffstat (limited to 'niri-config/src')
| -rw-r--r-- | niri-config/src/lib.rs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index fb7ae213..612eec12 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -1185,16 +1185,21 @@ pub enum Action { Spawn(#[knuffel(arguments)] Vec<String>), DoScreenTransition(#[knuffel(property(name = "delay-ms"))] Option<u16>), #[knuffel(skip)] - ConfirmScreenshot, + ConfirmScreenshot { + write_to_disk: bool, + }, #[knuffel(skip)] CancelScreenshot, #[knuffel(skip)] ScreenshotTogglePointer, Screenshot, - ScreenshotScreen, - ScreenshotWindow, + ScreenshotScreen(#[knuffel(property(name = "write-to-disk"), default = true)] bool), + ScreenshotWindow(#[knuffel(property(name = "write-to-disk"), default = true)] bool), #[knuffel(skip)] - ScreenshotWindowById(u64), + ScreenshotWindowById { + id: u64, + write_to_disk: bool, + }, CloseWindow, #[knuffel(skip)] CloseWindowById(u64), @@ -1351,9 +1356,17 @@ impl From<niri_ipc::Action> for Action { niri_ipc::Action::Spawn { command } => Self::Spawn(command), niri_ipc::Action::DoScreenTransition { delay_ms } => Self::DoScreenTransition(delay_ms), niri_ipc::Action::Screenshot {} => Self::Screenshot, - niri_ipc::Action::ScreenshotScreen {} => Self::ScreenshotScreen, - niri_ipc::Action::ScreenshotWindow { id: None } => Self::ScreenshotWindow, - niri_ipc::Action::ScreenshotWindow { id: Some(id) } => Self::ScreenshotWindowById(id), + niri_ipc::Action::ScreenshotScreen { write_to_disk } => { + Self::ScreenshotScreen(write_to_disk) + } + niri_ipc::Action::ScreenshotWindow { + id: None, + write_to_disk, + } => Self::ScreenshotWindow(write_to_disk), + niri_ipc::Action::ScreenshotWindow { + id: Some(id), + write_to_disk, + } => Self::ScreenshotWindowById { id, write_to_disk }, niri_ipc::Action::CloseWindow { id: None } => Self::CloseWindow, niri_ipc::Action::CloseWindow { id: Some(id) } => Self::CloseWindowById(id), niri_ipc::Action::FullscreenWindow { id: None } => Self::FullscreenWindow, |
