Closed FilippoBonazziSUSE closed 5 months ago
I just realized I have one more change on my side: I have also set the environment variable
GRIM_DEFAULT_DIR="$HOME/Pictures/screenshots/"
Otherwise, if not configured, I think grim
pollutes your home directory with your screenshots. Suggestions on how to handle this?
I would propose to set this environment variable as a default, and users can then easily override it.
I think $HOME/Pictures/screenshots/
is a decent default, so I would go with that unless there are other suggestions.
I just realized I have one more change on my side: I have also set the environment variable
GRIM_DEFAULT_DIR="$HOME/Pictures/screenshots/"
Otherwise, if not configured, I think
grim
pollutes your home directory with your screenshots. Suggestions on how to handle this?
yeah, I have it like that and am just used to it. But you are right - having a special directory for it - is handy.
I would propose to set this environment variable as a default, and users can then easily override it. I think
$HOME/Pictures/screenshots/
is a decent default, so I would go with that unless there are other suggestions.
The problem with that - the directory could be absent, so grim will fail and ppl will be confused about screenshots aren't taken.
https://wiki.archlinux.org/title/XDG_user_directories
one hacky way is probably to detect if XDG_PICTURES_DIR
is empty and set some default one in https://github.com/openSUSE/openSUSEway/blob/main/sway/sway-run.sh that we know exists (also could be checked).
Maybe even create one :) $XDG_PICTURES_DIR/screenshots
.
Launching grim
with an invalid GRIM_DEFAULT_DIR
will place the screenshot in the current directory, when launched on the command line. I see how this could break when grim
is launched from within sway
... what would be the current directory in that case? Would it be writable?
If we need to create one folder I would agree to go through the XDG folders.
ok, I didn't notice that it is a standard env for grim
:
grim will write an image to _output-file_, or to a timestamped file name in
*$GRIM_DEFAULT_DIR* if not specified. If *$GRIM_DEFAULT_DIR* is not set, it
falls back first to *$XDG_PICTURES_DIR* and then to the current working
directory. If _output-file_ is *-*, grim will write the image to the standard
output instead.
So I think we shouldn't care now. But when we do the proper installation that is probably on of the ToDo - to create standard dirs and set up XDG vars.
Follow up in #131
This is my screenshot configuration using
grim
andslurp
. It allows to:Print
: screenshot all outputs$mod + Print
: screenshot the focused outputShift + Print
: screenshot the focused windowMod1 + Print
: screenshot an interactively selected windowCtrl + Print
: screenshot an interactively selected areaBefore I merge this PR, I want to open this to contributions if others have better configurations.