20 lines
287 B
Bash
Executable File
20 lines
287 B
Bash
Executable File
#!/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
|
|
}
|
|
|