From: Ian Kelling Date: Thu, 3 Oct 2024 17:32:27 +0000 (-0400) Subject: minor fixes, some good improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=6a21f9aa926125914e3d818a0afd7f0d962c397a;p=distro-setup minor fixes, some good improvements --- diff --git a/brc2 b/brc2 index 84c6943..8379eab 100644 --- a/brc2 +++ b/brc2 @@ -5173,6 +5173,24 @@ snap-last() { done } +# Symlink all the args into a temp dir and view it with gwenview. +# Usage: $0 IMAGE_FILES... +# +# Useful for when we have a directory with a ton of images and we want +# to browse a subset that we can shell glob. +gwentmp() { + local d f + d=$(mktemp -d) + m ln -s "${@/#/"$PWD/"}" $d + gwenview $d + rm -rf $d +} + +chro-pull() { + local pull_host="$1" + scp -ra --delete iank@$pull_host:.config/chromium /home/iank/.config + } + export BASEFILE_DIR=/a/bin/fai-basefiles #export ANDROID_HOME=/a/opt/android-home diff --git a/filesystem/etc/cron.d/ian b/filesystem/etc/cron.d/ian index 80dcd61..6c83f86 100644 --- a/filesystem/etc/cron.d/ian +++ b/filesystem/etc/cron.d/ian @@ -30,7 +30,7 @@ MAILTO=root 20 7 * * * root myupgrade |& log-once -1 myupgrade 20 5 * * * root prof-backup |& log-once -1 prof-backup 19 * * * * root check-crypttab -4 6,12,18 * * * root failmail rsync -rlptDhSAX root@iankelling.org:/var/lib/znc/moddata/log/iank/freenode/ /p/irc-backup +4 6,12,18 * * * root irc-backup |& log-once -9 irc-backup 4 20 * * 5 iank check-lets-encrypt-ssl-settings 4 21 * * 5 iank auto-commit-changes /a /p 4 23 * * 5 iank failmail eggdrop-upgrade diff --git a/filesystem/usr/local/bin/check-stale-alerts b/filesystem/usr/local/bin/check-stale-alerts index 534e8cf..da50261 100755 --- a/filesystem/usr/local/bin/check-stale-alerts +++ b/filesystem/usr/local/bin/check-stale-alerts @@ -28,7 +28,8 @@ fi eval "$(< /dev/shm/iank-status)" dirs=() -for d in /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state; do +all_dirs=(/{var/local,home/iank}/{cron-errors,sysd-mail-once}) +for d in ${all_dirs[@]}; do if [[ -e $d ]]; then dirs+=($d) fi @@ -43,8 +44,10 @@ fi if [[ $HOSTNAME != "$MAIL_HOST" ]]; then exit 0 fi -for h in {li,bk,je}.b8.nz; do - out=$(ssh $h find /m/md/bounces/new /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f) +source /p/c/domain-info + +for h in ${active_hosts[@]}; do + out=$(ssh root@$h.b8.nz find /m/md/bounces/new ${all_dirs[@]} -type f) if [[ $out ]]; then echo $h: printf "%s\n" "$out" diff --git a/myx b/myx index ab7c156..61d1607 100755 --- a/myx +++ b/myx @@ -41,8 +41,8 @@ Alters i3 config. -r Restart secondary monitor -s split type. split monitor into 1 or more virtual screens - full: no split, full screen. - tall (default): half screen. + full (default): no split, full screen. + tall: half screen. quarter: left side is 2 quarter screens, right is 1 tall screen @@ -72,9 +72,9 @@ date "+%A, %B %d, %r, %S seconds" dry_run=false -downres=true +downres=false quarter=false -tall=true +tall=false restart=false @@ -101,20 +101,36 @@ primary_res=${primary_res_info%%+*} primary_x=${primary_res%x*} primary_y=${primary_res#*x} +winchair() { + if [[ $(edid card1-DP-1) == 192efbdcef ]]; then + return 0 + fi + return 1 +} if [[ $secondary_out ]]; then x_offset=$primary_x left_right_arg=--right-of + # dp-1 moves from left to right sometimes, i just move it out of the # conditional and comment it as needed. -# [[ $secondary_out == DP-1 && $(edid card1-DP-1 ) == f3364bc6c1 ]] || \ - if [[ $secondary_out == HDMI2 && $(edid card0-HDMI-A-2) == 192efbdcef ]] || \ - [[ $secondary_out == HDMI-1 && $(edid card1-HDMI-A-1 ) == 7c58f9ac1e ]] || \ - [[ $secondary_out == DP-2 && $(edid card1-DP-2 ) == 0c35564b67 ]]; then + if winchair; then left_right_arg=--left-of x_offset=0 fi + + + # its a small monitor, so I run: + # startx -- -dpi 120 + # + # And x decides the primary display should have non-full + # resolution. This is a quick hopefully temporary fix. + if winchair; then + xrandr --output eDP-1 --mode 1920x1200 + fi + + left_right_arg="$left_right_arg $primary_out" target_out=$secondary_out @@ -286,31 +302,31 @@ echo "bindsym \$mod+Shift+t move workspace to output ${move_outputs[*]}" >>~/i3- # i3-msg -t get_outputs | jq -C . # showed # { - # "name": "HDMI-2", - # "active": true, - # "primary": false, - # "rect": { - # "x": 1920, - # "y": 0, - # "width": 3840, - # "height": 2160 - # }, - # "current_workspace": "3" - # }, - # { - # "name": "DP-1", - # "active": false, - # "primary": false, - # "rect": { - # "x": 1920, - # "y": 0, - # "width": 3840, - # "height": 2160 - # }, - # "current_workspace": null - # } - # This was incorrect. The correct thing is that DP-1 is active, HDMI-2 is not active. - # Restarting i3 did not help. +# "name": "HDMI-2", +# "active": true, +# "primary": false, +# "rect": { +# "x": 1920, +# "y": 0, +# "width": 3840, +# "height": 2160 +# }, +# "current_workspace": "3" +# }, +# { +# "name": "DP-1", +# "active": false, +# "primary": false, +# "rect": { +# "x": 1920, +# "y": 0, +# "width": 3840, +# "height": 2160 +# }, +# "current_workspace": null +# } +# This was incorrect. The correct thing is that DP-1 is active, HDMI-2 is not active. +# Restarting i3 did not help. sleep 1 m /a/bin/ds/i3-sway/gen $gen_arg