Persist screen brightness, enable universal evdev key/lid wake, and add *+# screenshot combo
This commit is contained in:
1 parent
eef8584a8d
commit
2e2adcc7f2
38 files changed
+574
-161
No files matched your search
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
# Capture a 240x320 X11 screenshot using scrot and notify the user.
|
||||
|
||||
export DISPLAY="${DISPLAY:-:0}"
|
||||
export HOME="${HOME:-/home/user}"
|
||||
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/10000}"
|
||||
|
||||
PIC_DIR="${XDG_PICTURES_DIR:-$HOME/Pictures}"
|
||||
mkdir -p "$PIC_DIR" 2>/dev/null || true
|
||||
|
||||
TS="$(date +%Y%m%d-%H%M%S)"
|
||||
OUT_FILE="${1:-$PIC_DIR/screenshot-$TS.png}"
|
||||
if [ -e "$OUT_FILE" ]; then
|
||||
i=1
|
||||
while [ -e "${OUT_FILE%.png}-$i.png" ]; do
|
||||
i=$((i + 1))
|
||||
done
|
||||
OUT_FILE="${OUT_FILE%.png}-$i.png"
|
||||
fi
|
||||
|
||||
if scrot "$OUT_FILE" >/dev/null 2>&1; then
|
||||
printf '%s\n' "$OUT_FILE"
|
||||
if command -v sxmo_vibrate >/dev/null 2>&1; then
|
||||
sxmo_vibrate 60 >/dev/null 2>&1 &
|
||||
fi
|
||||
if command -v sxmo_notify_user.sh >/dev/null 2>&1; then
|
||||
sxmo_notify_user.sh -t 1500 "Saved $(basename "$OUT_FILE")" >/dev/null 2>&1 &
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exit 1
|
||||
Reference in new issue
Block a user