Compare commits

..

No commits in common. "87a38aaccdee641039264a1a5af6c680062564b3" and "6b2cc865a6ba968fd853754b2d74e5f364e61b62" have entirely different histories.

10 changed files with 10 additions and 25 deletions

View file

@ -1,7 +1,5 @@
map ctrl+c copy_or_interrupt map ctrl+c copy_or_interrupt
scrollback_lines 20000
window_alert_on_bell yes window_alert_on_bell yes
include pager.conf include pager.conf

View file

@ -52,7 +52,6 @@ let g:firenvim_config = {
\ '.*discord\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*discord\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*twitter\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', }, \ '.*wiki.*\.org.*': { 'priority': 9, 'takeover': 'never', },
\ '://pve.*': { 'priority': 9, 'takeover': 'never', },
\ \
\ '.*calendar\.google\.com.*': { 'priority': 9, 'takeover': 'empty', }, \ '.*calendar\.google\.com.*': { 'priority': 9, 'takeover': 'empty', },
\ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', },

View file

@ -31,14 +31,14 @@ yzf() {
# List installable packages into fzf and install selection # List installable packages into fzf and install selection
yas() { yas() {
cache_dir="/tmp/yas-$USER" cache_dir="/tmp/yas-$USER"
case "$1" in (-y*) rm -rf "$cache_dir"; shift; param=$1;; esac test "$1" = "-y" && rm -rf "$cache_dir" && shift
mkdir -p "$cache_dir" mkdir -p "$cache_dir"
preview_cache="$cache_dir/preview_{2}" preview_cache="$cache_dir/preview_{2}"
list_cache="$cache_dir/list$*" list_cache="$cache_dir/list$*"
{ test "$(cat "$list_cache" | wc -l)" -lt 50000 && rm "$list_cache"; } 2>/dev/null { test "$(cat "$list_cache" | wc -l)" -lt 50000 && rm "$list_cache"; } 2>/dev/null
pkg=$( pkg=$(
( cat "$list_cache" 2>/dev/null || ( cat "$list_cache" 2>/dev/null ||
{ $(test $param && echo sudo) pacman --color=always -Sl $param "$@"; yay --color=always -Sl aur $param "$@" } | { pacman --color=always -Sl "$@"; yay --color=always -Sl aur "$@" } |
sed 's/ [^ ]*unknown-version[^ ]*//' | tee "$list_cache" ) | sed 's/ [^ ]*unknown-version[^ ]*//' | tee "$list_cache" ) |
yzf 2 --tiebreak=chunk,index --preview="cat $preview_cache 2>/dev/null | grep -v 'Querying' | grep . || yay --color always -Si {2} | tee $preview_cache" yzf 2 --tiebreak=chunk,index --preview="cat $preview_cache 2>/dev/null | grep -v 'Querying' | grep . || yay --color always -Si {2} | tee $preview_cache"
) )

View file

@ -80,7 +80,6 @@ alias c=z
# Listing for quick directory switcher based on zoxide and fzf # Listing for quick directory switcher based on zoxide and fzf
alias zoxide-list='noglob zoxide query -sl' alias zoxide-list='noglob zoxide query -sl'
__zx_ls="ls --almost-all --color --human-readable --group-directories-first --file-type" __zx_ls="ls --almost-all --color --human-readable --group-directories-first --file-type"
# Check fzf features first
alias fzf-dir="fzf -0 -1 --tiebreak=chunk,end,length \ alias fzf-dir="fzf -0 -1 --tiebreak=chunk,end,length \
--preview-window=30% --preview='$__zx_ls {}' \ --preview-window=30% --preview='$__zx_ls {}' \
--height=80% --reverse --keep-right" --height=80% --reverse --keep-right"

View file

@ -373,6 +373,7 @@ hex() { hexyl "$@" | "${PAGER:-less}"; }
export DICT="$XDG_DATA_HOME/dictcc" export DICT="$XDG_DATA_HOME/dictcc"
dic() { dic() {
# TODO tiebreak=chunk
result=$(cat $DICT/dict.txt | sed '/#/d;/&/d;/^$/d' | fzf --tiebreak=chunk,length --bind='alt-bspace:clear-query' --print-query --query="$1") && result=$(cat $DICT/dict.txt | sed '/#/d;/&/d;/^$/d' | fzf --tiebreak=chunk,length --bind='alt-bspace:clear-query' --print-query --query="$1") &&
dic "$(echo "$result" | tail -1 | sed 's/\t/\n/g' | grep --invert-match --ignore-case "$(echo "$result" | head -1)" | head -1 | sed 's/ \W.*//')" dic "$(echo "$result" | tail -1 | sed 's/\t/\n/g' | grep --invert-match --ignore-case "$(echo "$result" | head -1)" | head -1 | sed 's/ \W.*//')"
} }

View file

@ -65,18 +65,16 @@ for arg; do
fi fi
# amount of columns in a grid # amount of columns in a grid
grid=$(expr $(tput cols) / \( 25 - \( $# / 2 \) \& $# \< 30 \| 5 \)) grid=$(expr $(tput cols) / \( 25 - \( $# / 2 \) \& $# \< 30 \| 5 \))
tmpfile="$prefix/$(basename "$arg")_$(dd "if=$arg" bs=512 count=10 2>/dev/null | md5sum | tr -d ' ')" tmpfile="$prefix/$(basename "$arg")"
mkdir -p "$prefix" mkdir -p "$prefix"
case "$mime" in case "$mime" in
(*\ application/pdf\;*) (*\ application/pdf\;*)
echo Converting "$arg"
grid=$(expr $(tput cols) \* $# / $(tput lines)) grid=$(expr $(tput cols) \* $# / $(tput lines))
grid=$(expr 3 \& $grid \< 3 \| $grid) grid=$(expr 3 \& $grid \< 3 \| $grid)
#limit=$(expr $grid \& \( $grid \> 3 \| $# \> 1 \) \| $grid '*' 2) #limit=$(expr $grid \& \( $grid \> 3 \| $# \> 1 \) \| $grid '*' 2)
limit=$grid limit=$grid
if ! test -f "$tmpfile-1.ppm" test -f "$tmpfile-1.ppm" || pdftoppm -forcenum -r 70 "$arg" "$tmpfile" -l $limit
then echo Converting "$arg"
pdftoppm -forcenum -r 70 "$arg" "$tmpfile" -l $limit
fi
find "$prefix" -path "$tmpfile*.ppm" | sort | head -$limit | xargs -d'\n' timg -W --grid=$grid find "$prefix" -path "$tmpfile*.ppm" | sort | head -$limit | xargs -d'\n' timg -W --grid=$grid
;; ;;
(*\ application/*document*|*.xlsx:\ *) (*\ application/*document*|*.xlsx:\ *)
@ -154,7 +152,7 @@ if test "$timg"; then
if which timg >/dev/null if which timg >/dev/null
then $elevate timg $(test "$timga" && echo "-V") --rotate=exif -g $(tput cols)x$(expr $(tput lines) / 2) \ then $elevate timg $(test "$timga" && echo "-V") --rotate=exif -g $(tput cols)x$(expr $(tput lines) / 2) \
$(test $# -gt 1 && $(test $# -gt 1 &&
echo "-t0.2 --auto-crop --center $(test $# -lt 20 && echo "--title") --grid=$((grid < $# ? grid : $#))x2") \ echo "-t0.2 --center $(test $# -lt 20 && echo "--title") --grid=$((grid < $# ? grid : $#))x2") \
"${timg[@]}" "${timga[@]}" 2>/dev/null || true "${timg[@]}" "${timga[@]}" 2>/dev/null || true
else for img in "${timg[@]}" else for img in "${timg[@]}"
do catimg -H $(expr $(tput lines) / 2) $img do catimg -H $(expr $(tput lines) / 2) $img

View file

@ -21,13 +21,10 @@ done
find "$dir" -maxdepth 2 -not -name ".stfolder" -empty -printf "Removing empty %p\n" -delete find "$dir" -maxdepth 2 -not -name ".stfolder" -empty -printf "Removing empty %p\n" -delete
find -L -maxdepth 2 -type l -printf "Removing broken symlink %p\n" -delete 2>/dev/null find -L -maxdepth 2 -type l -printf "Removing broken symlink %p\n" -delete 2>/dev/null
test -d /mnt/data/backups/mobile/ &&
mv -v $DATA/4*/backups/mobile/signal-* /mnt/data/backups/mobile/ 2>/dev/null
highlight "y :: recursively remove empty folders and files" highlight "y :: recursively remove empty folders and files"
if [[ $1 =~ "y" ]]; then if [[ $1 =~ "y" ]]; then
find -name '.thumbnails' -printf "Pre-cleaning %p\n" -exec rm -r {} + find -name '.thumbnails' -printf "Pre-cleaning %p\n" -exec rm -r {} +
find \( -name ".stfolder" -o -name ".*keep" -o -name ".git" -o -name "tmp" -o -name ".nomedia" -o -name "__init__.py" -o -name "instalee" \) -prune -o -empty -printf "Removing empty %p\n" -exec rm -d {} + find \( -name ".stfolder" -o -name ".*keep" -o -name ".git" -o -name "tmp" -o -name ".nomedia" \) -prune -o -empty -printf "Removing empty %p\n" -exec rm -d {} +
fi fi
highlight "e :: remove downloaded emacs packages (rebuild takes minutes!)" highlight "e :: remove downloaded emacs packages (rebuild takes minutes!)"

View file

@ -33,7 +33,7 @@ case "$command" in
git aur commit -a "$@" git aur commit -a "$@"
git push;; git push;;
(clean) (clean)
find "$aurdir" -mindepth 2 -maxdepth 2 \( -iname "*.pkg.tar.*" -o -iname "*.zip" -o -name "*.tar.gz" -o -type d -not -name ".*" \) \ find "$aurdir" -mindepth 2 -maxdepth 2 \( -iname "*.pkg.tar.*" -o -iname "*.zip" -o -type d -not -name ".*" \) \
-print -exec sudo rm -rI {} +;; -print -exec sudo rm -rI {} +;;
(*) echo "Unknown command! Available: $commands"; exit 3;; (*) echo "Unknown command! Available: $commands"; exit 3;;
esac esac

View file

@ -19,7 +19,7 @@ cmd="$1"
case "$cmd" in case "$cmd" in
# TODO extract help in standard format from scripts # TODO extract help in standard format from scripts
(hunt|rdoc|gh|chordpro|bat|pdfjam|reflector|topgrade|r128gain|7z|kubectl|diffr|docker|jrnl|difft|wiked-diff) unbuffer "$@" --help | $paginate;; (hunt|rdoc|gh|chordpro|bat|pdfjam|reflector|topgrade|r128gain|7z|kubectl|diffr|docker|jrnl|difft|wiked-diff) unbuffer "$@" --help | $paginate;;
(caddy|stretchly|go|fossil|flutter) test "$cmd" = "fossil" -a $# -eq 1 && repo="$(locate -b -l 1 "fossil*.fossil")" && fossil ui "$repo" && exit (caddy|stretchly|go|fossil) test "$cmd" = "fossil" -a $# -eq 1 && repo="$(locate -b -l 1 "fossil*.fossil")" && fossil ui "$repo" && exit
# TODO view fossil ui in terminal # TODO view fossil ui in terminal
shift shift
"$cmd" help "$@" | $paginate;; "$cmd" help "$@" | $paginate;;

View file

@ -1,7 +0,0 @@
#!/bin/sh -e
# LaTeX fixed
dir=/tmp/latexmk
filename="$(basename "${1%.tex}.pdf")"
TEXMF="" pdflatex -shell-escape -recorder -output-directory="$dir" "$@"
mv -v "$dir/$filename" .
b "$filename"