mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Compare commits
15 Commits
e8b0e45c34
...
c26f04fb84
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c26f04fb84 | ||
|
|
cf38cd5ba8 | ||
|
|
82ddcd87ec | ||
|
|
c771c66b18 | ||
|
|
d56ca0c95b | ||
|
|
22141ca754 | ||
|
|
b4b462029c | ||
|
|
e8ba78c518 | ||
|
|
dda032a37d | ||
|
|
e64728177b | ||
|
|
e1bfc20f96 | ||
|
|
6556ef5c4d | ||
|
|
7a9bfe6f69 | ||
|
|
534348e0b6 | ||
|
|
3fb60852de |
@ -172,7 +172,7 @@ map U $printf "%s" "$fx" | xclip -selection clipboard
|
|||||||
map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard
|
map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard
|
||||||
map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
||||||
map <gt> $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
map <gt> $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard
|
||||||
map T $sxiv -t "$(pwd)" # opens thumbnail mode
|
map T $nsxiv -t "$(pwd)" # opens thumbnail mode
|
||||||
map <c-l> unselect
|
map <c-l> unselect
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,11 +19,11 @@ image() {
|
|||||||
|
|
||||||
case "$(file --dereference --brief --mime-type -- "$1")" in
|
case "$(file --dereference --brief --mime-type -- "$1")" in
|
||||||
image/avif) 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 | cut -d' ' -f1)"
|
image/avif) 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 | cut -d' ' -f1)"
|
||||||
[ ! -f "$CACHE" ] && convert "$1" "$CACHE.jpg"
|
[ ! -f "$CACHE" ] && magick "$1" "$CACHE.jpg"
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
image/vnd.djvu)
|
image/vnd.djvu)
|
||||||
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 | cut -d' ' -f1)"
|
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 | cut -d' ' -f1)"
|
||||||
[ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | convert -density 200 - "$CACHE.jpg" > /dev/null 2>&1
|
[ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | magick -density 200 - "$CACHE.jpg" > /dev/null 2>&1
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
image/svg+xml)
|
image/svg+xml)
|
||||||
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 | cut -d' ' -f1)"
|
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 | cut -d' ' -f1)"
|
||||||
@ -32,7 +32,7 @@ image/svg+xml)
|
|||||||
;;
|
;;
|
||||||
image/x-xcf)
|
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}')"
|
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"
|
[ ! -f "$CACHE.jpg" ] && magick "$1[0]" "$CACHE.jpg"
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||||
;;
|
;;
|
||||||
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
|
|||||||
@ -14,11 +14,11 @@ do
|
|||||||
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
||||||
;;
|
;;
|
||||||
"r")
|
"r")
|
||||||
convert -rotate 90 "$file" "$file" ;;
|
magick -rotate 90 "$file" "$file" ;;
|
||||||
"R")
|
"R")
|
||||||
convert -rotate -90 "$file" "$file" ;;
|
magick -rotate -90 "$file" "$file" ;;
|
||||||
"f")
|
"f")
|
||||||
convert -flop "$file" "$file" ;;
|
magick -flop "$file" "$file" ;;
|
||||||
"y")
|
"y")
|
||||||
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
|
printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard &&
|
||||||
notify-send "$file copied to clipboard" & ;;
|
notify-send "$file copied to clipboard" & ;;
|
||||||
|
|||||||
@ -13,6 +13,16 @@ map J zoom out
|
|||||||
map i recolor
|
map i recolor
|
||||||
map p print
|
map p print
|
||||||
map g goto top
|
map g goto top
|
||||||
|
map [fullscreen] u scroll half-up
|
||||||
|
map [fullscreen] d scroll half-down
|
||||||
|
map [fullscreen] D toggle_page_mode
|
||||||
|
map [fullscreen] r reload
|
||||||
|
map [fullscreen] R rotate
|
||||||
|
map [fullscreen] K zoom in
|
||||||
|
map [fullscreen] J zoom out
|
||||||
|
map [fullscreen] i recolor
|
||||||
|
map [fullscreen] p print
|
||||||
|
map [fullscreen] g goto top
|
||||||
|
|
||||||
set default-bg "{background}"
|
set default-bg "{background}"
|
||||||
set default-fg "{foreground}"
|
set default-fg "{foreground}"
|
||||||
|
|||||||
@ -13,3 +13,13 @@ map J zoom out
|
|||||||
map i recolor
|
map i recolor
|
||||||
map p print
|
map p print
|
||||||
map g goto top
|
map g goto top
|
||||||
|
map [fullscreen] u scroll half-up
|
||||||
|
map [fullscreen] d scroll half-down
|
||||||
|
map [fullscreen] D toggle_page_mode
|
||||||
|
map [fullscreen] r reload
|
||||||
|
map [fullscreen] R rotate
|
||||||
|
map [fullscreen] K zoom in
|
||||||
|
map [fullscreen] J zoom out
|
||||||
|
map [fullscreen] i recolor
|
||||||
|
map [fullscreen] p print
|
||||||
|
map [fullscreen] g goto top
|
||||||
|
|||||||
@ -9,12 +9,12 @@ 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)\\nOCR a selected area (copy)" | dmenu -l 7 -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)\\ncopy selected image to text" | 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}" ;;
|
||||||
"a selected area (copy)") maim -u -s | ${xclip_cmd} ;;
|
"a selected area (copy)") maim -u -s | ${xclip_cmd} ;;
|
||||||
"current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
|
"current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
|
||||||
"full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;;
|
"full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;;
|
||||||
"a selected area (OCR)") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;;
|
"copy selected image to text") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -67,7 +67,6 @@ if [ -n "${audio+x}" ]; then
|
|||||||
*) echo "That doesn't look like an audio file."; exit 1 ;;
|
*) echo "That doesn't look like an audio file."; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))"
|
totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))"
|
||||||
endtime="$((totseconds-seconds))"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prepdir="${prepdir:-$cache/$file}"
|
prepdir="${prepdir:-$cache/$file}"
|
||||||
@ -95,10 +94,10 @@ do
|
|||||||
# If images have already been made in a previous run, do not recreate
|
# If images have already been made in a previous run, do not recreate
|
||||||
# them unless -r was given.
|
# them unless -r was given.
|
||||||
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
||||||
convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base"
|
magick -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base"
|
||||||
else
|
else
|
||||||
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
||||||
convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base"
|
magick -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the first line, do not write yet.
|
# If the first line, do not write yet.
|
||||||
@ -111,6 +110,7 @@ duration $duration"
|
|||||||
prevseconds="$(date '+%s' -d "$prevtime")"
|
prevseconds="$(date '+%s' -d "$prevtime")"
|
||||||
done < "$file"
|
done < "$file"
|
||||||
# Do last file which must be given twice as follows
|
# Do last file which must be given twice as follows
|
||||||
|
endtime="$((totseconds-seconds))"
|
||||||
echo "file '$base'
|
echo "file '$base'
|
||||||
duration ${endtime:-5}
|
duration ${endtime:-5}
|
||||||
file '$base'"
|
file '$base'"
|
||||||
|
|||||||
23
.local/bin/statusbar/sb-brightness
Executable file
23
.local/bin/statusbar/sb-brightness
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# current brightness
|
||||||
|
curr_brightness=$(cat /sys/class/backlight/*/brightness)
|
||||||
|
|
||||||
|
# max_brightness
|
||||||
|
max_brightness=$(cat /sys/class/backlight/*/max_brightness)
|
||||||
|
|
||||||
|
# brightness percentage
|
||||||
|
brightness_per=$((100 * curr_brightness / max_brightness))
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
1)
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
notify-send "💡 Brightness module" "\- Shows current brightness level ☀️."
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
setsid -f "$TERMINAL" -e "$EDITOR" "$0"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "💡 ${brightness_per}%"
|
||||||
@ -19,7 +19,7 @@ case "$clock" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|sed 's/ //g')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
||||||
2) setsid -f "$TERMINAL" -e calcurse ;;
|
2) setsid -f "$TERMINAL" -e calcurse ;;
|
||||||
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
||||||
- Middle click opens calcurse if installed" ;;
|
- Middle click opens calcurse if installed" ;;
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
|
1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
|
||||||
2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
|
2) wpctl set-mute @DEFAULT_SINK@ toggle ;;
|
||||||
4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
|
4) wpctl set-volume @DEFAULT_SINK@ 1%+ ;;
|
||||||
5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
|
5) wpctl set-volume @DEFAULT_SINK@ 1%- ;;
|
||||||
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
||||||
- Middle click to mute.
|
- Middle click to mute.
|
||||||
- Scroll to change." ;;
|
- Scroll to change." ;;
|
||||||
|
|||||||
@ -3,14 +3,7 @@
|
|||||||
# Clears the build files of a LaTeX/XeLaTeX build.
|
# Clears the build files of a LaTeX/XeLaTeX build.
|
||||||
# I have vim run this file whenever I exit a .tex file.
|
# I have vim run this file whenever I exit a .tex file.
|
||||||
|
|
||||||
case "$1" in
|
[ "${1##*.}" = "tex" ] && {
|
||||||
*.tex)
|
find "$(dirname "${1}")" -regex '.*\(_minted.*\|.*\.\(4tc\|xref\|tmp\|pyc\|pyg\|pyo\|fls\|vrb\|fdb_latexmk\|bak\|swp\|aux\|log\|synctex\(busy\)\|lof\|lot\|maf\|idx\|mtc\|mtc0\|nav\|out\|snm\|toc\|bcf\|run\.xml\|synctex\.gz\|blg\|bbl\)\)' -delete
|
||||||
file=$(readlink -f "$1")
|
} || printf "Provide a .tex file.\n"
|
||||||
dir=$(dirname "$file")
|
|
||||||
base="${file%.*}"
|
|
||||||
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete
|
|
||||||
rm -rdf "$dir/_minted-$(basename -- "$base")"
|
|
||||||
;;
|
|
||||||
*) printf "Give .tex file as argument.\\n" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user