summaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/waybar
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/waybar')
-rw-r--r--dot_config/waybar/config.jsonc9
-rw-r--r--dot_config/waybar/executable_tb-unread.sh55
-rw-r--r--dot_config/waybar/style.css15
3 files changed, 1 insertions, 78 deletions
diff --git a/dot_config/waybar/config.jsonc b/dot_config/waybar/config.jsonc
index 6422280..2dbe4b5 100644
--- a/dot_config/waybar/config.jsonc
+++ b/dot_config/waybar/config.jsonc
@@ -25,7 +25,6 @@
"custom/arch-audit",
"custom/failed-units",
"custom/lostfiles",
- "custom/thunderbird",
"clock",
"tray",
],
@@ -254,12 +253,4 @@
"on-click": "ghostty --class=floating -e nvim -R /run/lostfiles.txt",
"tooltip": true,
},
-
- "custom/thunderbird": {
- "exec": "~/.config/waybar/tb-unread.sh",
- "return-type": "json",
- "interval": 60,
- "on-click": "~/.config/sway/tb-toggle.sh",
- "tooltip": true,
- },
}
diff --git a/dot_config/waybar/executable_tb-unread.sh b/dot_config/waybar/executable_tb-unread.sh
deleted file mode 100644
index 208333b..0000000
--- a/dot_config/waybar/executable_tb-unread.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env dash
-# Emit waybar JSON with the count of unread messages in the protonmail-bridge
-# IMAP Inbox. Requires bridge credentials in `pass` at the paths below; the
-# bridge prints them via `protonmail-bridge --cli` → `info`.
-#
-# The on-click handler in waybar config drives tb-toggle.sh, so a click on
-# the badge brings Thunderbird out of the scratchpad (or launches it if it
-# isn't running yet).
-set -eu
-
-PASS_USER=email/protonmail-bridge/user
-PASS_PW=email/protonmail-bridge/pass
-HOST=127.0.0.1
-PORT=1144
-
-emit() {
- printf '%s\n' "$1"
- exit 0
-}
-
-# Cheap reachability probe — avoids a 30s python TLS timeout when the bridge
-# is down (e.g. before it has finished unlocking on a fresh login).
-ncat -z -w 1 "$HOST" "$PORT" 2>/dev/null ||
- emit '{"text":"󰵂","tooltip":"bridge unreachable","class":"error","alt":"error"}'
-
-user=$(pass show "$PASS_USER" 2>/dev/null) ||
- emit '{"text":"󰵂","tooltip":"missing pass entry: '"$PASS_USER"'","class":"error","alt":"error"}'
-pw=$(pass show "$PASS_PW" 2>/dev/null) ||
- emit '{"text":"󰵂","tooltip":"missing pass entry: '"$PASS_PW"'","class":"error","alt":"error"}'
-
-n=$(
- PROTONMAIL_BRIDGE_USER="$user" PROTONMAIL_BRIDGE_PASS="$pw" \
- python3 - "$HOST" "$PORT" <<'PY' 2>/dev/null || true
-import imaplib, os, ssl, sys
-host, port = sys.argv[1], int(sys.argv[2])
-ctx = ssl.create_default_context()
-ctx.check_hostname = False
-ctx.verify_mode = ssl.CERT_NONE
-try:
- m = imaplib.IMAP4(host, port)
- m.starttls(ssl_context=ctx)
- m.login(os.environ["PROTONMAIL_BRIDGE_USER"], os.environ["PROTONMAIL_BRIDGE_PASS"])
- typ, data = m.status("INBOX", "(UNSEEN)")
- m.logout()
- print(int(data[0].split(b"UNSEEN ")[1].rstrip(b")")))
-except Exception:
- pass
-PY
-)
-
-case "$n" in
- '') emit '{"text":"󰵂","tooltip":"IMAP query failed","class":"error","alt":"error"}' ;;
- 0) emit '{"text":"󰇮","tooltip":"Inbox: no unread","class":"empty","alt":"empty"}' ;;
- *) emit "$(printf '{"text":"󰇮 %s","tooltip":"Inbox: %s unread","class":"unread","alt":"unread"}' "$n" "$n")" ;;
-esac
diff --git a/dot_config/waybar/style.css b/dot_config/waybar/style.css
index fe2f3bb..1a0da3f 100644
--- a/dot_config/waybar/style.css
+++ b/dot_config/waybar/style.css
@@ -64,8 +64,7 @@ window#waybar {
#custom-pacdiff,
#custom-failed-units,
#custom-arch-audit,
-#custom-lostfiles,
-#custom-thunderbird {
+#custom-lostfiles {
padding: 0 6px;
}
@@ -186,18 +185,6 @@ window#waybar {
color: #fe8019; /* orange — unread */
}
-#custom-thunderbird {
- color: #928374; /* gray when inbox is empty */
-}
-
-#custom-thunderbird.unread {
- color: #fe8019; /* orange — has unread mail */
-}
-
-#custom-thunderbird.error {
- color: #fb4934; /* red — bridge down or creds missing */
-}
-
#battery.warning {
color: #fabd2f;
}