diff --git a/.config/shell/arch b/.config/shell/arch index 0e36648..8fe00cd 100644 --- a/.config/shell/arch +++ b/.config/shell/arch @@ -22,7 +22,7 @@ yzf() { sed "s/ /\t/g" | fzf --nth=$pos --multi --history="${FZF_HISTDIR:-$XDG_STATE_HOME/fzf}/history-yzf$pos" \ --preview-window=60%,border-left \ - --bind="double-click:execute(xdg-open 'https://archlinux.org/packages/{$pos}'),alt-enter:execute(xdg-open 'https://aur.archlinux.org/packages?K={$pos}&SB=p&SO=d&PP=100')" \ + --bind="alt-bspace:clear-query,double-click:execute(xdg-open 'https://archlinux.org/packages/{$pos}'),alt-enter:execute(xdg-open 'https://aur.archlinux.org/packages?K={$pos}&SB=p&SO=d&PP=100')" \ "$@" | cut -f$pos | xargs } diff --git a/.config/shell/music b/.config/shell/music index 7158f2f..730e6eb 100644 --- a/.config/shell/music +++ b/.config/shell/music @@ -66,7 +66,7 @@ addalbum() { formatsongs() { ( - find -maxdepth 1 -type d | formatin + find -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | formatin find "$@" "$PWD" -type d | while read d; do builtin cd "$d" && findsongs | formatin done @@ -83,13 +83,17 @@ formatsongs() { formatin() { while read song; do new="$(formatsong "$song")" - test "$new" && test "$new" != "$song" && mv -iv "$song" "$new" + if test "$new" && test "$new" != "$song" + then mkdir -p "$(dirname "$new")" && mv -iv "$song" "$new" + fi done } # Normalize the given filename formatsong() { - echo "$1" | sed -e 's/\b\(ft\|Ft\|Feat\|featuring\)\([ .]\)/feat\2/; + echo "$1" | sed -e '# First Entry for Qobuz folders + /^[A-z0-9_-]\+$/{s|_| |g;s|-|/|g}; + s/\b\(ft\|Ft\|Feat\|featuring\)\([ .]\)/feat\2/; s/\bfeat /feat. /; s/)(/) (/g; s/ [[(]\(Free Download\|Original Mix\|Original\|Full Stream\|NCS Release\)[])]//i; diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index 7a8ef67..96a3d3e 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -42,7 +42,8 @@ fileinfo() { # TODO do not grep bitrate but extract properly #probe="$($elevate ffprobe "$arg" 2>&1)" #echo $probe | grep -v -e '00:00:00.04' -e 'ansi' && - $elevate ffprobe -hide_banner "$arg" 2>&1 | grep "bitrate: ....\? " | sed 's/, start:[^,]\+,/,/' || + $inspect || + $elevate ffprobe -hide_banner "$arg" 2>&1 | grep "bitrate: ....\? " | sed 's/, start:[^,]\+,/,/' || $elevate stat --format "%U:%G %A %s $( size="$($elevate unzip -l "$arg" 2>/dev/null | tail -1)" && echo "(uncompressed $(echo $size | cut -d' ' -f1 | numfmt --to=iec-i --suffix=B))" @@ -91,7 +92,7 @@ for arg; do timg+=("$tmpfile");; (*\ video/*) suffix=_thumbs.jpg - mtn -q -i -t -W -r2 -D6 -b 0,6 -c $grid -w $(expr $(tput cols) '*' 20) \ + mtn -q -i -t -W -r$(expr 5 - $# \& $# \< 4 \| 1) -D6 -b 0.6 -c $grid -w $(expr $(tput cols) '*' 20) \ -O "$prefix" -o "$suffix" "$arg" && timg -W "$prefix/$(basename "${arg%.*}")$suffix" ;; diff --git a/.local/bin/scripts/netkeeper b/.local/bin/scripts/netkeeper index 73df7d4..617055c 100755 --- a/.local/bin/scripts/netkeeper +++ b/.local/bin/scripts/netkeeper @@ -6,6 +6,7 @@ if test -e "$JOURNAL"; then do read intention done jrnl intentions "$intention" + apprise $(pass service/apprise/intentions) -t 'janeks intention' -b "$intention" sudo nft flush chain inet filter outall sudo nft add rule inet filter outall meta hour "$(date +%H:%M)"-"$(date +%H:%M --date="${1:-10}min")" accept #expr \( "$1" \> 40 \) \* 10 \| "$1" diff --git a/.local/bin/scripts/save-power b/.local/bin/scripts/save-power index 11ecb93..ade04f6 100755 --- a/.local/bin/scripts/save-power +++ b/.local/bin/scripts/save-power @@ -1,7 +1,7 @@ #!/bin/sh -# TODO set brightness +# TODO set brightness? light -S pkill electron -pkill discord +pkill --ignore-case discord pkill signal pkill aw-server pkill aw-qt diff --git a/.local/bin/scripts/synctray b/.local/bin/scripts/synctray index 94d4dee..2b7bb0e 100755 --- a/.local/bin/scripts/synctray +++ b/.local/bin/scripts/synctray @@ -1,5 +1,6 @@ -#!/bin/sh -ex +#!/bin/sh -e # Install syncthingtray with dependencies +pacman -Qq | grep '^syncthingtray' | xargs -r yay --noconfirm -R suffix=$1 -yay --noconfirm -Syyu --nobatchinstall c++utilities$suffix qtforkawesome$suffix qtutilities$suffix +yay --noconfirm -Syy --nobatchinstall boost c++utilities$suffix qtforkawesome$suffix qtutilities$suffix yay --noconfirm -S syncthingtray$suffix