From 60cfd303111317d39d6d358d235b6733bc92a8d7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 18 Nov 2024 15:36:34 -0500 Subject: [PATCH] minor fixes --- brc3 | 3 +++ mail-setup | 15 +++++++++------ myx | 25 ++++++++++++------------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/brc3 b/brc3 index 09f5627..a0d864f 100644 --- a/brc3 +++ b/brc3 @@ -116,3 +116,6 @@ schroot-cleanup() { schroot -e -c $session done } + +# misc bash tip. If we have a set of lines we want to know if one is a specific string, we can use =~ with: +# regex="("$'\n'"|^)$string("$'\n'"|$)" diff --git a/mail-setup b/mail-setup index 054a276..2fb12eb 100755 --- a/mail-setup +++ b/mail-setup @@ -820,14 +820,18 @@ EOF u /etc/systemd/system/mailnn.service <<'EOF' [Unit] Description=Network Namespace for mail vpn service that will live forever and cant fail -# These are the same as unbound.service. Note, that if we had an After= for a later target +# These are the same as unbound.service, except no wants=, which seems +# to me could only make it run earlier, not later. Note, that if we had an +# After= for a later target # than nss-lookup, systemd would just ignore unbound's After=mailnn.service and # start it first. It seems logically, that we should not need the Before= here, # but I'm not confident that systemd would do something unexpected and still start -# unbound earlier than this. +# unbound earlier than this. Also, it seems there is a bug in systemd 255.4 (ecne), +# where if mailnn is disabled and is started by unbound's dependency, then we stop +# unbound, change it to joinsnamespaceof=mailnn, then start it, it won't join the +# existing namespace. So, for now, just avoid doing that. After=network.target Before=nss-lookup.target -Wants=network-online.target [Service] Type=simple @@ -841,8 +845,7 @@ EOF u /etc/systemd/system/mailbindwatchdog.service </dev/null || [[ $? == 141 ]] } i3() { @@ -101,14 +102,6 @@ primary_res=${primary_res_info%%+*} primary_x=${primary_res%x*} primary_y=${primary_res#*x} -# monitor at chair by window -winchair() { - if [[ $(edid card1-DP-1) == 192efbdcef ]]; then - return 0 - fi - return 1 -} - if [[ $secondary_out ]]; then x_offset=$primary_x @@ -116,7 +109,13 @@ if [[ $secondary_out ]]; then # dp-1 moves from left to right sometimes, i just move it out of the # conditional and comment it as needed. - if winchair; then + + winchair=false + if edid-test 192efbdcef; then + winchair=true + fi + + if $winchair; then left_right_arg=--left-of x_offset=0 fi @@ -127,7 +126,7 @@ if [[ $secondary_out ]]; then # # And x decides the primary display should have non-full # resolution. This is a quick hopefully temporary fix. - if winchair; then + if $winchair; then xrandr --output eDP-1 --mode 1920x1200 fi -- 2.30.2