14 Commits
Author SHA1 Message Date
jozamudi 1e96b238a6 fix(shell): track the real ~/.bashrc and ~/.gitconfig
The repo copy of .bashrc was a stock Debian startup file that nothing on this
machine reads; the live one is the Arch-style file (interactive guard, color
aliases, vim->nvim, fzf init). Replace it with the live content and start
tracking .gitconfig (identity + nvim as editor/difftool).
2026-10-29 08:55:14 -07:00
jozamudi 4bb1c06883 feat(clipboard): add read-only clipboard-check diagnostic script
Lists selection owner/metadata via wl-paste -l to tell Firefox, kitty OSC 52
and wl-copy apart when a copy appears to do nothing. 'clipboard-check.sh test'
runs a 20s observation window. Never writes the clipboard or restarts anything.
Lives in scripts/ with ~/clipboard-check.sh symlinked in, matching the
existing scripts/ convention.
2026-10-29 08:55:14 -07:00
jozamudi bf87375356 chore(portal): mask xdg-desktop-portal-hyprland
Stays masked under sway: the default backend is gtk and ScreenCast/Screenshot
route to wlr, so the hyprland portal was ~35MB of never-used daemon. Committed
as a /dev/null symlink -- that IS the systemd mask mechanism, so a checkout
restores the mask without an extra enable/mask step. Verified afterwards that
the session still exposes every portal interface.
2026-10-29 08:45:28 -07:00
jozamudi 879ade5425 feat(input): clickfinger + tap on the PIXA3854 clickpad
Framework 13 Pro pad (PIXA3854:00 093A:1343). clickfinger so a two-finger press
is the right button anywhere instead of the bottom-right corner zone, and tap
enabled with the matching left/right/middle mapping.
2026-10-29 08:45:12 -07:00
jozamudi 26efcdc6ae fix(sway): pkill-guard hypridle under exec_always
`exec` re-runs on every config reload, so each `swaymsg reload` leaked a second
hypridle: duplicate suspend/lock timers and two processes fighting over the
logind sleep inhibitor. Same pattern already used for waybar and wl-paste.
2026-10-29 08:45:08 -07:00
jozamudi d770486d87 fix(power): stop forcing the TLP power-saver profile at login
`exec tlpctl power-saver` made tlp-pd apply the *_ON_SAV keys even on AC, so
platform_profile stayed low-power while docked and the battery tuning never
took effect on charger. tlp-pd's default 'balanced' profile already flips on
charger events. Profile writes are polkit-gated, so flips must be done from
the session (`tlpctl set balanced`), not via runuser/su.
2026-10-29 08:45:04 -07:00
jozamudi 085c2a7951 chore(clipboard): disable clipman history (AUR package removed)
clipman-git was uninstalled and has no pacman equivalent, so sway was spawning
ENOENT on `clipman` at every reload/launch. Commented out rather than deleted,
with the cliphist (extra/) port noted inline for when the keybinds come back.
2026-10-29 08:44:56 -07:00
jozamudi 8d93ac7e2f feat(idle): suspend after 10 min of lid-open idle
The panel powered off at 330s but nothing ever suspended, so a lid-open idle
laptop kept drawing 6-7W indefinitely; only lid *close* suspended (logind's
default HandleLidSwitch). logind IdleAction stays Ignore on purpose -- it
cannot run swaymsg/hyprlock hooks, hypridle's before_sleep_cmd can.
Plain suspend, not suspend-then-hibernate: swap is zram-only.
2026-10-29 08:44:53 -07:00
jozamudi 77470bd03e fix(portal): screen-capture script, portal backend, swaync autostart
screen-capture.sh was a single non-executable line containing a `slur` typo,
so it never ran and nothing referenced it; rewritten as a working region
capture to ~/Pictures plus clipboard.

xdg-desktop-portal/portals.conf pins the wlr backend for sway, and swaync is
pulled in via graphical-session.target.wants so the portal's
Requisite=graphical-session.target is satisfied (the reason screen sharing
previously never started).
2026-10-27 18:32:33 -07:00
jozamudi b08cd84158 fix(sway): visible focus ring, floating modifier, volume binds
swayfx: with `border pixel` the visible line is child_border, not `border`
(which only paints title bars). Focused child_border was $base00 = black on
black, i.e. invisible; both are now the same gray.

keybinds: restore `floating_modifier $mod normal` (was `none`) and drop the
`pkill -RTMIN+10 i3blocks` tail from the volume binds -- i3blocks is not in
use, waybar is.

windows: drop a stray trailing semicolon; waybar: remove the unused
sway/submap module.
2026-10-27 18:32:33 -07:00
jozamudi 35e64fc0cc fix(swaylock): rewrite for vanilla swaylock 1.8.6
The previous file used swaylock-EFFECTS options, which the packaged swaylock
ignores. Documents that swaylock reads $XDG_CONFIG_HOME/swaylock/config on
every invocation, including hypridle's before_sleep_cmd and the $mod+m
keybind.
2026-10-27 18:32:33 -07:00
jozamudi d1bd6aae48 fix(shikane): detect silent deadlocks; re-apply profile on sway reload
watchdog: covers both observed deadlock flavours -- the loud one that repeats
"Received invalid input AtomicChangeDone at state Discarded", and the silent
one that logs nothing and just never leaves VariantInProgress.

shikane-recover-on-reload.sh (new, previously referenced by sway/config but
never committed): shikanectl reload -> sleep 2 -> watchdog check, falling
back to a service restart when reload cannot recover.

