mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Compare commits
9 Commits
a3d90504b6
...
e8b0e45c34
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8b0e45c34 | ||
|
|
475e4abb40 | ||
|
|
476b0916c7 | ||
|
|
01661e9bba | ||
|
|
a06fe894c9 | ||
|
|
d08eea1cf5 | ||
|
|
fe6b9043b8 | ||
|
|
62618ae588 | ||
|
|
f313b6c0f5 |
@ -30,6 +30,11 @@ image/svg+xml)
|
|||||||
[ ! -f "$CACHE" ] && inkscape --convert-dpi-method=none -o "$CACHE.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$1"
|
[ ! -f "$CACHE" ] && inkscape --convert-dpi-method=none -o "$CACHE.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$1"
|
||||||
image "$CACHE.png" "$2" "$3" "$4" "$5" "$1"
|
image "$CACHE.png" "$2" "$3" "$4" "$5" "$1"
|
||||||
;;
|
;;
|
||||||
|
image/x-xcf)
|
||||||
|
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')"
|
||||||
|
[ ! -f "$CACHE.jpg" ] && convert "$1[0]" "$CACHE.jpg"
|
||||||
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||||
|
;;
|
||||||
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
||||||
text/troff) man ./ "$1" | col -b ;;
|
text/troff) man ./ "$1" | col -b ;;
|
||||||
|
|||||||
23
.local/bin/fixnames
Normal file
23
.local/bin/fixnames
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/dash
|
||||||
|
|
||||||
|
[ -z "${1}" ] && {
|
||||||
|
printf "%s\n" "Specify a file path as an argument. e.g., fixnames <path>" >&2
|
||||||
|
exit "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
[ "$(id -u)" = "0" ] && printf "%s\n" "This script should not be run as root" >&2 && exit "1"
|
||||||
|
|
||||||
|
find "${1}" -depth \( -path '*/.*' -o -path '*/.*/*' -o -path '.' \) -prune -o \( -type f -o -type d \) -print0 | sort -zr | xargs -0 -P "0" -I {} dash -c '
|
||||||
|
|
||||||
|
base="${1##*/}"
|
||||||
|
path="${1%/*}"
|
||||||
|
|
||||||
|
pattern="s/[^a-zA-Z0-9 ._-]//g; s/[ .-]/_/g; s/_+/_/g; s/^_+//; s/_+$//; s/[A-Z]/\L&/g"
|
||||||
|
|
||||||
|
[ -f "${1}" ] && pattern="${pattern}; s/_([^_]+)$/.\\1/"
|
||||||
|
|
||||||
|
new_name="$(printf "%s\n" "${base}" | sed -E "${pattern}")"
|
||||||
|
|
||||||
|
[ "${base}" != "${new_name}" ] && [ -e "${path}/${new_name}" ] && new_name="${$}_${new_name}"
|
||||||
|
[ "${base}" != "${new_name}" ] && mv "${1}" "${path}/${new_name}"
|
||||||
|
' _ {}
|
||||||
@ -9,7 +9,7 @@ output="$(date '+%y%m%d-%H%M-%S').png"
|
|||||||
xclip_cmd="xclip -sel clip -t image/png"
|
xclip_cmd="xclip -sel clip -t image/png"
|
||||||
ocr_cmd="xclip -sel clip"
|
ocr_cmd="xclip -sel clip"
|
||||||
|
|
||||||
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
|
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\nOCR a selected area (copy)" | dmenu -l 7 -i -p "Screenshot which area?")" in
|
||||||
"a selected area") maim -u -s pic-selected-"${output}" ;;
|
"a selected area") maim -u -s pic-selected-"${output}" ;;
|
||||||
"current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;;
|
"current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;;
|
||||||
"full screen") maim -q -d 0.2 pic-full-"${output}" ;;
|
"full screen") maim -q -d 0.2 pic-full-"${output}" ;;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user