waycrate / wayshot

Mirrored at https://git.sr.ht/~shinyzenith/wayshot | screenshot tool for wlroots based compositors implementing zwlr_screencopy_v1
https://crates.io/crates/wayshot
BSD 2-Clause "Simplified" License
114 stars 20 forks source link

Implement config file #97

Open Gigas002 opened 7 months ago

Gigas002 commented 7 months ago

Hello everyone! Thank you for developing great screenshotting tool for Wayland desktops.

Since I personally prefer use configs instead of running apps with args, I came up with idea of implementing config file for wayshot. Sorry if you think that it doesn't fit for this project. Here's an example with some properties I find essential for a screenshoting tool:

[keybindings]
screen = "ALT,PRTSCR"
selection = "PRTSCR"
window = "CTRL,PRTSCR"
cancel = "ESC"
save = "CTRL,C"

[screenshot]
# not sure what value should be here, since I've never used it
display = "default"
cursor = false

[screenshot.clipboard]
clipboard = true

[screenshot.filesystem]
filesystem = true
path = "~/images/screenshots"
format = "%Y-%m-%d_%H:%M:%S"
extension = "webp"

Looked into wayshot/src/clap.rs for some properties to include here too. I may be guessing something incorrectly, since I'm not aware which of these are in scope of the project (e.g. probably the keybindings should be handled on a compositor-level config..?)

AFAIK there's no reads from keyboard in program, since it uses slurp for selection, so I don't think the keybindings are in the scope of the project, not at until #1 is closed, at least. Except for this, I think that path is in progress in #96? And from the looks of it, it doesn't seem hard to implement custom format specification.

Shinyzenith commented 7 months ago

Hello everyone! Thank you for developing great screenshotting tool for Wayland desktops.

:heart:

Since I personally prefer use configs instead of running apps with args, I came up with idea of implementing config file for wayshot. Sorry if you think that it doesn't fit for this project. Here's an example with some properties I find essential for a screenshoting tool:

While I'd like to not expand the projejct into config sections, I'm not too against it either -- I think we should maybe have the other maintainers drop in their ideas too. CC: @Decodetalkers (feel free to ACK the proposal).

Looked into wayshot/src/clap.rs for some properties to include here too. I may be guessing something incorrectly, since I'm not aware which of these are in scope of the project (e.g. probably the keybindings should be handled on a compositor-level config..?)

Keybindings are compositor policy.