j=$new_j
}
-# tag with beets.
-# usage: beetag [-r] [-s] QUERY
-# it lists the query, reads an input char for tagging one by one.
-#
-# note, you may want to change the play command for doing rapid taging
-# by immediately jumping forward into the song. this is set in the beets
-# config yaml.
-#
-# (available buttons: ` ) ] [ and non-printing chars, see
-# https://stackoverflow.com/questions/10679188/casing-arrow-keys-in-bash
-#
-#
-# note: after foregrounding the player, must quit it to get back. can't ctrl-c.
-#
-# keys I dont need help to remember:
-# 1-5 rate
-# q quit
-# ret next
-#
-# todo: enter should also unpause
+
+beetag-usage() {
+ cat <<'EOF'
+tag with beets.
+usage: beetag [OPTIONS] QUERY
+
+-r Randomize.
+-s Do not randomize.
+-x Randomize & do not reuse previous seed.
+-h|--help Print help and exit.
+
+It lists/plays the query, reads an input char for tagging one by one.
+
+note, you may want to change the play command for doing rapid taging
+by immediately jumping forward into the song. this is set in the beets
+config yaml.
+
+(available buttons: ` ) ] [ and non-printing chars, see
+https://stackoverflow.com/questions/10679188/casing-arrow-keys-in-bash
+
+
+note: after foregrounding the player, must quit it to get back. can't ctrl-c.
+
+keys I dont need help to remember:
+1-5 rate
+q quit
+ret next
+
+todo: enter should also unpause
+
+
+Note: Uses GNU getopt options parsing style
+EOF
+ return 0
+}
+
beetag() {
source /a/bin/ds/beet-data
local -i scrolled=999 # more than any $LINES
local -i i ret line_int skip_start skip_lookback overflow_lines overflow
- ### begin arg processing ###
+
+ ##### begin command line parsing ########
+
random=false
new_random=false
- case $1 in
- -r)
- random=true
- shift
- ;;
- -s)
- random=false
- shift
- ;;
- -x)
- new_random=true
- shift
- ;;
- esac
+ if ! temp=$(getopt -l help hrsx "$@"); then
+ e "BAD OPTION! expected is: getopt -l help hrsx"
+ return 1
+ fi
+ eval set -- "$temp"
+ while true; do
+ case $1 in
+ -r)
+ random=true
+ ;;
+ -s)
+ random=false
+ ;;
+ -x)
+ random=true
+ new_random=true
+ ;;
+ -h|--help) beetag-usage; return 0 ;;
+ --) shift; break ;;
+ *) echo "$0: Internal error! unexpected args: $*" ; return 1 ;;
+ esac
+ shift
+ done
+ arg1="$1"
+ arg2="$2"
+ if (( $# != 2 )); then
+ echo "$0: error: expected 2 options, got $#." >&2
+ exit 1
+ fi
+
if (( ! $# )); then
echo beetag: error expected a query arg >&2
return 1
fi
beet_query=("$@")
- ### end arg processing ###
+ ##### end command line parsing ########
escape_char=$(printf "\u1b")
readonly escape_char
# ls count. usage: pass a directory, get the number of files.
# https://unix.stackexchange.com/questions/90106/whats-the-most-resource-efficient-way-to-count-how-many-files-are-in-a-director
-lsc() {
+lswc() {
# shellcheck disable=SC2790 disable=SC2012 # intentional
ls -Uq "$@"|wc -l
}
+# count files recursively
+fndwc() {
+ find "$@" -type f -printf a | wc -c
+}
# run then notify. close notification after the next prompt.
rn() {
return 1
fi
# all but last arg as options
- eval beetag -r "${*:1:$# - 1}" "${bpla[$playlist]}"
+ e eval beetag -r "${*:1:$# - 1}" "${bpla[$playlist]}"
}
complete -W "${!bpla[*]}" bpl
mpva() {
mpv --profile=a "$@";
}
+mpvk() {
+ mpv --profile=k "$@";
+}
mpvl() {
mpv --profile=l "$@";
}
;;
esac
-case $HOSTNAME in
- $d_host)
- sgo btrbkrust.timer
- ;;
- *)
- soff btrbkrust.timer
- s rm -f /etc/systemd/system/btrbkrust*
- ;;
-esac
# template
# if the value is too aggressive, could cause problems.
case $codename_compat in
noble)
- usermod -aG pipewire iank
+ sudo usermod -aG pipewire iank
;;
esac
# x200 on t12, this unit fails on boot. no idea why, but it seems harmless
-systemctl mask wacom-inputattach@ttyS4.service
+sudo systemctl mask wacom-inputattach@ttyS4.service
# see current with:
;;
esac
+
case $HOSTNAME in
- frodo)
- systemctl enable btrbkrust.timer
- systemctl enable btrbkr.timer
+ $d_host)
+ sgo btrbkr{backup,2,3}.timer
+ ;;
+ *)
+ soff btrbkr{backup,2,3}.timer
+ s rm -f /etc/systemd/system/btrbkr*
;;
esac
# note, we can verify this works as expected by adding
# print join(", ", @{$nrconf{blacklist}}), "\n";
# and running it with perl. @{} dereferences the array reference.
-push(@{$nrconf{blacklist}}, qr(^/usr/local/bin/emacs$));
+#
+# Emacs is a symlink to a file like emacs-31.0.50.
+push(@{$nrconf{blacklist}}, qr(^/usr/local/bin/emacs[0-9.-]*$));
push(@{$nrconf{blacklist}}, qr(^/usr/local/bin/emacsclient$));
--- /dev/null
+transaction_syslog local7
+
+lockfile /var/lock/btrbk-r2.lock
+
+timestamp_format long-iso
+
+snapshot_create onchange
+
+snapshot_preserve 18h 14d 8w 12m
+snapshot_preserve_min 2d
+snapshot_dir btrbk
+
+target_preserve 18h 14d 8w 12m
+target_preserve_min 2d
+
+rate_limit no
+volume /mnt/r2
+subvolume p
+subvolume fsf-mailrec
+# moved
+#subvolume ar
+#subvolume roverflow
transaction_syslog local7
-lockfile /var/lock/btrbk-rust.lock
+lockfile /var/lock/btrbk-r3.lock
timestamp_format long-iso
target_preserve_min 2d
rate_limit no
-volume /mnt/rbackup
+volume /mnt/r3
+subvolume d-r3
+subvolume siterip
subvolume ar
-subvolume d
subvolume roverflow
--- /dev/null
+transaction_syslog local7
+
+lockfile /var/lock/btrbk-rbackup.lock
+
+timestamp_format long-iso
+
+snapshot_create onchange
+
+snapshot_preserve 18h 14d 8w 12m
+snapshot_preserve_min 2d
+snapshot_dir btrbk
+
+target_preserve 18h 14d 8w 12m
+target_preserve_min 2d
+
+rate_limit no
+volume /mnt/rbackup
+subvolume d
+# moved
+#subvolume ar
+#subvolume roverflow
--- /dev/null
+[Unit]
+Description=Btrbk to r2
+After=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/sysd-mail-once btrbkr2 btrbk -c /etc/btrbk/r2.conf run
[Unit]
-Description=Btrbk rust timer
+Description=Btrbk r2 timer
[Timer]
OnCalendar=*-*-* 07:00:00 America/New_York
--- /dev/null
+[Unit]
+Description=Btrbk to r3
+After=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/sysd-mail-once btrbkr3 btrbk -c /etc/btrbk/r3.conf run
--- /dev/null
+[Unit]
+Description=Btrbk r3 timer
+
+[Timer]
+OnCalendar=*-*-* 07:00:00 America/New_York
+
+[Install]
+WantedBy=timers.target
--- /dev/null
+[Unit]
+Description=Btrbk to rbackup
+After=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/sysd-mail-once btrbkrbackup btrbk -c /etc/btrbk/rbackup.conf run
--- /dev/null
+[Unit]
+Description=Btrbk rbackup timer
+
+[Timer]
+OnCalendar=*-*-* 07:00:00 America/New_York
+
+[Install]
+WantedBy=timers.target
+++ /dev/null
-[Unit]
-Description=Btrbk to rust
-After=multi-user.target
-
-[Service]
-Type=oneshot
-ExecStart=/usr/local/bin/sysd-mail-once btrbkrust btrbk -c /etc/btrbk/rust.conf run
done
}
sgo() {
- local service=$1
- systemctl restart $service
- systemctl enable $service
+ local service
+ for service; do
+ systemctl restart $service
+ systemctl enable $service
+ done
}
mailhost() {
[[ $HOSTNAME == "$MAIL_HOST" ]]
StartLimitIntervalSec=0
[Service]
+ExecStartPre=/usr/local/bin/joins-namespace-of-check mailnn
PrivateNetwork=true
# note the nsswitch bind is actually not needed for bk, but
# its the same file so it does no harm.
debconf-doc
devscripts
dillo
- digikam
+ # using self-compiled version
+ #digikam
# used by digikam for icons
breeze-icon-theme
dirmngr
# the /etc one.
hwdec=vdpau
+# like [l] but shuffled
+[k]
+loop-file=inf
+save-position-on-quit
+resume-playback
+shuffle
+
# loop. saves playlist position. good for looking at gifs
[l]
loop-file=inf
#no-resume-playback
#no-save-position-on-quit
-[m]
-loop-file=inf
-save-position-on-quit
-shuffle
# use --profile d