add screenshots functionallity
This commit is contained in:
@@ -10,6 +10,9 @@ bind=ALT+SHIFT,r,reload_config
|
||||
bind=Alt,space,spawn,fuzzel
|
||||
bind=Alt,Return,spawn,ghostty
|
||||
|
||||
# screenshot
|
||||
bind=NONE,Print,spawn,$HOME/.config/mango/scripts/screenshot/fullscreen.sh
|
||||
bind=NONE,XF86SelectiveScreenshot,spawn,$HOME/.config/mango/scripts/screenshot/region.sh
|
||||
# exit
|
||||
bind=SUPER,m,quit
|
||||
bind=ALT,q,killclient,
|
||||
|
||||
@@ -9,7 +9,7 @@ blur_layer=1
|
||||
i# Caches the wallpaper and blur background, significantly reducing GPU usage.
|
||||
# Disabling it will significantly increase GPU consumption and may cause rendering lag.
|
||||
# Highly recommended.
|
||||
blur_optimized=1
|
||||
blur_optimized=0
|
||||
|
||||
# The strength (radius) of the blur.
|
||||
blur_params_radius=10
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# https://mangowm.github.io/docs/window-management/rules#layer-rules
|
||||
|
||||
layerrule=animation_type_open:zoom,layer_name:rofi
|
||||
layerrule=animation_type_close:zoom,layer_name:rofi
|
||||
# No blur or animation for slurp selection layer (avoids occlusion and ghosting in screenshots)
|
||||
layerrule=noanim:1,noblur:1,layer_name:selection
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
# https://mangowm.github.io/docs/window-management/rules#window-rules
|
||||
|
||||
windowrule=noblur:1,appid:slurp
|
||||
windowrule=isfloating:1,appid:satty
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -eu pipefail
|
||||
|
||||
TARGET_DIR="$HOME/screenshots"
|
||||
TARGET_FILE="$(date +%Y-%m-%d-%H%M%S-%2N).png"
|
||||
TARGET_PATH="$TARGET_DIR/$TARGET_FILE"
|
||||
|
||||
ensure_target_dir()
|
||||
{
|
||||
if [ ! -d "$TARGET_DIR" ]; then
|
||||
mkdir -p "$TARGET_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
is_slurping()
|
||||
{
|
||||
pgrep -x slurp >/dev/null
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -eu pipefail
|
||||
|
||||
. ~/.config/mango/scripts/screenshot/common.sh
|
||||
|
||||
ensure_target_dir
|
||||
grim - | satty --filename - \
|
||||
--output-filename "$TARGET_PATH" \
|
||||
--actions-on-enter "save-to-file","save-to-clipboard","exit" \
|
||||
--actions-on-escape "save-to-clipboard","exit" \
|
||||
--copy-command "wl-copy --type image/png" \
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -eu pipefail
|
||||
|
||||
. ~/.config/mango/scripts/screenshot/common.sh
|
||||
|
||||
if is_slurping; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ensure_target_dir
|
||||
geometry=$(slurp -d); [ -z "$geometry" ] && exit 1
|
||||
|
||||
grim -g "$geometry" - | satty --filename - \
|
||||
--output-filename "$TARGET_PATH" \
|
||||
--actions-on-enter "save-to-file","save-to-clipboard","exit" \
|
||||
--actions-on-escape "save-to-clipboard","exit" \
|
||||
--copy-command "wl-copy --type image/png" \
|
||||
Reference in New Issue
Block a user