i3 screenshots script add quality and noopengl optional param

This commit is contained in:
thek4n 2025-05-19 16:53:24 +03:00
parent 03848abdb3
commit 84350f5842

View File

@ -8,6 +8,7 @@ readonly NOTIFY_TIME_ERROR_MS=5000
readonly NOTIFY_LABEL="Screenshot"
readonly SCREENSHOTS_DIR="${SCREENSHOTS_DIR:-${HOME}/Pictures/screenshots}"
readonly TIMESTAMP_FORMAT="%H-%M-%S_%Y-%m-%d"
readonly NOOPENGL="${NOOPENGL:-false}"
mkdir -p "${SCREENSHOTS_DIR}"
@ -27,19 +28,28 @@ _notify_error() {
"Error: ${1}"
}
_maim() {
maim_args="--quality 10"
if ${NOOPENGL}; then
maim_args="${maim_args} --noopengl"
fi
#shellcheck disable=SC2086
maim ${maim_args} "${@}"
}
_capture_select() {
maim --select
_maim --select
}
_capture_entire() {
maim
_maim
}
_capture_window() {
maim --window "$(xdotool getactivewindow)"
_maim --window "$(xdotool getactivewindow)"
}
_copy_to_clipboard() {
xclip -selection clipboard -t image/png
}