mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Compare commits
24 Commits
2d2785e147
...
db779b6efd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db779b6efd | ||
|
|
368d3583a6 | ||
|
|
cf38cd5ba8 | ||
|
|
82ddcd87ec | ||
|
|
c771c66b18 | ||
|
|
d56ca0c95b | ||
|
|
22141ca754 | ||
|
|
b4b462029c | ||
|
|
e8ba78c518 | ||
|
|
dda032a37d | ||
|
|
e64728177b | ||
|
|
e1bfc20f96 | ||
|
|
6556ef5c4d | ||
|
|
7a9bfe6f69 | ||
|
|
5c346d90ac | ||
|
|
534348e0b6 | ||
|
|
3fb60852de | ||
|
|
7752ed9ef1 | ||
|
|
0465be083b | ||
|
|
c25ce80916 | ||
|
|
156747aa77 | ||
|
|
8ec5ec569d | ||
|
|
8b4e8f59bb | ||
|
|
62e2856882 |
@ -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" & ;;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ done; unset command
|
|||||||
se() {
|
se() {
|
||||||
choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)"
|
choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)"
|
||||||
[ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
|
[ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
|
||||||
;}
|
}
|
||||||
|
|
||||||
# Verbosity and settings that you pretty much just always are going to want.
|
# Verbosity and settings that you pretty much just always are going to want.
|
||||||
alias \
|
alias \
|
||||||
@ -58,4 +58,3 @@ alias \
|
|||||||
lf="lfub" \
|
lf="lfub" \
|
||||||
magit="nvim -c MagitOnly" \
|
magit="nvim -c MagitOnly" \
|
||||||
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
|
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
|
||||||
weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -1,14 +1,71 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ -z "$1" ] && echo "Give either a pdf file or a DOI as an argument." && exit
|
|
||||||
|
|
||||||
if [ -f "$1" ]; then
|
BIB_FILE="${HOME}/latex/uni.bib"
|
||||||
# Try to get DOI from pdfinfo or pdftotext output.
|
[ -f "${BIB_FILE}" ] || BIB_FILE="${2:-$(find "${HOME}" -path "${HOME}/.*" \
|
||||||
doi=$(pdfinfo "$1" | grep -io "doi:.*") ||
|
-prune -o -type "f" -name "*.bib" -print -quit)}"
|
||||||
doi=$(pdftotext "$1" 2>/dev/null - | sed -n '/[dD][oO][iI]:/{s/.*[dD][oO][iI]:\s*\(\S\+[[:alnum:]]\).*/\1/p;q}') ||
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
doi="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check crossref.org for the bib citation.
|
{ [ -f "${BIB_FILE}" ] || [ "${2}" ]; } || {
|
||||||
curl -s "https://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n"
|
printf "%s\n" "Create a .bib file or provide as \$2." && exit "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
filter() {
|
||||||
|
sed -n -E 's/.*((DOI|doi)((\.(org))?\/?|:? *))([^: ]+[^ .]).*/\6/p; T; q'
|
||||||
|
}
|
||||||
|
|
||||||
|
fpdf() {
|
||||||
|
pdf="${1}"
|
||||||
|
doi="$(pdfinfo "${pdf}" 2> "/dev/null" | filter)"
|
||||||
|
|
||||||
|
[ "${doi}" ] || doi="$(pdftotext -q -l "2" "${pdf}" - 2> "/dev/null" | filter)"
|
||||||
|
|
||||||
|
[ "${doi}" ] || printf "%s\n" "No DOI found for PDF: ${pdf}" >&2
|
||||||
|
|
||||||
|
printf "%s\n" "${doi}"
|
||||||
|
}
|
||||||
|
|
||||||
|
arrange() {
|
||||||
|
sed 's/\}, /\},\n /g
|
||||||
|
s/, /,\n /
|
||||||
|
s/ }/\n}/
|
||||||
|
s/,\s*pages=/,\n\tpages=/' |
|
||||||
|
sed '1s/^ *//
|
||||||
|
1s/[0-9]*\([0-9]\{2\}\)/\1/
|
||||||
|
1s/_//
|
||||||
|
1s/.*/\L&/
|
||||||
|
s/.*=/\L&/
|
||||||
|
s/=/ = /'
|
||||||
|
}
|
||||||
|
|
||||||
|
doi2bib() {
|
||||||
|
doi="${1#doi:}"
|
||||||
|
url="https://api.crossref.org/works/${doi}/transform/application/x-bibtex"
|
||||||
|
entry="$(curl -kLsS --no-fail "${url}" | arrange)"
|
||||||
|
red='\033[0;31m'
|
||||||
|
reset='\033[0m'
|
||||||
|
|
||||||
|
printf "${red}%s${reset}\n" "${entry}"
|
||||||
|
|
||||||
|
[ "${entry%"${entry#?}"}" != "@" ] && {
|
||||||
|
printf "%s\n" "Failed to fetch bibtex entry for DOI: ${doi}"
|
||||||
|
return "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
grep -iFq "doi = {${doi}}" "${BIB_FILE}" 2> "/dev/null" && {
|
||||||
|
printf "%s\n" "Bibtex entry for DOI: ${doi} already exists in the file."
|
||||||
|
} || {
|
||||||
|
[ -s "${BIB_FILE}" ] && printf "\n" >> "${BIB_FILE}"
|
||||||
|
printf "%s\n" "${entry}" >> "${BIB_FILE}"
|
||||||
|
printf "%s\n" "Added bibtex entry for DOI: ${doi}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[ "${1}" ] || {
|
||||||
|
printf "%s\n" "Give either a pdf file or a DOI or a directory path that has PDFs as an argument."
|
||||||
|
exit "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
[ -f "${1}" ] && doi="$(fpdf "${1}")" && doi2bib "${doi}" && exit "0"
|
||||||
|
|
||||||
|
[ -d "${1}" ] && for i in "${1}"/*.pdf; do doi="$(fpdf "${i}")" && doi2bib "${doi}"; done && exit "0"
|
||||||
|
|
||||||
|
doi="$(printf "%s\n" "${1}" | filter)" && doi2bib "${doi}"
|
||||||
|
|||||||
@ -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
|
|
||||||
|
|
||||||
|
|||||||
25
.local/bin/weath
Normal file
25
.local/bin/weath
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Get the weather on the terminal. You can pass an alternative location as a parameter,
|
||||||
|
# and/or use the 'cp' option to copy the forecast as plaintext to the clipboard.
|
||||||
|
|
||||||
|
report="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
|
||||||
|
|
||||||
|
if [ "$1" = 'cp' ]; then
|
||||||
|
# shellcheck disable=SC2015
|
||||||
|
[ -z "$2" ] && sed 's/\x1b\[[^m]*m//g' "$report" | xclip -selection clipboard &&
|
||||||
|
notify-send "Weather forecast for '${LOCATION:-$(head -n 1 "$report" | cut -d' ' -f3-)}' copied to clipboard." ||
|
||||||
|
{ data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$2?T")" &&
|
||||||
|
notify-send "Weather forecast for '$2' copied to clipboard." &&
|
||||||
|
echo "$data" | xclip -selection clipboard ||
|
||||||
|
notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'; }
|
||||||
|
else
|
||||||
|
[ -n "$2" ] &&
|
||||||
|
notify-send "Invalid option '$1'! The only valid option is 'cp'." &&
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
# shellcheck disable=SC2015
|
||||||
|
[ -z "$1" ] && less -S "$report" ||
|
||||||
|
data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$1")" && echo "$data" | less -S ||
|
||||||
|
notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user