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
u /etc/systemd/system/mailbindwatchdog.service <<EOF
[Unit]
Description=Watchdog to restart services relying on systemd-resolved dir
-After=syslog.target network-online.target
-Wants=network-online.target
+After=network.target
BindsTo=mailnn.service
[Service]
:
;;
*)
- soff radicale mailclean.timer dovecot $spamd_ser rspamd $vpnser mailnn clamav-daemon
+ soff radicale mailclean.timer dovecot $spamd_ser rspamd $vpnser mailnn clamav-daemon unbound
;;
esac
EOF
exit $1
}
-edid() {
- card=$1
- sha256sum </sys/class/drm/$card/edid | grep -oE '^.{10}'
+
+edid-test() {
+ local edid_10_prefix="$1"
+ sha256sum /sys/class/drm/*/edid | grep -Eq ^$edid_10_prefix &>/dev/null || [[ $? == 141 ]]
}
i3() {
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
# 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
#
# 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