mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Compare commits
25 Commits
b2fd92f46e
...
f794b3d622
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f794b3d622 | ||
|
|
bca6b403eb | ||
|
|
42f3efb4b0 | ||
|
|
708d6c6731 | ||
|
|
b8cd0ab495 | ||
|
|
c550a7c6e5 | ||
|
|
86f05abcce | ||
|
|
798ba175d0 | ||
|
|
a360fadd5f | ||
|
|
8315e4c885 | ||
|
|
f26e5678e6 | ||
|
|
ed9633da3f | ||
|
|
ec8e82745e | ||
|
|
44cb5f12e6 | ||
|
|
d8a8970715 | ||
|
|
0497dcd51c | ||
|
|
6f6b749d0e | ||
|
|
9a85d328cc | ||
|
|
07de33840d | ||
|
|
08639706a9 | ||
|
|
af2710799b | ||
|
|
1633233c9d | ||
|
|
ce1f0bfa05 | ||
|
|
0a29cfbf4f | ||
|
|
991b052a55 |
@ -4,7 +4,7 @@
|
|||||||
<alias>
|
<alias>
|
||||||
<family>serif</family>
|
<family>serif</family>
|
||||||
<prefer>
|
<prefer>
|
||||||
<family>Linux Libertine</family>
|
<family>Libertinus Serif</family>
|
||||||
<family>Joy Pixels</family>
|
<family>Joy Pixels</family>
|
||||||
<family>Noto Color Emoji</family>
|
<family>Noto Color Emoji</family>
|
||||||
<family>FontAwesome</family>
|
<family>FontAwesome</family>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<alias>
|
<alias>
|
||||||
<family>sans-serif</family>
|
<family>sans-serif</family>
|
||||||
<prefer>
|
<prefer>
|
||||||
<family>Linux Biolinum</family>
|
<family>Libertinus Sans</family>
|
||||||
<family>Joy Pixels</family>
|
<family>Joy Pixels</family>
|
||||||
<family>Noto Color Emoji</family>
|
<family>Noto Color Emoji</family>
|
||||||
<family>FontAwesome</family>
|
<family>FontAwesome</family>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<alias>
|
<alias>
|
||||||
<family>sans</family>
|
<family>sans</family>
|
||||||
<prefer>
|
<prefer>
|
||||||
<family>Linux Biolinum</family>
|
<family>Libertinus Sans</family>
|
||||||
<family>Joy Pixels</family>
|
<family>Joy Pixels</family>
|
||||||
<family>Noto Color Emoji</family>
|
<family>Noto Color Emoji</family>
|
||||||
<family>FontAwesome</family>
|
<family>FontAwesome</family>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<family>monospace</family>
|
<family>monospace</family>
|
||||||
<prefer>
|
<prefer>
|
||||||
<family>Noto Sans Mono</family>
|
<family>Noto Sans Mono</family>
|
||||||
<family>Liberation Mono</family>
|
<family>Libertinus Mono</family>
|
||||||
<family>FontAwesome</family>
|
<family>FontAwesome</family>
|
||||||
<family>Braille</family>
|
<family>Braille</family>
|
||||||
</prefer>
|
</prefer>
|
||||||
|
|||||||
@ -35,7 +35,7 @@ cmd open ${{
|
|||||||
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
|
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
|
||||||
image/svg+xml) display -- $f ;;
|
image/svg+xml) display -- $f ;;
|
||||||
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" |
|
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" |
|
||||||
setsid -f sxiv -aio 2>/dev/null | while read -r file; do
|
setsid -f nsxiv -aio 2>/dev/null | while read -r file; do
|
||||||
[ -z "$file" ] && continue
|
[ -z "$file" ] && continue
|
||||||
lf -remote "send select \"$file\""
|
lf -remote "send select \"$file\""
|
||||||
lf -remote "send toggle"
|
lf -remote "send toggle"
|
||||||
@ -58,7 +58,22 @@ cmd extract ${{
|
|||||||
printf "%s\n\t" "$fx"
|
printf "%s\n\t" "$fx"
|
||||||
printf "extract?[y/N]"
|
printf "extract?[y/N]"
|
||||||
read ans
|
read ans
|
||||||
[ $ans = "y" ] && aunpack $fx
|
[ $ans = "y" ] && {
|
||||||
|
case $fx in
|
||||||
|
*.tar.bz2) tar xjf $fx ;;
|
||||||
|
*.tar.gz) tar xzf $fx ;;
|
||||||
|
*.bz2) bunzip2 $fx ;;
|
||||||
|
*.rar) unrar e $fx ;;
|
||||||
|
*.gz) gunzip $fx ;;
|
||||||
|
*.tar) tar xf $fx ;;
|
||||||
|
*.tbz2) tar xjf $fx ;;
|
||||||
|
*.tgz) tar xzf $fx ;;
|
||||||
|
*.zip) unzip $fx ;;
|
||||||
|
*.Z) uncompress $fx ;;
|
||||||
|
*.7z) 7z x $fx ;;
|
||||||
|
*.tar.xz) tar xf $fx ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd delete ${{
|
cmd delete ${{
|
||||||
@ -93,7 +108,27 @@ cmd copyto ${{
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
cmd setbg "$1"
|
cmd setbg "$1"
|
||||||
cmd bulkrename $vidir
|
|
||||||
|
cmd bulkrename ${{
|
||||||
|
tmpfile_old="$(mktemp)"
|
||||||
|
tmpfile_new="$(mktemp)"
|
||||||
|
|
||||||
|
[ -n "$fs" ] && fs=$(basename -a $fs) || fs=$(ls)
|
||||||
|
|
||||||
|
echo "$fs" > "$tmpfile_old"
|
||||||
|
echo "$fs" > "$tmpfile_new"
|
||||||
|
$EDITOR "$tmpfile_new"
|
||||||
|
|
||||||
|
[ "$(wc -l < "$tmpfile_old")" -eq "$(wc -l < "$tmpfile_new")" ] || { rm -f "$tmpfile_old" "$tmpfile_new"; exit 1; }
|
||||||
|
|
||||||
|
paste "$tmpfile_old" "$tmpfile_new" | while IFS="$(printf '\t')" read -r src dst
|
||||||
|
do
|
||||||
|
[ "$src" = "$dst" ] || [ -e "$dst" ] || mv -- "$src" "$dst"
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f "$tmpfile_old" "$tmpfile_new"
|
||||||
|
lf -remote "send $id unselect"
|
||||||
|
}}
|
||||||
|
|
||||||
# Bindings
|
# Bindings
|
||||||
map <c-f> $lf -remote "send $id select \"$(fzf)\""
|
map <c-f> $lf -remote "send $id select \"$(fzf)\""
|
||||||
@ -113,11 +148,11 @@ map X !$f
|
|||||||
map o &mimeopen "$f"
|
map o &mimeopen "$f"
|
||||||
map O $mimeopen --ask "$f"
|
map O $mimeopen --ask "$f"
|
||||||
|
|
||||||
map A rename # at the very end
|
map A :rename; cmd-end # at the very end
|
||||||
map c push A<c-u> # new rename
|
map c push A<c-u> # new rename
|
||||||
map I push A<c-a> # at the very beginning
|
map I :rename; cmd-home # at the very beginning
|
||||||
map i push A<a-b><a-b><a-f> # before extension
|
map i :rename # before extension
|
||||||
map a push A<a-b> # after extension
|
map a :rename; cmd-right # after extension
|
||||||
map B bulkrename
|
map B bulkrename
|
||||||
map b $setbg $f
|
map b $setbg $f
|
||||||
|
|
||||||
|
|||||||
@ -25,10 +25,14 @@ 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" ] && convert "$1" "$CACHE.jpg"
|
||||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||||
|
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)"
|
||||||
|
[ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | convert -density 200 - "$CACHE.jpg" > /dev/null 2>&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" ;;
|
||||||
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 ;;
|
||||||
text/* | */xml | application/json) bat --terminal-width "$(($4-2))" -f "$1" ;;
|
text/* | */xml | application/json | application/x-ndjson) bat --terminal-width "$(($4-2))" -f "$1" ;;
|
||||||
audio/* | application/octet-stream) mediainfo "$1" || exit 1 ;;
|
audio/* | application/octet-stream) mediainfo "$1" || exit 1 ;;
|
||||||
video/* )
|
video/* )
|
||||||
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)"
|
||||||
|
|||||||
@ -31,3 +31,4 @@ progressbar_elapsed_color = blue:b
|
|||||||
statusbar_color = red
|
statusbar_color = red
|
||||||
statusbar_time_color = cyan:b
|
statusbar_time_color = cyan:b
|
||||||
execute_on_song_change="pkill -RTMIN+11 dwmblocks"
|
execute_on_song_change="pkill -RTMIN+11 dwmblocks"
|
||||||
|
execute_on_player_state_change="pkill -RTMIN+11 dwmblocks"
|
||||||
|
|||||||
@ -117,6 +117,8 @@ set noshowcmd
|
|||||||
autocmd BufWritePre * let currPos = getpos(".")
|
autocmd BufWritePre * let currPos = getpos(".")
|
||||||
autocmd BufWritePre * %s/\s\+$//e
|
autocmd BufWritePre * %s/\s\+$//e
|
||||||
autocmd BufWritePre * %s/\n\+\%$//e
|
autocmd BufWritePre * %s/\n\+\%$//e
|
||||||
|
autocmd BufWritePre *.[ch] %s/\%$/\r/e " add trailing newline for ANSI C standard
|
||||||
|
autocmd BufWritePre *neomutt* %s/^--$/-- /e " dash-dash-space signature delimiter in emails
|
||||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
||||||
|
|
||||||
" When shortcut files are updated, renew bash and ranger configs with new material:
|
" When shortcut files are updated, renew bash and ranger configs with new material:
|
||||||
|
|||||||
@ -20,4 +20,4 @@ cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player)
|
|||||||
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
|
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
|
||||||
cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
|
cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
|
||||||
cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
|
cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
|
||||||
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler
|
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/nsxiv/exec/key-handler # nsxiv (image viewer) key/script handler
|
||||||
|
|||||||
@ -16,5 +16,8 @@ IFS='
|
|||||||
|
|
||||||
# Update each found profile.
|
# Update each found profile.
|
||||||
for profile in $profiles; do
|
for profile in $profiles; do
|
||||||
arkenfox-updater -p "${profile%%/user.js*}" -s
|
userjs=${profile%%/user.js*}
|
||||||
|
user=$(stat -c '%U' "$userjs") || continue
|
||||||
|
|
||||||
|
su -l "$user" -c "arkenfox-updater -c -p $userjs -s"
|
||||||
done
|
done
|
||||||
|
|||||||
@ -12,7 +12,7 @@ inputaudio="$1"
|
|||||||
ext="${1##*.}"
|
ext="${1##*.}"
|
||||||
|
|
||||||
# Get a safe file name from the book.
|
# Get a safe file name from the book.
|
||||||
escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
escbook="$(echo "$booktitle" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
||||||
|
|
||||||
! mkdir -p "$escbook" &&
|
! mkdir -p "$escbook" &&
|
||||||
echo "Do you have write access in this directory?" &&
|
echo "Do you have write access in this directory?" &&
|
||||||
@ -31,7 +31,7 @@ do
|
|||||||
cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -metadata total=\"$total\" -ss \"$start\" -to \"$end\" -vn -c:a copy \"$file\" "
|
cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -metadata total=\"$total\" -ss \"$start\" -to \"$end\" -vn -c:a copy \"$file\" "
|
||||||
fi
|
fi
|
||||||
title="$(echo "$x" | cut -d' ' -f2-)"
|
title="$(echo "$x" | cut -d' ' -f2-)"
|
||||||
esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
esctitle="$(echo "$title" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
||||||
track="$((track+1))"
|
track="$((track+1))"
|
||||||
start="$end"
|
start="$end"
|
||||||
done < "$2"
|
done < "$2"
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
# some choice programs to use to open it.
|
# some choice programs to use to open it.
|
||||||
feed="${1:-$(true | dmenu -p 'Paste URL or file path')}"
|
feed="${1:-$(true | dmenu -p 'Paste URL or file path')}"
|
||||||
|
|
||||||
case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in
|
case "$(printf "copy url\\nnsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in
|
||||||
"copy url") echo "$feed" | xclip -selection clipboard ;;
|
"copy url") echo "$feed" | xclip -selection clipboard ;;
|
||||||
mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;;
|
mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;;
|
||||||
"mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;;
|
"mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;;
|
||||||
@ -13,7 +13,7 @@ case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv
|
|||||||
"queue yt-dlp audio") qndl "$feed" 'yt-dlp -o "%(title)s.%(ext)s" -f bestaudio --embed-metadata --restrict-filenames' ;;
|
"queue yt-dlp audio") qndl "$feed" 'yt-dlp -o "%(title)s.%(ext)s" -f bestaudio --embed-metadata --restrict-filenames' ;;
|
||||||
"queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;;
|
"queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;;
|
||||||
PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
||||||
sxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
nsxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
||||||
vim) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
vim) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
||||||
setbg) curl -L "$feed" > $XDG_CACHE_HOME/pic ; xwallpaper --zoom $XDG_CACHE_HOME/pic >/dev/null 2>&1 ;;
|
setbg) curl -L "$feed" > $XDG_CACHE_HOME/pic ; xwallpaper --zoom $XDG_CACHE_HOME/pic >/dev/null 2>&1 ;;
|
||||||
browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;;
|
browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Feed script a url or file location.
|
# Feed script a url or file location.
|
||||||
# If an image, it will view in sxiv,
|
# If an image, it will view in nsxiv,
|
||||||
# if a video or gif, it will view in mpv
|
# if a video or gif, it will view in mpv
|
||||||
# if a music file or pdf, it will download,
|
# if a music file or pdf, it will download,
|
||||||
# otherwise it opens link in browser.
|
# otherwise it opens link in browser.
|
||||||
@ -15,8 +15,8 @@ fi
|
|||||||
case "$url" in
|
case "$url" in
|
||||||
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
|
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
|
||||||
setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;;
|
setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;;
|
||||||
*png|*jpg|*jpe|*jpeg|*gif)
|
*png|*jpg|*jpe|*jpeg|*gif|*webp)
|
||||||
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
||||||
*pdf|*cbz|*cbr)
|
*pdf|*cbz|*cbr)
|
||||||
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
||||||
*mp3|*flac|*opus|*mp3?source*)
|
*mp3|*flac|*opus|*mp3?source*)
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# When I open an image from the file manager in sxiv (the image viewer), I want
|
# When I open an image from the file manager in nsxiv (the image viewer), I want
|
||||||
# to be able to press the next/previous keys to key through the rest of the
|
# to be able to press the next/previous keys to key through the rest of the
|
||||||
# images in the same directory. This script "rotates" the content of a
|
# images in the same directory. This script "rotates" the content of a
|
||||||
# directory based on the first chosen file, so that if I open the 15th image,
|
# directory based on the first chosen file, so that if I open the 15th image,
|
||||||
# if I press next, it will go to the 16th etc. Autistic, I know, but this is
|
# if I press next, it will go to the 16th etc. Autistic, I know, but this is
|
||||||
# one of the reasons that sxiv is great for being able to read standard input.
|
# one of the reasons that nsxiv is great for being able to read standard input.
|
||||||
|
|
||||||
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
|
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
|
||||||
base="$(basename "$1")"
|
base="$(basename "$1")"
|
||||||
|
|||||||
@ -13,11 +13,18 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
|
|||||||
dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
|
dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
|
||||||
zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
|
zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
|
||||||
|
|
||||||
|
# Give -s as parameter to make notifications silent.
|
||||||
|
while getopts "s" o; do case "${o}" in
|
||||||
|
s) silent='1' ;;
|
||||||
|
esac done
|
||||||
|
|
||||||
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
trueloc="$(readlink -f "$1")" &&
|
trueloc="$(readlink -f "$1")" &&
|
||||||
case "$(file --mime-type -b "$trueloc")" in
|
case "$(file --mime-type -b "$trueloc")" in
|
||||||
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
|
image/* ) ln -sf "$trueloc" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Changing wallpaper..." ;;
|
||||||
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
|
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
|
||||||
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
*) [ -z "$silent" ] && notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If pywal is installed, use it.
|
# If pywal is installed, use it.
|
||||||
|
|||||||
@ -19,7 +19,7 @@ case "$clock" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s|..27m|</span></b>|")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e')\>/<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" ;;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ url="${WTTRURL:-wttr.in}"
|
|||||||
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
|
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
|
||||||
|
|
||||||
# Get a weather report from 'wttr.in' and save it locally.
|
# Get a weather report from 'wttr.in' and save it locally.
|
||||||
getforecast() { curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
|
getforecast() { timeout --signal=1 2s curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
|
||||||
|
|
||||||
# Forecast should be updated only once a day.
|
# Forecast should be updated only once a day.
|
||||||
checkforecast() {
|
checkforecast() {
|
||||||
@ -38,7 +38,7 @@ showweather() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;
|
1) setsid -f "$TERMINAL" -e less -Sf "$weatherreport" ;;
|
||||||
2) getforecast && showweather ;;
|
2) getforecast && showweather ;;
|
||||||
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
|
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
|
||||||
- Middle click to update forecast.
|
- Middle click to update forecast.
|
||||||
|
|||||||
@ -17,10 +17,17 @@ case $BLOCK_BUTTON in
|
|||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
|
# Wifi
|
||||||
|
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
|
||||||
wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
||||||
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
|
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
|
||||||
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ "
|
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="📡 " || wifiicon="❌ "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
|
# Ethernet
|
||||||
|
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="❎"
|
||||||
|
|
||||||
|
# TUN
|
||||||
|
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" 🔒"
|
||||||
|
|
||||||
|
printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon"
|
||||||
|
|||||||
@ -11,9 +11,9 @@ transmission-remote -l | grep % |
|
|||||||
sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
|
sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid -f "$TERMINAL" -e tremc ;;
|
1) setsid -f "$TERMINAL" -e stig ;;
|
||||||
2) td-toggle ;;
|
2) td-toggle ;;
|
||||||
3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
|
3) notify-send "🌱 Torrent module" "\- Left click to open stig.
|
||||||
- Middle click to toggle transmission.
|
- Middle click to toggle transmission.
|
||||||
- Shift click to edit script.
|
- Shift click to edit script.
|
||||||
Module shows number of torrents:
|
Module shows number of torrents:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# Prints the current volume or 🔇 if muted.
|
# Prints the current volume or 🔇 if muted.
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid -f "$TERMINAL" -e pulsemixer ;;
|
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_AUDIO_SINK@ toggle ;;
|
||||||
4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
|
4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
|
||||||
5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
|
5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
|
||||||
|
|||||||
@ -8,7 +8,7 @@ vidlist="
|
|||||||
dwm (window manager) https://videos.lukesmith.xyz/videos/watch/f6b78db7-b368-4647-bc64-28c08fff1988
|
dwm (window manager) https://videos.lukesmith.xyz/videos/watch/f6b78db7-b368-4647-bc64-28c08fff1988
|
||||||
dwmblocks (status bar) https://videos.lukesmith.xyz/w/mmxHMbqZZEr5FManB57Yy1
|
dwmblocks (status bar) https://videos.lukesmith.xyz/w/mmxHMbqZZEr5FManB57Yy1
|
||||||
pacman (installing/managing programs) https://videos.lukesmith.xyz/videos/watch/8e7cadb9-0fed-47ce-a2a8-6635fa48614b
|
pacman (installing/managing programs) https://videos.lukesmith.xyz/videos/watch/8e7cadb9-0fed-47ce-a2a8-6635fa48614b
|
||||||
sxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2
|
sxiv/nsxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2
|
||||||
st (terminal) https://videos.lukesmith.xyz/videos/watch/efddd39d-bac5-4599-b572-177beb4ce6e8
|
st (terminal) https://videos.lukesmith.xyz/videos/watch/efddd39d-bac5-4599-b572-177beb4ce6e8
|
||||||
i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada-40ee-a2bb-b5e1ffe0f48b
|
i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada-40ee-a2bb-b5e1ffe0f48b
|
||||||
neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e
|
neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e
|
||||||
|
|||||||
3
.local/bin/xdg-terminal-exec
Executable file
3
.local/bin/xdg-terminal-exec
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
"$TERMINAL" -e "$@"
|
||||||
@ -1,4 +1,4 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=Image viewer
|
Name=Image viewer
|
||||||
Exec=/usr/bin/sxiv -a %f
|
Exec=/usr/bin/nsxiv -a %f
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
_
|
_ __ _____ _(_)_ __
|
||||||
_____ _(_)_ __
|
| '_ \/ __\ \/ / \ \ / /
|
||||||
/ __\ \/ / \ \ / /
|
| | | \__ \> <| |\ V /
|
||||||
\__ \> <| |\ V /
|
|_| |_|___/_/\_\_| \_/
|
||||||
|___/_/\_\_| \_/
|
nsxiv is the image viewer.
|
||||||
sxiv is the image viewer.
|
|
||||||
h/j/k/l - Pan image
|
h/j/k/l - Pan image
|
||||||
-/+ - Zoom out/in
|
-/+ - Zoom out/in
|
||||||
Enter - Toggle thumbnail mode
|
Enter - Toggle thumbnail mode
|
||||||
@ -12,4 +11,4 @@ sxiv is the image viewer.
|
|||||||
r - Reload image if changed
|
r - Reload image if changed
|
||||||
m - Mark/unmark image
|
m - Mark/unmark image
|
||||||
w - Zoom to fit window
|
w - Zoom to fit window
|
||||||
ctrl-x - Run external command (see ~/.config/sxiv/exec/key-handler for options)
|
ctrl-x - Run external command (see ~/.config/nsxiv/exec/key-handler for options)
|
||||||
@ -9,7 +9,7 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on
|
|||||||
- zsh (shell)
|
- zsh (shell)
|
||||||
- lf (file manager)
|
- lf (file manager)
|
||||||
- mpd/ncmpcpp (music)
|
- mpd/ncmpcpp (music)
|
||||||
- sxiv (image/gif viewer)
|
- nsxiv (image/gif viewer)
|
||||||
- mpv (video player)
|
- mpv (video player)
|
||||||
- other stuff like xdg default programs, inputrc and more, etc.
|
- other stuff like xdg default programs, inputrc and more, etc.
|
||||||
- I try to minimize what's directly in `~` so:
|
- I try to minimize what's directly in `~` so:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user