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-ipc/src | |
| 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-ipc/src')
| -rw-r--r-- | niri-ipc/src/lib.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs index a7662b57..05c3a2ec 100644 --- a/niri-ipc/src/lib.rs +++ b/niri-ipc/src/lib.rs @@ -220,6 +220,14 @@ pub enum Action { /// Whether to show the mouse pointer by default in the screenshot UI. #[cfg_attr(feature = "clap", arg(short = 'p', long, action = clap::ArgAction::Set, default_value_t = true))] show_pointer: bool, + + /// Path to save the screenshot to. + /// + /// The path must be absolute, otherwise an error is returned. + /// + /// If `None`, the screenshot is saved according to the `screenshot-path` config setting. + #[cfg_attr(feature = "clap", arg(long, action = clap::ArgAction::Set))] + path: Option<String>, }, /// Screenshot the focused screen. ScreenshotScreen { @@ -232,6 +240,14 @@ pub enum Action { /// Whether to include the mouse pointer in the screenshot. #[cfg_attr(feature = "clap", arg(short = 'p', long, action = clap::ArgAction::Set, default_value_t = true))] show_pointer: bool, + + /// Path to save the screenshot to. + /// + /// The path must be absolute, otherwise an error is returned. + /// + /// If `None`, the screenshot is saved according to the `screenshot-path` config setting. + #[cfg_attr(feature = "clap", arg(long, action = clap::ArgAction::Set))] + path: Option<String>, }, /// Screenshot a window. #[cfg_attr(feature = "clap", clap(about = "Screenshot the focused window"))] @@ -246,6 +262,14 @@ pub enum Action { /// The screenshot is saved according to the `screenshot-path` config setting. #[cfg_attr(feature = "clap", arg(short = 'd', long, action = clap::ArgAction::Set, default_value_t = true))] write_to_disk: bool, + + /// Path to save the screenshot to. + /// + /// The path must be absolute, otherwise an error is returned. + /// + /// If `None`, the screenshot is saved according to the `screenshot-path` config setting. + #[cfg_attr(feature = "clap", arg(long, action = clap::ArgAction::Set))] + path: Option<String>, }, /// Enable or disable the keyboard shortcuts inhibitor (if any) for the focused surface. ToggleKeyboardShortcutsInhibit {}, |