clamshell-mode.sh: documents why the laptop panel is no longer enabled
unconditionally on lid-open, which raced shikane's "External Display" profile
(eDP-1 disabled by design) and produced "Atomic commit failed: Device or
resource busy" churn.
2026-10-27 18:32:33 -07:00
jozamudi 0ceec0b4ab fix(sway): only force a post-resume modeset when the stall is actually present
recover-output-after-resume.sh existed to work around the old ThinkPad's
/etc/modprobe.d/i915.conf, which forced PSR2 and the deepest display
C-states; the flip pending across suspend never completed, so every later
commit returned EBUSY and only a full modeset cleared it.

That file is gone and this laptop's iGPU is driven by `xe` (Panther Lake has
no i915 support at all), so the original cause cannot recur. The modeset is
now conditional on the user journal actually reporting "Atomic commit
failed"/"Page-flip failed" within the last 3 minutes.

Unconditional disable/enable + `shikanectl reload` on every resume was itself
a hazard: it is the exact sequence that re-triggers the shikane
VariantInProgress deadlock the watchdog exists to recover from.

hypridle.conf's comment no longer references the deleted i915.conf.
2026-10-27 18:32:33 -07:00
jozamudi 078f9acf71 fix(display): target the Framework 13 Pro panel
Migration from the ThinkPad X1 Carbon (2880x1800) to the Framework Laptop
13 Pro, whose panel is CSOT MND508ZB1-1 = 2880x1920 3:2 @120Hz and exposes
only 2880x1920@120000Hz / @60000Hz.

shikane was requesting [email protected], a mode this panel cannot provide,
so the variant could never be satisfied: it sat in NoVariantApplied for the
whole session, with 61 historical "Discarded" events. Both profiles now use
2880x1920@120Hz (including the disabled eDP-1 block, whose mode string still
has to resolve). Verified: profile now reaches VariantApplied.

Scale is 1.75 -> 1645x1097 logical, ~147 effective DPI, chosen to reproduce
the ~145 DPI of the old panel at 1.67. 1.75 is exactly representable as
float32, which sway stores scale in; 1.6 and 1.67 are not. 2.0 would be the
only integer (1:1, unresampled) scale but yields just 1440x960 logical.

The .config/sway/config hunk also adds the matching `output $laptop` baseline
so sway does not start at scale 2.0 and re-flow when shikane applies 1.75,
and carries previously-uncommitted session wiring for the scripts below.

shikane's config.toml was previously unversioned; it now lives in this repo
and ~/.config/shikane is a symlink, matching the existing convention.
2026-10-27 18:32:21 -07:00
19 changed files with 521 additions and 191 deletions

No files matched your search

