sway: drop -t 2000/-t 3000 from notify-send, source restore-wayland-env in toggle-dropdown/wifi-menu
The actual cause of 'caffeine notification doesn't show' was the -t 2000 timeout: the notification popped for 2 seconds and self-cleared before the user could see it. Manual notify-send from a terminal (no -t flag) used mako's default-timeout=5000 and was visible — so the user saw my test notifications but not their own clicks. Fix: drop the -t flag everywhere so mako config owns the duration. Added: source restore-wayland-env.sh in toggle-dropdown.sh and wifi-menu.sh — same env-loss pattern as caffeine.sh, would have been next on the bug list. Verified on tadbit: -t 2000 notification visible at +0.5s, gone at +2.5s (user missed it). No -t flag: visible at +0.5s, gone at +5.5s (visible long enough to read).
This commit is contained in:
parent
d78ba4152b
commit
27ae3a3b18
3 changed files with 28 additions and 13 deletions
|
|
@ -1,6 +1,13 @@
|
|||
#!/bin/bash
|
||||
# toggle-dropdown.sh — toggle the dropdown foot terminal
|
||||
# Writes debug info to /tmp/sway-f12.log so we can diagnose from SSH
|
||||
#
|
||||
# waybar's on-click context strips WAYLAND_DISPLAY, which swaymsg + foot
|
||||
# both need. Source restore-wayland-env.sh at the top so the entire
|
||||
# script runs with the right env (mirrors caffeine.sh's pattern).
|
||||
|
||||
# shellcheck source=restore-wayland-env.sh
|
||||
source "$HOME/.config/sway/restore-wayland-env.sh"
|
||||
|
||||
LOG=/tmp/sway-f12.log
|
||||
echo "=== $(date) F12/Super+grave pressed ===" >> "$LOG"
|
||||
|
|
@ -13,7 +20,7 @@ echo "SOCK=$SOCK" >> "$LOG"
|
|||
|
||||
if [ -z "$SOCK" ]; then
|
||||
echo "ERROR: no sway socket found" >> "$LOG"
|
||||
notify-send -t 2000 "sway: no IPC socket" 2>>"$LOG" || true
|
||||
notify-send "sway: no IPC socket" 2>>"$LOG" || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -42,16 +49,11 @@ if [ "$HIDDEN" = "hidden" ]; then
|
|||
SWAYSOCK=$SOCK swaymsg '[app_id="foot"] scratchpad show' >>"$LOG" 2>&1
|
||||
echo "toggled: scratchpad show" >> "$LOG"
|
||||
else
|
||||
# Spawn a new foot. Pass through WAYLAND_DISPLAY explicitly.
|
||||
# Spawn a new foot. WAYLAND_DISPLAY is now set by restore-wayland-env.sh.
|
||||
if [ -n "$WAYLAND_DISPLAY" ]; then
|
||||
WAYLAND_DISPLAY=$WAYLAND_DISPLAY foot >>"$LOG" 2>&1 &
|
||||
else
|
||||
# try to find wayland-1 socket
|
||||
if [ -S "/run/user/$(id -u)/wayland-1" ]; then
|
||||
WAYLAND_DISPLAY=wayland-1 foot >>"$LOG" 2>&1 &
|
||||
else
|
||||
foot >>"$LOG" 2>&1 &
|
||||
fi
|
||||
foot >>"$LOG" 2>&1 &
|
||||
fi
|
||||
echo "spawned foot" >> "$LOG"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue