14 lines
531 B
Bash
Executable file
14 lines
531 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
|
command_exists() {
|
|
command -v "$@" >/dev/null 2>&1
|
|
}
|
|
|
|
if command_exists hyprshot; then
|
|
notify-send -u low "screenshot" "Using hyprshot"
|
|
hyprshot --clipboard-only -m region
|
|
elif command_exists grim; then
|
|
notify-send -u low "screenshot" "Using grim"
|
|
grim -g "$(slurp)" -o $HOME/.config/screenshots/ - | wl-copy -t image/png
|
|
fi
|