aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config')
-rw-r--r--dot_config/sway/config4
-rw-r--r--dot_config/sway/executable_tb-autostart.sh21
2 files changed, 23 insertions, 2 deletions
diff --git a/dot_config/sway/config b/dot_config/sway/config
index 752c5c2..39ddd65 100644
--- a/dot_config/sway/config
+++ b/dot_config/sway/config
@@ -43,7 +43,7 @@ output * bg #282828 solid_color
for_window [class="feh"] floating enable
for_window [app_id="imv"] floating enable
for_window [class="Tor Browser"] floating enable
-for_window [app_id="org.mozilla.Thunderbird" title=".*Mozilla Thunderbird$"] mark --add tb-main, move container to scratchpad
+for_window [app_id="org.mozilla.Thunderbird" title=".*Mozilla Thunderbird$"] mark --add tb-main
# ── Standard keybinds (sway defaults) ─────────────────────────────────────────
bindsym $mod+Return exec $term
@@ -171,7 +171,7 @@ exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CU
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec "sleep 2 && ~/.config/sway/display-toggle.sh init"
exec systemctl --user start sway-session.target
-exec thunderbird
+exec ~/.config/sway/tb-autostart.sh
# GTK4 reads dark mode from gsettings (settings.ini's prefer-dark is GTK3 only).
exec gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
diff --git a/dot_config/sway/executable_tb-autostart.sh b/dot_config/sway/executable_tb-autostart.sh
new file mode 100644
index 0000000..b77431e
--- /dev/null
+++ b/dot_config/sway/executable_tb-autostart.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Launch Thunderbird and stash the main window into the scratchpad once sway
+# marks it. Used at sway startup so TB is running but hidden from the outset.
+# Invoking Super+t (tb-toggle.sh) while TB isn't running takes a different
+# path and leaves the window tiled on the current workspace.
+
+set -eu
+
+MARK=tb-main
+
+thunderbird &
+
+for _ in $(seq 1 200); do
+ if swaymsg -t get_tree | jq -e --arg m "$MARK" '
+ [.. | objects | select(.marks? // [] | index($m))] | length > 0
+ ' >/dev/null 2>&1; then
+ swaymsg "[con_mark=\"$MARK\"] move container to scratchpad" >/dev/null
+ exit 0
+ fi
+ sleep 0.1
+done