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
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
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
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"
-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
dry_run=false
-downres=true
+downres=false
quarter=false
-tall=true
+tall=false
restart=false
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
# 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