mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Compare commits
19 Commits
475e4abb40
...
628ed4dc99
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
628ed4dc99 | ||
|
|
a9cde940c2 | ||
|
|
779ef2f5fe | ||
|
|
131dcce268 | ||
|
|
368d3583a6 | ||
|
|
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" ;;
|
||||||
|
|||||||
@ -7,10 +7,8 @@ restore_paused "yes"
|
|||||||
max_output_buffer_size "16384"
|
max_output_buffer_size "16384"
|
||||||
|
|
||||||
audio_output {
|
audio_output {
|
||||||
type "pulse"
|
type "pipewire"
|
||||||
name "pulse"
|
name "PipeWire Sound Server"
|
||||||
#type "alsa"
|
|
||||||
#name "ALSA"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
audio_output {
|
audio_output {
|
||||||
|
|||||||
@ -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 \
|
||||||
@ -57,5 +57,4 @@ alias \
|
|||||||
alias \
|
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/shortcutenvrc ; 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
|
||||||
|
|||||||
@ -15,6 +15,7 @@ setopt inc_append_history
|
|||||||
|
|
||||||
# Load aliases and shortcuts if existent.
|
# Load aliases and shortcuts if existent.
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
||||||
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -79,8 +79,13 @@ case "$chosen" in
|
|||||||
💾*)
|
💾*)
|
||||||
chosen="${chosen%% *}"
|
chosen="${chosen%% *}"
|
||||||
chosen="${chosen:1}" # This is a bashism.
|
chosen="${chosen:1}" # This is a bashism.
|
||||||
|
parttype="$(echo "$lsblkoutput" | grep "$chosen")"
|
||||||
attemptmount || getmount
|
attemptmount || getmount
|
||||||
sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
|
case "${parttype##* }" in
|
||||||
|
vfat) sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000 ;;
|
||||||
|
btrfs) sudo -A mount "$chosen" "$mp" ;;
|
||||||
|
*) sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" ;;
|
||||||
|
esac
|
||||||
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
|
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
|
|||||||
|
|
||||||
# Output locations. Unactivated progs should go to /dev/null.
|
# Output locations. Unactivated progs should go to /dev/null.
|
||||||
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
||||||
|
shell_env_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
|
||||||
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
||||||
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
|
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
|
||||||
vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
|
vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
|
||||||
@ -16,12 +17,14 @@ vifm_shortcuts="/dev/null"
|
|||||||
rm -f "$lf_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
|
rm -f "$lf_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
|
||||||
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
|
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
|
||||||
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
|
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
|
||||||
|
printf "# vim: filetype=sh\\n" > "$shell_env_shortcuts"
|
||||||
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
|
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
|
||||||
|
|
||||||
# Format the `directories` file in the correct syntax and sent it to all three configs.
|
# Format the `directories` file in the correct syntax and sent it to all three configs.
|
||||||
eval "echo \"$(cat "$bmdirs")\"" | \
|
eval "echo \"$(cat "$bmdirs")\"" | \
|
||||||
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
||||||
printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
||||||
|
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;
|
||||||
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
||||||
printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
||||||
printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ;
|
printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ;
|
||||||
@ -33,6 +36,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
|||||||
eval "echo \"$(cat "$bmfiles")\"" | \
|
eval "echo \"$(cat "$bmfiles")\"" | \
|
||||||
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
||||||
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
||||||
|
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;
|
||||||
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
||||||
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
||||||
printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ;
|
printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ;
|
||||||
|
|||||||
@ -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