+7 -124
View File
@@ -1,130 +1,13 @@
# ~/.bashrc: executed by bash(1) for non-login shells. #
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # ~/.bashrc
# for examples #
# If not running interactively, don't do anything # If not running interactively, don't do anything
case $- in [[ $- != *i* ]] && return
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
source ~/.local/scripts/git-prompt.sh
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)") \n\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
PATH=$PATH:~/.local/bin/
export WLR_DRM_NO_MODIFIERS=1
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias vim='nvim' alias vim='nvim'
alias ssh='ssh -XC' PS1='[\u@\h \W]\$ '
alias xfreerdp='xfreerdp +clipboard /dynamic-resolution '
# Set up fzf key bindings and fuzzy completion
eval "$(fzf --bash)" eval "$(fzf --bash)"
+47 -18
View File
@@ -1,34 +1,63 @@
# Idle / lock for SWAY (wlroots), not Hyprland.
#
# Two things in the original Hyprland template silently did nothing under sway:
# * `loginctl lock-session` -> sway implements no freedesktop login1 Session
# Lock protocol, so it is a no-op. Lock directly.
# * `hyprctl dispatch dpms` -> "HYPRLAND_INSTANCE_SIGNATURE not set!".
# Use `swaymsg "output * power on|off"`.
# Also: a hyprlock instance can outlive a sway session and then make the
# `pidof hyprlock || hyprlock` guard a permanent no-op; the sway config kills
# leftovers at login (`exec --no-startup-id pkill -x hyprlock`).
general { general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. lock_cmd = pidof hyprlock || hyprlock
before_sleep_cmd = loginctl lock-session # lock before suspend. # pre-suspend uses swaylock: fast, sway-native, exits cleanly (no leak)
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. before_sleep_cmd = swaylock -f -c 000000
# DPMS "power on" alone does not clear a post-resume eDP page-flip stall
# ("Atomic commit failed: Device or resource busy" for tens of minutes).
# The script does a full disable/enable (forced modeset) but ONLY when the
# journal actually shows the stall -- it used to fire unconditionally, which
# risked the shikane VariantInProgress deadlock on healthy resumes. The
# original i915 PSR2/DC4 cause is gone; this laptop uses the `xe` driver.
# Lid-aware so it does not race shikane's "External Display" profile.
after_sleep_cmd = /home/work/.config/sway/scripts/recover-output-after-resume.sh
} }
listener { listener {
timeout = 150 # 2.5min. timeout = 150 # 2.5min
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. on-timeout = brightnessctl -s set 10
on-resume = brightnessctl -r # monitor backlight restore. on-resume = brightnessctl -r
} }
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight. # keyboard backlight
listener { listener {
timeout = 150 # 2.5min. timeout = 150
on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight. on-timeout = brightnessctl -sd rgb:kbd_backlight set 0
on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight. on-resume = brightnessctl -rd rgb:kbd_backlight
} }
listener { listener {
timeout = 300 # 5min timeout = 300 # 5min -> lock
on-timeout = loginctl lock-session # lock screen when timeout has passed on-timeout = pidof hyprlock || hyprlock
} }
listener { listener {
timeout = 330 # 5.5min timeout = 330 # 5.5min -> output power off
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed on-timeout = swaymsg "output * power off"
on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected after timeout has fired. on-resume = swaymsg "output * power on" && brightnessctl -r
} }
# 10min -> s2idle. This listener used to be missing entirely: the panel powered
# off at 330s but the machine never suspended, so a lid-open idle laptop kept
# draining ~6-7W (10h battery) forever. Closing the lid did suspend, because
# logind's default HandleLidSwitch=suspend -- but only the lid path.
# logind's own IdleAction stays Ignore on purpose (it cannot run swaymsg/hyprlock
# pre-sleep hooks; hypridle's before_sleep_cmd can).
# 600s = long enough that a compile/syncthing burst usually finishes; a suspend
# mid-task is recoverable, and before_sleep_cmd locks on resume.
# Verified: polkit org.freedesktop.login1.suspend allow_active=yes, so this
# needs no auth prompt from an active local session. Plain suspend (not
# suspend-then-hibernate) because swap is zram-only -> hibernate impossible.
listener { listener {
timeout = 1800 # 30min timeout = 600 # 10min -> suspend
on-timeout = systemctl suspend # suspend pc on-timeout = systemctl suspend
} }
+47
View File
@@ -0,0 +1,47 @@
[[profile]]
name = "laptop"
exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""]
[[profile.output]]
enable = true
search = "eDP-1"
# Panel on the Framework Laptop 13 Pro is CSOT MND508ZB1-1 = 2880x1920 (3:2)
# @120Hz. /sys/class/drm/card0-eDP-1/modes exposes ONLY 2880x1920@120000Hz
# and @60000Hz. The previous value here, [email protected], was the OLD
# ThinkPad's panel mode and does not exist on this panel, so shikane could
# never satisfy the variant -- the most likely root cause of the
# VariantInProgress deadlocks.
mode = "2880x1920@120Hz"
position = "0,0"
# Scale 1.75 chosen deliberately (2026-10-27).
# Panel: CSOT MND508ZB1-1, 2880x1920 on 13.5in = 256 PPI. What matters is
# effective DPI = PPI/scale; 1.75 -> 147 DPI, which matches the 145 DPI this
# laptop's owner previously used on the old ThinkPad (2880x1800 on 14in at
# 1.67). The exact equivalent would be 1.765; 1.75 is the nearest value that
# is exactly representable as float32 (sway stores scale as float).
# 2.0 is the only integer scale (1:1 pixel mapping, no resampling, sharpest)
# but gives just 1440x960 logical. 1.5 = max workspace at 171 DPI (small).
# History: 1.67/1.5/1.6 all tried; 1.6 was not float-exact (1.600000024).
scale = 1.75
transform = "normal"
adaptive_sync = false
[[profile]]
name = "External Display"
exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""]
[[profile.output]]
enable = false
search = "eDP-1"
# Even a disabled block carries a mode string that shikane must resolve
# against the panel's mode list, so keep it valid.
mode = "2880x1920@120Hz"
position = "0,0"
scale = 1.75
transform = "normal"
adaptive_sync = false
[[profile.output]]
enable = true
search = "n/DP-(.*)"
scale = 1.3
transform = "normal"
adaptive_sync = false
+82 -17
View File
@@ -28,15 +28,20 @@ include ~/.config/sway/config.d/*
# You can get the names of your outputs by running: swaymsg -t get_outputs # You can get the names of your outputs by running: swaymsg -t get_outputs
# https://gitlab.com/w0lff/shikane for multitple display handling # https://gitlab.com/w0lff/shikane for multitple display handling
#output * bg /home/jozamudi/Documents/Wallpapers/windows-11-stock-official-colorful-3840x2160-5658.jpg fill #output * bg /home/jozamudi/Documents/Wallpapers/windows-11-stock-official-colorful-3840x2160-5658.jpg fill
#output eDP-1 scale 1.7
#output 'BNQ BenQ PD3200U S2N01233019' scale 1.5 #output 'BNQ BenQ PD3200U S2N01233019' scale 1.5
# Baseline for the built-in panel so sway starts at the same geometry shikane
# will apply. Panel is CSOT MND508ZB1-1: 2880x1920 (3:2) with only 120Hz/60Hz
# modes available. Without this, sway defaults to scale 2.0 and the desktop
# visibly re-flows when shikane applies 1.5 a moment after login.
output $laptop mode 2880x1920@120Hz scale 1.75
#exec_always shikanectl reload #exec_always shikanectl reload
bindswitch --reload --locked lid:on output $laptop disable bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable bindswitch --reload --locked lid:off output $laptop enable
exec_always --no-startup-id '/home/work/.config/sway/scripts/clamshell-mode.sh' exec_always --no-startup-id '/home/work/.config/sway/scripts/clamshell-mode.sh'
# Re-apply shikane display profile (scaling) after every sway reload # Re-apply shikane display profile after every sway reload;
exec_always --no-startup-id shikanectl reload # falls back to a service restart if the daemon deadlocked
exec_always --no-startup-id /home/work/.config/sway/scripts/shikane-recover-on-reload.sh
#input "1267:12792:ELAN067B:00_04F3:31F8_Touchpad" { #input "1267:12792:ELAN067B:00_04F3:31F8_Touchpad" {
# dwt enabled # dwt enabled
@@ -44,6 +49,16 @@ exec_always --no-startup-id shikanectl reload
# middle_emulation enabled # middle_emulation enabled
#} #}
# Touchpad (PIXA3854:00 093A:1343, clickpad): clickfinger so a two-finger press
# is a right click instead of using the bottom-right button area.
# Tap-to-click mirrors the same 1/2/3-finger lrm mapping.
input type:touchpad {
click_method clickfinger
clickfinger_button_map lrm
tap enabled
tap_button_map lrm
}
### Idle configuration ### Idle configuration
#exec swayidle -w \ #exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \ # timeout 300 'swaylock -f -c 000000' \
@@ -54,39 +69,89 @@ exec_always --no-startup-id shikanectl reload
seat seat0 xcursor_theme Adwaita 35 seat seat0 xcursor_theme Adwaita 35
# Portal implementations are pinned in ~/.config/xdg-desktop-portal/portals.conf
# (default=gtk, ScreenCast/Screenshot=wlr, Inhibit=none, GlobalShortcuts=hyprland).
exec systemctl --user start xdg-desktop-portal-wlr.service exec systemctl --user start xdg-desktop-portal-wlr.service
#exec pipewire #exec pipewire
exec swaync # swaync is started by its systemd user unit / D-Bus activation; starting it
exec_always --no-startup-id pkill -x waybar; waybar -c ~/.config/sway/waybar/config.jsonc -s ~/.config/sway/waybar/style.css # here too caused "already running" crash-loops (start-limit-hit).
#exec swaync
# NOTE: the command must be quoted -- sway splits unquoted ';' into separate
# sway commands and fails with "Unknown/invalid command 'waybar'"
exec_always --no-startup-id "pkill -x waybar; waybar -c ~/.config/sway/waybar/config.jsonc -s ~/.config/sway/waybar/style.css"
exec nm-applet exec nm-applet
exec blueman-applet exec blueman-applet
exec hypridle # Guarded with pkill because `exec`/`exec_always` re-runs on every sway config
# reload: a second hypridle instance would double-fire every listener (two
# suspend timers, two lock screens) and fight over the sleep inhibitor.
exec_always --no-startup-id "pkill -x hypridle; sleep 0.3; hypridle >/dev/null 2>&1 &"
# hyprlock can outlive a sway session; a stale instance then makes hypridle's
# "pidof hyprlock || hyprlock" guard a permanent no-op. Clear leftovers at login.
exec --no-startup-id pkill -x hyprlock
exec systemctl --user start hyperolkitagent # Polkit authentication agent.
# The original line was a typo ("hyperolkitagent"), so no agent ever started.
# hyprpolkitagent is installed but aborts on this machine: hyprtoolkit vendors
# aquamarine, which refuses to create a GBM allocator because the Intel Iris Xe
# iGPU has no PRIME export (drmGetCap DRM_CAP_PRIME -> unsupported) and then
# asserts "Couldn't open a gbm fd" instead of falling back -- 5/5 core dumps.
# Keep hyprpolkitagent.service disabled; polkit-gnome is used instead.
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec flatpak run com.github.wwmm.easyeffects -w exec flatpak run com.github.wwmm.easyeffects -w
exec xrdb -merge ~/.Xresources exec xrdb -merge ~/.Xresources
exec wl-paste -t text --watch clipman store --no-persist
exec tlpctl power-saver # Removed 2026-10-27 (power audit): forcing the power-saver profile made TLP apply
# *_ON_SAV keys even on AC, so the platform profile stayed low-power when docked and
# the *_ON_BAT tuning in /etc/tlp.d/90-framework.conf never ran. tlp-pd's default
# 'balanced' profile already switches on charger events -- no script needed.
# # Removed 2026-10-28 (power audit): forcing power-saver made TLP apply *_ON_SAV
# keys even on AC, so the docked platform profile stayed low-power and the
# *_ON_BAT tuning never ran. tlp-pd's 'balanced' profile switches on charger
# events by itself. NOTE: profile writes are polkit-gated -- flip manually with
# tlpctl set balanced (from the desktop session, not via runuser/su).
# exec tlpctl power-saver
#exec gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" #exec gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"
#exec mpd #exec mpd
#exec syncthing #exec syncthing
# Auto start .desktop files using dex # Auto start .desktop files using dex -- dex is not installed (and there is no
exec dex -a # ~/.config/autostart), so this was a no-op.
#exec dex -a
#exec wl-paste -t text --watch clipman store --no-persist #exec wl-paste -t text --watch clipman store --no-persist
# There are two wl-paste processes running, one for the primary and one for the normal clipboard # There are two wl-paste watchers on purpose: one for the regular clipboard,
exec wl-paste -t text --watch clipman store # one for the primary selection (clipman keeps a single shared history, the
exec wl-paste -p -t text --watch clipman store # --primary flag on `pick` only decides where the picked item is served).
# Guarded with pkill because `exec` re-runs on every `swaymsg reload`: a stale
# `store --no-persist` instance from an older config survived three reloads and
# ran alongside the current pair.
# NOTE: `pkill -x` matches the process *name* only. Do NOT use `pkill -f` here --
# sway runs exec lines through `sh -c`, so the wrapper's own command line
# contains the pattern and pkill would kill the shell that is about to start
# the replacements (learned the hard way).
# [aur-cleanup 2026-10-28] clipman-git uninstalled -- AUR-only, no pacman equivalent.
# Disabled so sway doesn't spawn ENOENT on the missing `clipman` binary.
# Restore by reinstalling clipman-git, or port to extra/cliphist:
# exec_always --no-startup-id "pkill -x wl-paste; sleep 0.3; \
# wl-paste -t text --watch cliphist store & \
# wl-paste -p -t text --watch cliphist store & \
# wait"
# bindsym $mod+y exec sh -c 'cliphist list | wofi --dmenu | cliphist decode | wl-copy'
# bindsym $mod+Shift+y exec cliphist wipe
# (verify flag order with `cliphist -h`; -p selects the primary buffer)
#
# exec_always --no-startup-id "pkill -x wl-paste; sleep 0.3; \
# wl-paste -t text --watch clipman store & \
# wl-paste -p -t text --watch clipman store & \
# wait"
# The keybind to select a clipping # The keybind to select a clipping
bindsym $mod+y exec clipman --primary pick --tool wofi # bindsym $mod+y exec clipman --primary pick --tool wofi
# Clear all clippings # Clear all clippings
bindsym $mod+Shift+y exec clipman clear -a # bindsym $mod+Shift+y exec clipman clear -a
# Remove a selected clipping # Remove a selected clipping
bindsym $mod+Mod1+y exec clipman clear --tool wofi # bindsym $mod+Mod1+y exec clipman clear --tool wofi
# Empty the current clipping # Empty the current clipping
bindsym $mod+Ctrl+y exec : | wl-copy -p bindsym $mod+Ctrl+y exec : | wl-copy -p
+5 -8
View File
@@ -14,8 +14,8 @@ bindsym $mod+d exec $menu
# Change normal to inverse to use left mouse button for resizing and right # Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging. # mouse button for dragging.
# DISABLED 2026-09-28: experiment for windows popping out (accidental mod+click) # DISABLED 2026-09-28: experiment for windows popping out (accidental mod+click)
#floating_modifier $mod normal floating_modifier $mod normal
floating_modifier none #floating_modifier none
# Reload the configuration file # Reload the configuration file
bindsym $mod+Shift+c reload bindsym $mod+Shift+c reload
@@ -128,14 +128,11 @@ bindsym $mod+bracketright exec playerctl next
bindsym $mod+backslash exec playerctl play-pause bindsym $mod+backslash exec playerctl play-pause
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% \ bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
&& pkill -RTMIN+10 i3blocks;
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% \ bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
&& pkill -RTMIN+10 i3blocks;
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle \ bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
&& pkill -RTMIN+10 i3blocks;
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
+19 -3
View File
@@ -41,6 +41,22 @@ set $base0F #666666
# base00-02=bg #3E3B33, base03=olive #8C9A6B, base04=peach #F3B49F, base05=rust #D9714C, base06-07=cream #FFE8DB # base00-02=bg #3E3B33, base03=olive #8C9A6B, base04=peach #F3B49F, base05=rust #D9714C, base06-07=cream #FFE8DB
# ╔══════════════════════════════════════════════════════════════════╗
# ║ FOCUS RING (subtle gray ramp) ║
# ║ ║
# ║ With `border pixel` the line you actually see around a window is ║
# ║ child_border (5th color). `border` (1st) only paints title bars, ║
# ║ which pixel borders don't have -- so both are set to the same ║
# ║ gray here. Previously child_border for focused windows was ║
# ║ $base00 (#000000) = invisible on a black background, which is ║
# ║ why the focused window was hard to spot. ║
# ║ ║
# ║ Tune: lighter = easier to spot, darker = less obvious. ║
# ╚══════════════════════════════════════════════════════════════════╝
set $border_focus #252525
set $border_inactive #171717
set $border_unfocused #0D0D0D
#set $base00 #000000 #set $base00 #000000
#set $base01 #121212 #set $base01 #121212
#set $base02 #222222 #set $base02 #222222
@@ -59,9 +75,9 @@ set $base0F #666666
#set $base0F #444444 #set $base0F #444444
# Property Name Border BG Text Indicator Child Border # Property Name Border BG Text Indicator Child Border
client.focused #FFFFFF $base00 #FFFFFF #FFFFFF $base00 client.focused $border_focus $base00 $base07 $border_focus $border_focus
client.focused_inactive $base02 $base00 $base05 $base03 $base02 client.focused_inactive $border_inactive $base00 $base05 $border_inactive $border_inactive
client.unfocused $base01 $base00 $base05 $base03 $base01 client.unfocused $border_unfocused $base00 $base05 $border_unfocused $border_unfocused
client.urgent #FFA14C #FFA14C $base00 #FFA14C #FFA14C client.urgent #FFA14C #FFA14C $base00 #FFA14C #FFA14C
client.placeholder $base00 $base00 $base05 $base00 $base00 client.placeholder $base00 $base00 $base05 $base00 $base00
client.background $base00 client.background $base00
+1 -1
View File
@@ -1,5 +1,5 @@
# Generated windows. # Generated windows.
for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable; for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable
for_window [title="(?:Open|Save) (?:File|Folder|As)"] resize set 800 600 for_window [title="(?:Open|Save) (?:File|Folder|As)"] resize set 800 600
for_window [window_role="pop-up"] floating enable for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable for_window [window_role="bubble"] floating enable
+9 -1
View File
@@ -1,4 +1,12 @@
#!/bin/sh #!/bin/sh
# Lid-driven laptop panel handling.
#
# shikane is authoritative for output layout/scaling
# (~/.config/shikane/config.toml + shikane-watchdog.timer). This script used to
# run `swaymsg output eDP-1 enable` whenever the lid was open, which on every
# `swaymsg reload` raced the shikane "External Display" profile (eDP-1 off) and
# contributed to "Atomic commit failed: Device or resource busy" churn.
# It now only ever disables.
LAPTOP_OUTPUT="eDP-1" LAPTOP_OUTPUT="eDP-1"
LID_STATE_FILE="/proc/acpi/button/lid/LID/state" LID_STATE_FILE="/proc/acpi/button/lid/LID/state"
@@ -6,7 +14,7 @@ LID_STATE_FILE="/proc/acpi/button/lid/LID/state"
read -r LS < "$LID_STATE_FILE" read -r LS < "$LID_STATE_FILE"
case "$LS" in case "$LS" in
*open) swaymsg output "$LAPTOP_OUTPUT" enable ;;
*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;; *closed) swaymsg output "$LAPTOP_OUTPUT" disable ;;
*open) : ;; # leave to shikane
*) echo "Could not get lid state" >&2 ; exit 1 ;; *) echo "Could not get lid state" >&2 ; exit 1 ;;
esac esac
+60
View File
@@ -0,0 +1,60 @@
#!/bin/sh
# recover-output-after-resume -- clear a post-resume eDP page-flip stall.
#
# Symptom (see journalctl --user --since -5m | grep 'Atomic commit failed'):
# [wlr] backend/drm/atomic.c:82 connector eDP-1: Atomic commit failed:
# Device or resource busy
# [sway] desktop/output.c:307 Page-flip failed on output eDP-1
# ...repeatedly for tens of minutes after a resume.
#
# HISTORY: this was originally a workaround for the old ThinkPad's
# /etc/modprobe.d/i915.conf, which forced PSR2 and the deepest display C-states
# (options i915 enable_guc=3 enable_psr=2 enable_dc=4 enable_rc6=1 -- both of
# which taint the kernel). With PSR2 forced on, the flip pending across suspend
# never completed, so every later commit returned EBUSY, and DPMS "power on"
# alone did not clear it -- only a full modeset did.
#
# STATUS: that file is gone. This machine is a Framework Laptop 13 Pro whose
# iGPU is driven by `xe` (Panther Lake has no i915 support at all), so the
# original cause cannot recur. The modeset below is therefore CONDITIONAL and
# only fires when the stall is actually present in the journal.
#
# Why conditional: an unconditional disable/enable plus `shikanectl reload`
# after every resume is exactly the sequence that re-triggers the shikane
# 1.1.1 VariantInProgress deadlock (see shikane-watchdog.sh). No point paying
# that risk on resumes that are already healthy.
#
# Lid-aware on purpose: a blind `output eDP-1 enable` raced shikane's
# "External Display" profile (which keeps eDP-1 off) and caused
# "Atomic commit failed: Device or resource busy" churn in clamshell mode.
# See the note in clamshell-mode.sh.
set -u
LID_STATE="${LID_STATE:-/proc/acpi/button/lid/LID/state}"
OUTPUT="${OUTPUT:-eDP-1}"
# Always undo the idle DPMS-off first (this is what after_sleep_cmd used to do).
swaymsg "output * power on" 2>/dev/null
# Only escalate to a modeset if the page-flip stall is actually being reported.
# sway runs inside the user session, so its stderr is in the user journal.
if command -v journalctl >/dev/null 2>&1; then
if ! journalctl --user --since '-3 min' --no-pager 2>/dev/null \
| grep -qE 'Atomic commit failed|Page-flip failed on output'; then
exit 0 # healthy resume -> do not disturb shikane
fi
fi
# The modeset below is lid-gated only.
[ -r "$LID_STATE" ] || exit 0
grep -q 'open' "$LID_STATE" || exit 0 # lid closed -> leave layout to shikane
# Give the driver a moment to finish re-training the link before we modeset.
sleep 1
swaymsg "output $OUTPUT disable" 2>/dev/null
sleep 1
swaymsg "output $OUTPUT enable" 2>/dev/null
# Re-assert the shikane profile (mode/scale/position) on top of the modeset.
command -v shikanectl >/dev/null 2>&1 && shikanectl reload 2>/dev/null
exit 0
+32 -2
View File
@@ -1,3 +1,33 @@
#!/bin/bash #!/bin/sh
# Region screenshot -> ~/Pictures + clipboard.
#
# This file used to contain a single broken line (`slur`, and it was not
# executable): the typo meant `slurp` never ran, and nothing referenced it
# anyway -- the $mod+shift+p keybind in config.d/keybinds has its own inline
# pipeline. Fixed and kept as the shared implementation so the behaviour is
# identical wherever it gets wired up.
#
# Usage: screen-capture.sh [region|output|full] (default: region)
# (no "window" mode: slurp offers region, `-o` output and `-p` point selection
# only -- it cannot pick a window)
slur set -u
outdir="${XDG_PICTURES_DIR:-$HOME/Pictures}"
mkdir -p "$outdir"
file="$outdir/$(date +%F-%H%M%S).png"
case "${1:-region}" in
region) geom=$(slurp) || exit 1 # Esc cancels
[ -n "$geom" ] || exit 1
grim -g "$geom" "$file" ;;
output) geom=$(slurp -o -f '%g') || exit 1 # pick a monitor
[ -n "$geom" ] || exit 1
grim -g "$geom" "$file" ;;
full) grim "$file" ;;
*) echo "usage: $(basename "$0") [region|output|full]" >&2; exit 2 ;;
esac
[ -s "$file" ] || { echo "capture failed" >&2; exit 1; }
wl-copy < "$file"
notify-send -i "$file" "Screenshot saved" "$file"
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
# shikane-recover-on-reload: run after every sway startup/reload
# (wired up via exec_always in the sway config).
#
# Re-applies the shikane profile, then verifies the daemon came out
# the other side: if the re-apply hit the commit-failure race, the
# watchdog check (2s later) restarts the service to recover.
set -u
shikanectl reload 2>/dev/null
sleep 2
exec /home/work/.config/sway/scripts/shikane-watchdog.sh
+20 -7
View File
@@ -3,8 +3,11 @@
# #
# Bug (shikane 1.1.1): if a variant application is discarded mid-way # Bug (shikane 1.1.1): if a variant application is discarded mid-way
# (e.g. by a failing DP atomic commit), the daemon gets stuck in # (e.g. by a failing DP atomic commit), the daemon gets stuck in
# VariantInProgress/Discarded and keeps logging # VariantInProgress/Discarded. Two flavors observed:
# loud: keeps logging
# [WARN shikane::variant] Received invalid input AtomicChangeDone at state Discarded # [WARN shikane::variant] Received invalid input AtomicChangeDone at state Discarded
# silent: no WARN at all; the variant state ends at "Discarded" and the
# daemon state machine simply never leaves VariantInProgress
# `shikanectl reload` does not recover it; a service restart does # `shikanectl reload` does not recover it; a service restart does
# (re-applies the active profile in ~1s). # (re-applies the active profile in ~1s).
# #
@@ -25,21 +28,31 @@ if [ -n "$latest3" ]; then
*VariantApplied*) *VariantApplied*)
: ;; # healthy : ;; # healthy
*) *)
# InProgress/Discarded within the last 3 min: only a deadlock # Daemon still InProgress. Deadlock signatures (a legitimate
# if the WARN signature is present (a legitimate slow transition # slow transition has neither):
# has no WARN) # loud: the WARN from the discarded-variant race
# silent: variant discarded but daemon never processed it
printf '%s\n' "$logs3" | grep -q 'invalid input' && stuck=1 printf '%s\n' "$logs3" | grep -q 'invalid input' && stuck=1
if [ "$stuck" -eq 0 ]; then
lastvariant=$(printf '%s\n' "$logs3" \
| grep 'shikane::variant' | grep 'New variant state' | tail -1)
case "$lastvariant" in
*Discarded*) stuck=1 ;;
esac
fi
;; ;;
esac esac
else else
# No state change in the last 3 min — check the last known state # No state change in the last 3 min — check the last known state
last10=$(journalctl --user -u "$unit" -q --since "-10min" 2>/dev/null \ # (unbounded: a stuck daemon may have gone silent long ago,
# e.g. across a laptop suspend)
lastline=$(journalctl --user -u "$unit" -q -n 500 2>/dev/null \
| grep 'daemon::state_machine' | tail -1) | grep 'daemon::state_machine' | tail -1)
case "$last10" in case "$lastline" in
'' | *VariantApplied*) '' | *VariantApplied*)
: ;; # stable and applied, or nothing to check : ;; # stable and applied, or nothing to check
*) *)
stuck=1 ;; # stuck in-progress/discarded for >3 min stuck=1 ;; # stuck in-progress/discarded, any age
esac esac
fi fi
-1
View File
@@ -3,7 +3,6 @@
"spacing": 2, // Gaps between modules (4px) "spacing": 2, // Gaps between modules (4px)
"modules-left": [ "modules-left": [
"sway/workspaces", "sway/workspaces",
"sway/submap",
"sway/scratchpad", "sway/scratchpad",
"sway/window" "sway/window"
], ],
+53 -9
View File
@@ -1,15 +1,59 @@
# swaylock configuration -- VANILLA swaylock (packaged v1.8.6).
#
# swaylock reads $XDG_CONFIG_HOME/swaylock/config automatically, so this file
# applies to every invocation, including hypridle's before_sleep_cmd and the
# $mod+m keybind.
#
# IMPORTANT: the previous version of this file used swaylock-EFFECTS options
# (clock, timestr, datestr, fade-in, effect-blur, effect-scale and a bare
# `indicator`). The packaged swaylock is vanilla, and each of those lines logs
# swaylock: unrecognized option '--effect-blur=20x2'
# + a full usage dump, then ignores it (verified against v1.8.6). So the file
# was never fatal -- but none of its styling ever applied either, which is why
# the lock screen always looked like a bare `swaylock -c 000000`. Keep only
# names that appear in `swaylock --help` (check: every key here matches one).
#
# Want the blurred background + clock lock screen? Use hyprlock (installed and
# configured at ~/.config/hypr/hyprlock.conf) -- that is what hypridle's
# lock_cmd / 300s listener already call. Or install swaylock-effects from the
# AUR and re-add the effect-* keys.
ignore-empty-password ignore-empty-password
show-failed-attempts
indicator-caps-lock
clock font=JetBrainsMono Nerd Font Mono
timestr=%R font-size=24
datestr=%a, %e of %B
indicator-radius=110
indicator-thickness=12
fade-in=0.2 color=000000
#screenshots inside-color=00000000
effect-blur=20x2 inside-clear-color=00000000
#effect-greyscale inside-ver-color=00000000
effect-scale=0.3 inside-wrong-color=00000000
indicator line-color=333333
line-clear-color=CCCCCC
line-ver-color=999999
line-wrong-color=FFA14C
ring-color=333333
ring-clear-color=CCCCCC
ring-ver-color=999999
ring-wrong-color=FFA14C
key-hl-color=CCCCCC
bs-hl-color=FFA14C
separator-color=222222
text-color=FFFFFF
text-clear-color=CCCCCC
text-ver-color=FFFFFF
text-wrong-color=FFA14C
layout-bg-color=00000000
layout-border-color=00000000
layout-text-color=CCCCCC
@@ -0,0 +1 @@
/usr/lib/systemd/user/swaync.service
@@ -0,0 +1 @@
/dev/null
+22
View File
@@ -0,0 +1,22 @@
# Portal implementation pinning for the SWAY session.
#
# Without this file xdg-desktop-portal fell back to the deprecated `UseIn` key
# and picked hyprland.portal at random ("Choosing hyprland.portal ... via the
# deprecated UseIn key"), while the sway config also started the wlr portal --
# two implementations registered at once.
#
# Base is Arch's own /usr/share/xdg-desktop-portal/sway-portals.conf.
# GlobalShortcuts is added because neither wlr nor gtk implements it, and
# easyeffects requests it (journal: "Unknown method CreateSession or interface
# org.freedesktop.impl.portal.GlobalShortcuts").
[preferred]
default=gtk
org.freedesktop.impl.portal.ScreenCast=wlr
org.freedesktop.impl.portal.Screenshot=wlr
# gtk's Inhibit uses org.gnome.SessionManager / org.freedesktop.ScreenSaver,
# neither of which sway implements; "none" lets apps use Wayland's
# idle-inhibit protocol, which sway does implement.
org.freedesktop.impl.portal.Inhibit=none
org.freedesktop.impl.portal.GlobalShortcuts=hyprland
org.freedesktop.impl.portal.InputCapture=hyprland
+7
View File
@@ -0,0 +1,7 @@
[user]
email = [email protected]
name = Josue Zamudio
[diff]
tool = nvimdiff
[core]
editor = nvim
+95
View File
@@ -0,0 +1,95 @@
#!/usr/bin/env bash
# clipboard-check.sh -- diagnose "copy did nothing" on sway/Wayland.
# READ-ONLY: lists selection metadata and reads text; never writes the clipboard,
# never runs wl-copy, never restarts anything.
# ./clipboard-check.sh -> status (what is configured right now)
# ./clipboard-check.sh test -> 20s window: copy in Firefox, then tell me who failed
set -uo pipefail
own_sig() { # identify the owner from its advertised type list
local t
t=$(wl-paste -l 2>&1); [[ -z "$t" ]] && { echo "(clipboard empty / no owner)"; return; }
case "$t" in
*x-moz-url-priv*|*text/html*) echo "Firefox (has moz/html types)" ;;
*glfw+clipboard*) echo "kitty/GLFW terminal (OSC 52 or copy_on_select)" ;;
*image/png*) echo "image (screenshot? wl-copy -b)" ;;
*) echo "some other client: $(echo "$t" | tr '\n' ' ')" ;;
esac
}
if [[ "${1:-status}" == test ]]; then
echo "BEFORE owner: $(own_sig)"
echo
echo " >> Copy some text in Firefox NOW (Ctrl+C), then press Enter."
read -r _
echo "AFTER owner: $(own_sig)"
echo
if wl-paste -l >/dev/null 2>&1; then
n=$(wl-paste 2>/dev/null | wc -c)
echo " text available: $n byte(s)"
[[ $n -gt 0 ]] && echo " preview: $(wl-paste 2>/dev/null | head -c 70 | tr '\n' ' ')"
echo
echo " VERDICT: the compositor HAS the copy -> the loss is on the paste side"
echo " (stale PRIMARY for middle-click, or a clipboard-history keybind"
echo " that no longer exists since clipman was removed)."
else
echo " VERDICT: the compositor has NOTHING -> Firefox never took ownership."
echo " Usual causes, in order of likelihood:"
echo " 1) Firefox lacked keyboard focus at Ctrl+C -- Wayland only"
echo " accepts set_selection from the focused surface (a PiP window,"
echo " a toast, or a workspace switch stealing focus is enough)."
echo " 2) The page's own JS intercepted the copy event (sites that"
echo " block copying). dom.event.clipboardevents.enabled=true by"
echo " default, so page scripts may do this."
echo " 3) The offer got cancelled mid-transfer ('selection cancelled'"
echo " in sway's log) -- see: journalctl -b | grep 'selection cancelled'"
fi
exit 0
fi
echo "== components =="
printf ' %-22s %s\n' "sway" "$(swaymsg --version 2>&1 | head -1)"
printf ' %-22s %s\n' "wl-clipboard" "$(wl-copy --version 2>&1 | head -1)"
printf ' %-22s %s\n' "firefox" "$(firefox --version 2>&1 | head -1) [$(pacman -Q firefox 2>/dev/null || echo '?')]"
printf ' %-22s %s\n' "cliphist" "$(command -v cliphist || echo 'NOT INSTALLED (history keybinds are dead)')"
echo
echo "== clipboard managers / watchers (a watcher that dies mid-copy LOSES the copy) =="
m=$(pgrep -af 'wl-paste|cliphist|clipman|copyq|klipper|parcellite|flameshot' 2>/dev/null || true)
[[ -n "$m" ]] && echo "$m" | sed 's/^/ RUNNING /' || echo " none running <- no history is being saved, but also nothing can steal a copy"
echo
echo "== XWayland mixing (X11<->Wayland clipboard skew is a classic cause) =="
if pgrep -x Xwayland >/dev/null 2>&1; then
echo " Xwayland IS running -> any X11 app can own the selection out-of-band:"
pgrep -a Xwayland | sed 's/^/ /'
else
echo " no Xwayland -> pure Wayland, that whole failure class is ruled out"
fi
echo
echo "== window shells (a copy from an X11-surfaced Firefox behaves differently) =="
swaymsg -t get_tree 2>/dev/null | python3 -c "
import json,sys
def walk(n):
yield n
for k in ('nodes','floating_nodes'):
for c in n.get(k) or []: yield from walk(c)
for n in walk(json.load(sys.stdin)):
if n.get('pid') and n.get('type') in ('con','floating_con'):
shell = 'x11' if n.get('window') is not None else 'wayland'
wp = n.get('window_properties') or {}
ident = str(n.get('app_id') or wp.get('class'))[:24]
print(' %-8s %-26s %s' % (shell, ident, (n.get('name') or '')[:38]))
" 2>&1 | sort -u | head -12
echo
echo "== current selections (read-only) =="
printf ' CLIPBOARD owner : %s\n' "$(own_sig)"
printf ' PRIMARY types : %s\n' "$(wl-paste -p -l 2>&1 | tr '\n' ' ' | cut -c1-100)"
echo
echo "== Firefox clipboard prefs (blank = default) =="
P=$(ls ~/.mozilla/firefox/*/prefs.js 2>/dev/null | head -1)
grep -hE 'dom\.event\.clipboardevents|middlepaste|widget\.wayland' "$P" 2>/dev/null | sed 's/^/ /' || true
grep -hE 'user_pref' "$(dirname "$P")/user.js" 2>/dev/null | grep -iE 'clipboard|wayland' | sed 's/^/ user.js: /' || true
echo
echo "== past cancellations sway logged (each one = a copy that vanished) =="
journalctl -b 0 --no-pager 2>/dev/null | grep -ic 'selection cancelled' | sed 's/^/ '\''selection cancelled'\'' events this boot: /'
echo
echo "Run '$0 test' to A/B an actual Firefox copy."