mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
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>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user