From: Ian Kelling Date: Thu, 9 Oct 2025 01:23:33 +0000 (-0400) Subject: misc improvements and fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=0a8d459f26afeb320e7cb194eb45d25438f6e775;p=distro-setup misc improvements and fixes --- diff --git a/.dataprinter b/.dataprinter index 09d23f5..bec4a8b 100644 --- a/.dataprinter +++ b/.dataprinter @@ -1,5 +1,6 @@ -multiline = 0 +#multiline = 0 + # i like it, but it randomly got mostly stuck on bright blue. theme = Solarized #colored = 0 diff --git a/brc b/brc index af9266e..2fe2880 100644 --- a/brc +++ b/brc @@ -1354,14 +1354,11 @@ dfp() { # get ipv4 ip from HOST. or if it is already a number, return that hostip() { local host="$1" - case $host in - [0-9:]) - echo "$host" - ;; - *) - getent ahostsv4 "$host" | awk '{ print $1 }' | head -n1 - ;; - esac + if [[ $host == *[0-9:]* ]]; then + echo "$host" + else + getent ahostsv4 "$host" | awk '{ print $1 }' | head -n1 + fi } # dig nicer defaults @@ -1937,20 +1934,25 @@ gr() { grep -iIP --color=auto "$@" || return $? } # grep recursive +# +# Doesn't return 1 on nonmatch because this is meant to be +# interactive, not in a conditional. grr() { - # Don't return 1 on nonmatch because this is meant to be - # interactive, not in a conditional. - if [[ ${#@} == 1 ]]; then - grep --exclude-dir='*.emacs.d' --exclude-dir='*.git' -rniIP --color=auto "$@" . || [[ $? == 1 ]] - else - grep --exclude-dir='*.emacs.d' --exclude-dir='*.git' -rniIP --color=auto "$@" || [[ $? == 1 ]] - fi + local dir_arg + if [[ ${#@} == 1 ]]; then dir_arg=.; fi + grep --exclude-dir='*.emacs.d' --exclude-dir='*.git' -rniIP --color=auto "$@" $dir_arg || [[ $? == 1 ]] } ccomp grep gr grr # recursive grep rg() { grr "$@"; } -ccomp grep rg +# copy of grr, add pager +rgp() { + local dir_arg + if [[ ${#@} == 1 ]]; then dir_arg=.; fi + grep --exclude-dir='*.emacs.d' --exclude-dir='*.git' -rniIP --color=always "$@" $dir_arg | less || [[ $? == 1 ]] +} +ccomp grep rg rgp # recursive grep and find (e for everything). search for files/dirs and # lines. @@ -2031,14 +2033,11 @@ go-github-install() { echo targetf: $targetf github-release-dl "$@" files=(./*) - case $file_suffix in - *.bz2) - m bunzip2 -- ./* - ;; - *.tar.gz|*.tgz) - m tar -vxzf ./* - ;; - esac + if [[ $file_suffix == *.bz2 ]]; then + m bunzip2 -- ./* + elif [[ $file_suffix == *.tar.gz || $file_suffix == *.tgz ]]; then + m tar -vxzf ./* + fi m rm -f -- "${files[@]}" files=(./*) # Here we detect and handle 2 cases: either we extracted a single @@ -2258,7 +2257,7 @@ low() { new="${new#"${new%%[[:alnum:]]*}"}" # remove leading/trailing non-alnum new="${new%"${new##*[[:alnum:]]}"}" # remove bad underscores, like __ and _._ - new=$(echo $new | sed -r 's/__+/_/g;s/_+([.-])|([.-])_+/\1/g') + new=$(echo $new | sed -r 's/__+/_/g;s/_*([.-])_*/\1/g') safe_rename "$dir/$f" "$dir/$new" || return 1 done return 0 @@ -4567,7 +4566,13 @@ join-arr() { j="${arr[0]}" for elt in "${arr[@]:1}"; do j+="$sep$elt" - done + done +} + +# jl = join lines. run, then paste lines, press ctrl-c when done, then +# all the lines will be joined and stored in $x. +jl() { + x=$(cat) } # * stuff that makes sense to be at the end diff --git a/brc2 b/brc2 index 64fd0da..6d28b90 100644 --- a/brc2 +++ b/brc2 @@ -2851,6 +2851,10 @@ mpvgpu() { mpvd() { mpv --profile=d "$@"; } +# mpv profile e. good for videos +mpe () { + mpv --profile=e "$@"; + } mpva() { mpv --profile=a "$@"; } @@ -3194,7 +3198,7 @@ jc() { xc() { xclip -r -selection clipboard "$@" } -# echo copy +# echo copy. e text to copy | ec ec() { pee "xclip -r -selection clipboard" cat } @@ -4338,12 +4342,11 @@ if type -P rg &>/dev/null; then # -. = search dotfiles # -n --no-heading: show files and line numbers together allowing for clicking rg() { - local path_arg - if [[ ${#@} == 1 ]]; then - path_arg=. - fi - - command rg -. -z --no-messages -Lin --no-heading -M 900 --no-ignore-parent --no-ignore-vcs -g '!.git' -g '!auto-save-list' -g '!.savehist' "$@" $path_arg || return $? + command rg -. -z --no-messages -Lin --no-heading -M 900 --no-ignore-parent --no-ignore-vcs -g '!.git' -g '!auto-save-list' -g '!.savehist' "$@" || return $? + } + # rgp = rg + pager + rgp() { + rg --color=always "$@" | less } #fails if not exist. ignore complete -r rg 2>/dev/null ||: diff --git a/ffs b/ffs index e23f8ba..1c5cd70 100755 --- a/ffs +++ b/ffs @@ -56,7 +56,7 @@ arg is icecast mountpoint suffix, except staff removes suffix. quarter: self evident -u Undelayed. Removes 5 second video delay, and about 4 second audio delay. -w do not launch watch of stream --8 Use vp9 instead of default vp9. +-8 Use vp8 instead of default vp9. note: args duplicated in ffp @@ -205,7 +205,7 @@ if ! $local; then sleep 4 fi - pass=$(sed -n 's/ *\([^<]*\).*/\1/p' /p/c/icecast.xml) + pass=$(sed -n 's/ *\([^<]*\).*/\1/p' /p/c/user-specific/icecast2/icecast.xml) fi xrandr=$(xrandr) diff --git a/filesystem/usr/local/bin/switch-mail-host b/filesystem/usr/local/bin/switch-mail-host index be1f9dd..fb3212d 100755 --- a/filesystem/usr/local/bin/switch-mail-host +++ b/filesystem/usr/local/bin/switch-mail-host @@ -85,7 +85,7 @@ host2_only=false force=false force_arg= pull_reexec=false -mp_args="-m /o,/a,/q,/qr" +mp_args="-m /o,/a,/q" check_installed=false orig_args=("$@") if ! temp=$(getopt -l check-installed,force,pull-reexec,help 2afioh "$@"); then @@ -144,7 +144,7 @@ fi if $mail_only; then mp_args="-m /o" elif $host2_only; then - mp_args="-m /a,/q,/qr" + mp_args="-m /a,/q" fi diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr4.service b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr4.service index 54890b4..e2bf800 100644 --- a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr4.service +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr4.service @@ -1,7 +1,7 @@ [Unit] -Description=Btrbk to r3 +Description=Btrbk to r4 After=multi-user.target [Service] Type=oneshot -ExecStart=/usr/local/bin/sysd-mail-once btrbkr3 btrbk -c /etc/btrbk/r3.conf run +ExecStart=/usr/local/bin/sysd-mail-once btrbkr4 btrbk -c /etc/btrbk/r4.conf run diff --git a/machine_specific/frodo/subdir_files/.config/pipewire/pipewire.conf b/machine_specific/frodo/subdir_files/.config/pipewire/pipewire.conf deleted file mode 100644 index 2ef7e85..0000000 --- a/machine_specific/frodo/subdir_files/.config/pipewire/pipewire.conf +++ /dev/null @@ -1,34 +0,0 @@ -# Daemon config file for PipeWire version "1.0.5" # -# -# Copy and edit this file in /etc/pipewire for system-wide changes -# or in ~/.config/pipewire for local changes. -# -# It is also possible to place a file with an updated section in -# /etc/pipewire/pipewire.conf.d/ for system-wide changes or in -# ~/.config/pipewire/pipewire.conf.d/ for local changes. -# - -context.properties = { - - # iank: adding this made us output at the same sample rate as the audio we were playing, which seems like a good thing. from arch wiki: "PipeWire can also change dynamically the output sample rates supported by your DAC", find them with: - # grep -E 'Codec|Audio Output|rates' /proc/asound/card*/codec#* - # get currently used rate: - # grep rate: /proc/asound/card?/pcm??/sub?/hw_params - # or pw-top - # - # - default.clock.allowed-rates = [ 44100 48000 88200 96000 192000 ] - - #default.clock.allowed-rates = [ 48000 ] - #default.clock.quantum = 1024 - # iank. ran out of time to test this to prevent io stuttering - #default.clock.min-quantum = 1024 -} - -# found a rancom config suggestion of a file which is just: -# context.properties = { -# default.clock.rate = 48000 -# default.clock.quantum = 1024 -# default.clock.min-quantum = 32 -# default.clock.max-quantum = 2048 -# } diff --git a/myx b/myx index 7c17ef1..9f03a12 100755 --- a/myx +++ b/myx @@ -224,7 +224,13 @@ done if [[ ! $secondary_out ]] || grep -A1 disconnected $xf | grep '^[[:space:]]'; then # gets rid of leftover secondary + if [[ $HOSTNAME != frodo ]]; then m xmod --auto + + # new monitor on frodo, I've been having to run this to get the full refresh rate: + # xrandr --output DP-0 --mode 3840x2160 --rate 120 + # testing if this xmod is getting in the way. + fi fi if [[ $secondary_out ]] && $restart; then diff --git a/subdir_files/.gnupg/gpg.conf b/subdir_files/.gnupg/gpg.conf index 60801d0..729d9e9 100644 --- a/subdir_files/.gnupg/gpg.conf +++ b/subdir_files/.gnupg/gpg.conf @@ -39,10 +39,10 @@ default-key B125F60B7B287FF6A2B7DF8F170AF0E2954295DF # DO NOT USE THIS ONE. #keyserver hkp://pool.sks-keyservers.net -keyserver hkp://keys.openpgp.org +#keyserver hkp://keys.openpgp.org #keyserver hkp://pgp.mit.edu #keyserver hkp://keyserver.pgp.com -#keyserver hkp://ipv4.pool.sks-keyservers.net +keyserver hkp://ipv4.pool.sks-keyservers.net #keyserver hkp://keys.gnupg.net #keyserver hkp://keyserver.ubuntu.com #keyserver hkp://keyring.debian.org