diff options
| -rw-r--r-- | appearance/Icons.qml | 13 | ||||
| -rw-r--r-- | desktop/Drawer.qml | 9 | ||||
| -rwxr-xr-x | desktop/modules/mail/mail-notify.sh | 6 | ||||
| -rwxr-xr-x | desktop/modules/mail/waybar-mail.sh | 68 |
4 files changed, 12 insertions, 84 deletions
diff --git a/appearance/Icons.qml b/appearance/Icons.qml index 2c4c403..a6eaec5 100644 --- a/appearance/Icons.qml +++ b/appearance/Icons.qml @@ -290,19 +290,16 @@ for name in sys.argv[2:]: } Process { id: gsetProc } - // Two consumers resolve icons by name from gsettings when they are - // generated, not when they run: the SDDM power icons (udt-accent) and - // waybar's taskbar theme and module icons (its install.sh). So they are - // regenerated here, chained after the gsettings write they read. + // The SDDM power icons resolve icon names from gsettings when udt-accent + // generates them, not when they run, so they are regenerated here, + // chained after the gsettings write they read. The island resolves its + // icons live and needs nothing. readonly property string udtRepo: `${root.home}/Programming/GIT/unified-desktop-theme` - readonly property string waybarRepo: `${root.home}/Programming/GIT/waybar-theme-udt` function applyIcon(name) { Quickshell.execDetached(["sh", "-c", `gsettings set org.gnome.desktop.interface icon-theme "$1" || exit; ` + - `[ -e ~/.cache/udt/wpaper ] && ${JSON.stringify(root.udtRepo)}/bin/udt-accent ~/.cache/udt/wpaper; ` + - `[ -x ${JSON.stringify(root.waybarRepo)}/install.sh ] && ${JSON.stringify(root.waybarRepo)}/install.sh && ` + - `killall -SIGUSR2 waybar`, + `[ -e ~/.cache/udt/wpaper ] && ${JSON.stringify(root.udtRepo)}/bin/udt-accent ~/.cache/udt/wpaper`, "sh", name]); const files = [qt6File, qt5File]; for (let i = 0; i < files.length; i++) { diff --git a/desktop/Drawer.qml b/desktop/Drawer.qml index c02a4ba..31067f8 100644 --- a/desktop/Drawer.qml +++ b/desktop/Drawer.qml @@ -97,11 +97,10 @@ Scope { anchors { top: true; left: true; right: true; bottom: true } color: "transparent" - // Normal, not Ignore: waybar claims an exclusive zone at the top - // of this screen, so respecting it puts the drawer below the bar - // without this file knowing the bar's height. The drawer is - // reached from the bar, so the bar must stay visible and - // clickable while it is open. + // Normal, so a bar with an exclusive zone, if one ever returns, + // pushes the drawer below it without this file knowing its + // height. Today nothing reserves space on DP-1 (the island + // floats, waybar is gone) and the drawer starts at the top edge. exclusionMode: ExclusionMode.Normal WlrLayershell.layer: WlrLayer.Overlay diff --git a/desktop/modules/mail/mail-notify.sh b/desktop/modules/mail/mail-notify.sh index b132775..968799c 100755 --- a/desktop/modules/mail/mail-notify.sh +++ b/desktop/modules/mail/mail-notify.sh @@ -19,9 +19,9 @@ # mail, since reading and tagging also commit, which is why the revision # counter does the work rather than a count delta. # -# This is its own process rather than part of waybar-mail.sh, which already -# has the same arrival edge: waybar owns that process, so a bar restart would -# stop notifications with nothing reporting it. +# This is its own process rather than part of a bar: a bar restart would +# otherwise stop notifications with nothing reporting it. (It began next to +# waybar-mail.sh, which watched the same arrival edge and went with waybar.) # # Usage: # mail-notify.sh watch forever (what autostart runs) diff --git a/desktop/modules/mail/waybar-mail.sh b/desktop/modules/mail/waybar-mail.sh deleted file mode 100755 index 207a86e..0000000 --- a/desktop/modules/mail/waybar-mail.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2026 Danilo M. <danix@danix.xyz> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# Waybar custom module in continuous mode: prints one JSON line per notmuch -# commit, forever, and waybar redraws on each line. Waybar owns this process, -# which is why there is no daemon to supervise and no interval to tune. -# -# The count is the total across every account. A per account breakdown is the -# drawer's job; see desktop/modules/mail/README.md. - -set -u - -QUERY='tag:unread and tag:inbox' - -# notmuch knows where its own database is, so this follows a moved database -# without an edit here. -db="$(notmuch config get database.path 2>/dev/null)/xapian" - -emit() { - local n - n="$(notmuch count "$QUERY" 2>/dev/null)" - - # The output is the test, not the exit status. notmuch fails two different - # ways: a rejected query prints nothing and exits 1, while a query Xapian - # merely misparses ('tag:unread and ((') returns a plausible wrong number - # and exits 0. Only the first is detectable, and it is the one that matters - # here, because empty output would otherwise render as "no new mail". The - # second is why QUERY is a fixed string and not built from anything. - if [[ ! "$n" =~ ^[0-9]+$ ]]; then - printf '{"text":"!","tooltip":"notmuch count failed","class":"error"}\n' - return - fi - - if [[ "$n" -eq 0 ]]; then - printf '{"text":"","class":"empty"}\n' - else - printf '{"text":"%s","class":"unread"}\n' "$n" - fi -} - -if [[ ! -d "$db" ]]; then - printf '{"text":"!","tooltip":"no notmuch database","class":"error"}\n' - exit 1 -fi - -emit - -while inotifywait -qq -e close_write,moved_to "$db" 2>/dev/null; do - # One commit touches several files. Without this the module redraws three - # or four times per sync with intermediate counts. - sleep 0.3 - emit -done - -# Falling out of the loop means inotifywait itself failed. Say so rather than -# exiting silently, which looks like an empty inbox. -printf '{"text":"!","tooltip":"mail watcher stopped","class":"error"}\n' -exit 1 |
