bin: script fixes

This commit is contained in:
xeruf 2023-06-16 10:47:24 +02:00
parent bc37867fc3
commit a866858d47
6 changed files with 19 additions and 10 deletions

View File

@ -1,8 +1,8 @@
{
"microbreakDuration": 30000,
"microbreakInterval": 900000,
"microbreakInterval": 1200000,
"breakDuration": 180000,
"breakInterval": 2,
"breakInterval": 3,
"breakNotification": false,
"microbreakNotification": false,
"breakNotificationInterval": 30000,
@ -10,7 +10,7 @@
"microbreak": true,
"break": true,
"microbreakStrictMode": true,
"breakStrictMode": true,
"breakStrictMode": false,
"morningHour": 6,
"microbreakPostpone": false,
"breakPostpone": true,
@ -21,9 +21,11 @@
"breakPostponesLimit": 3,
"breakPostponableDurationPercent": 20,
"mainColor": "#633738",
"miniBreakColor": "#478484",
"transparentMode": false,
"opacity": 0.8,
"audio": "crystal-glass",
"miniBreakAudio": "crystal-glass",
"volume": 0.4,
"fullscreen": true,
"ideas": true,
@ -461,11 +463,12 @@
"screen": "primary",
"timeToBreakInTray": false,
"currentTimeInBreaks": false,
"showTrayIcon": true,
"pauseBreaksShortcut": "",
"resumeBreaksShortcut": "",
"__internal__": {
"migrations": {
"version": "1.13.1"
"version": "1.14.1"
}
}
}
}

View File

@ -54,6 +54,7 @@ cd() {
code=$? && test $code -eq 141 || return $code
fi
}
alias cdr='cd $(git root)'
# LOCATE {{{1
# TODO no double heading with bat
@ -74,7 +75,7 @@ alias loca='noglob sudo updatedb -l 0 --prunenames "" --prunefs "tmpfs sysfs deb
sudo chmod +r /var/cache/locate-all.db &&
loci --database /var/cache/locate-all.db'
hunta() {
unbuffer hunt -h "$@" / | less -RF +G
unbuffer hunt -H "$@" / | less -RF +G
}
# ZOXIDE {{{1

View File

@ -1,4 +1,8 @@
assign [app_id="firefox"] workspace 2
assign [class="sc.gui.final.FinalApp"] workspace 5
assign [title="JViewer.*"] workspace 5
assign [class="discord"] workspace 9
exec swaymsg "workspace 2; exec firefox;"
exec swaymsg "workspace 3; exec kitty;"
exec swaymsg "workspace 1; exec emacs"

View File

@ -6,7 +6,7 @@
case "$1" in
(http*)
if expr "$1" : ".*:" >/dev/null
then echo "$1" | sed "s|.*//\([^/]*\)/\(.*\)|git@\1:\2.git|"
then echo "${1%/}" | sed "s|.*//\([^/]*\)/\(.*\)|git@\1:\2.git|"
exit
else http=$1 && shift
fi;;

View File

@ -11,7 +11,7 @@ case "$1" in
tldr
info
man
quickref; test-colors; arg-test / arg-notify"
quickref; test-colors; arg-test / arg-notify"; exit 2;;
esac
showinfo() {
@ -26,7 +26,7 @@ showinfo() {
cmd="$1"
case "$cmd" in
# 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|qpdf) 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
# TODO view fossil ui in terminal
shift

View File

@ -1,4 +1,4 @@
#!/bin/sh -ex
#!/bin/sh -e
test "$1" = "-q" && quiet=$1 && shift
case "$1" in ([0-9]) page=$1; shift;; esac
test ! -r "$1" && echo "Usage: sign [page] <document.pdf> [hoffset (-160) [voffset (-310) [scale [signature-image]]]]" && exit 1
@ -20,6 +20,7 @@ if test $# -lt 2; then
(*\ TU.pdf) v=-260;;
esac
fi
echo "Using offset ${h}x and ${v}y"
export TEXMF=""
pdfjam $quiet "$signature" --outfile "$sig" --papersize "{595pt, 842pt}" --noautoscale true \
--offset "${h}pt ${v}pt" --scale "${4:-1}"