[Sync] Lua Hyprland chain, licence cleanup
This commit is contained in:
1 parent
93b4f695ce
commit
47166d877f
183 files changed
+5618
-5839
No files matched your search
@@ -2,13 +2,21 @@
|
||||
# Without this, tmux collapses them to a plain Enter. Requires tmux 3.5+ for csi-u.
|
||||
set -g extended-keys on
|
||||
set -g extended-keys-format csi-u
|
||||
# termux reports xterm-256color: without RGB every #rrggbb below is approximated to the 256
|
||||
# palette on the phone, and without extkeys tmux never asks the terminal for Shift/Ctrl+Enter.
|
||||
# (kitty is xterm-kitty, whose terminfo already carries both.)
|
||||
set -as terminal-features 'xterm-256color:RGB:extkeys'
|
||||
# Let apps wrap escape sequences in DCS tmux passthrough (Claude Code / pi notifications,
|
||||
# Claude's progress bar) so they reach the outer terminal instead of being swallowed.
|
||||
set -g allow-passthrough on
|
||||
|
||||
# Mouse/touch reporting. Chiefly so the window list in the status bar is
|
||||
# tappable — tmux binds MouseDown1Status to `switch-client -t =` out of the box,
|
||||
# and status-format[1] below keeps the `range=window|…` markers that make each
|
||||
# entry a hit target, so a tap on a tab switches to it with no extra binding.
|
||||
# Wheel over the bar cycles windows; right-click a tab or the session name for
|
||||
# tmux's built-in menus (no touch equivalent — a phone can't right-click).
|
||||
# tmux's built-in menus; tmux-menus (plugin below) puts the same menus on prefix+\,
|
||||
# which a phone can tap through.
|
||||
#
|
||||
# The cost: drag-select now goes to tmux instead of kitty, so hold Shift when you
|
||||
# want kitty's own selection. Scroll wheel enters copy-mode on the pane rather
|
||||
@@ -21,6 +29,18 @@ set -g base-index 1
|
||||
setw -g pane-base-index 1
|
||||
set -g renumber-windows on
|
||||
|
||||
# One long agent turn scrolls past tmux's default 2000 lines; resurrect captures pane
|
||||
# contents from this buffer too. Applies to panes created after the change.
|
||||
set -g history-limit 50000
|
||||
|
||||
# Copy-mode: vi keys, v/y like an editor. set-clipboard on pushes every copy — tmux's own and
|
||||
# those apps inside make (nvim, pi) — over OSC 52 to the CLIENT terminal, so a yank on the
|
||||
# phone lands on the phone and on kitty lands on the desktop, wherever the server runs.
|
||||
setw -g mode-keys vi
|
||||
bind -T copy-mode-vi v send -X begin-selection
|
||||
bind -T copy-mode-vi y send -X copy-selection-and-cancel
|
||||
set -s set-clipboard on
|
||||
|
||||
# --- Session persistence (survives reboot) ---------------------------------
|
||||
# resurrect: save/restore sessions, windows, panes, layout and working dirs
|
||||
# (prefix + Ctrl-s to save, prefix + Ctrl-r to restore).
|
||||
@@ -29,6 +49,8 @@ set -g renumber-windows on
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
# menus: tmux's context menus on prefix+\ (tappable; no right-click needed on a phone).
|
||||
set -g @plugin 'jaclu/tmux-menus'
|
||||
|
||||
# Also capture pane scrollback and restore running programs (nvim, …).
|
||||
# nvim 'session' strategy restores via Session.vim when present, else plain nvim.
|
||||
@@ -87,20 +109,23 @@ set -g status-left "#{?#{e|>=:#{client_width},#{E:@status_cutoff}},#{E:@left_ful
|
||||
|
||||
# Middle: flat window list — inactive muted, active mauve/bold, 2-space gaps.
|
||||
set -g window-status-separator " "
|
||||
setw -g window-status-format "#[fg=#7f849c]#I #[fg=#6c7086]#W"
|
||||
setw -g window-status-format "#[fg=#7f849c]#I#{P:#{E:@agent_badge}} #[fg=#6c7086]#W#[default]"
|
||||
setw -g window-status-current-format "#[fg=#cba6f7,bold]#I #[fg=#cdd6f4,bold]#W"
|
||||
setw -g window-status-activity-style "fg=#f9e2af"
|
||||
# The agent-state bell flags the window (monitor-bell) so the outer terminal buzzes; tmux's
|
||||
# default bell style is `reverse`, which painted the window entry — only the glyph gets colour.
|
||||
setw -g window-status-bell-style default
|
||||
|
||||
# Right: net dl/ul · cpu · mem │ date │ clock. continuum prepends its invisible
|
||||
# save hook to status-right (this block sits above the tpm `run` line, so the
|
||||
# hook survives every reload). Metrics are scripts/*.sh, symlinked into
|
||||
# ~/.config/tmux/scripts/. The hook lands ahead of the #{?} below, i.e. outside
|
||||
# it, so it keeps running for every client regardless of which variant is drawn.
|
||||
set -g @right_full "#[fg=#a6e3a1]#(~/.config/tmux/scripts/net.sh dl) #[fg=#f9e2af]#(~/.config/tmux/scripts/net.sh ul) #[fg=#89b4fa]#(~/.config/tmux/scripts/cpu.sh) #[fg=#94e2d5]#(~/.config/tmux/scripts/mem.sh) #[fg=#fab387]#(~/.config/tmux/scripts/temp.sh)#[fg=#45475a]│ #[fg=#a6adc8]%a %b %-d #[fg=#45475a]│ #[fg=#cba6f7,bold]%H:%M "
|
||||
# Right: net dl/ul · cpu · mem · temp │ date │ clock. One #() job per refresh: metrics.sh
|
||||
# prints the whole coloured segment (it was five separate scripts per tick). continuum
|
||||
# prepends its invisible save hook to status-right (this block sits above the tpm `run`
|
||||
# line, so the hook survives every reload). The hook lands ahead of the #{?} below, i.e.
|
||||
# outside it, so it keeps running for every client regardless of which variant is drawn.
|
||||
set -g @right_full "#(~/.config/tmux/scripts/metrics.sh full)#[fg=#45475a]│ #[fg=#a6adc8]%a %b %-d #[fg=#45475a]│ #[fg=#cba6f7,bold]%H:%M "
|
||||
|
||||
# Compact: cpu + mem only. Net rates and the temp glyph go first (widest, least
|
||||
# useful on a phone), then the date, then the clock — a phone shows its own.
|
||||
set -g @right_compact "#[fg=#89b4fa]#(~/.config/tmux/scripts/cpu.sh) #[fg=#94e2d5]#(~/.config/tmux/scripts/mem.sh) "
|
||||
set -g @right_compact "#(~/.config/tmux/scripts/metrics.sh compact) "
|
||||
|
||||
set -g status-right "#{?#{e|>=:#{client_width},#{E:@status_cutoff}},#{E:@right_full},#{E:@right_compact}}"
|
||||
|
||||
@@ -125,28 +150,48 @@ bind S {
|
||||
# Two rows: [0] drawn top-border rule · [1] the bar content. The rule doubles as
|
||||
# the separator from the pane content above; tmux status height is whole rows, so
|
||||
# one row above the content is the smallest gap that still shows a border.
|
||||
# Full-width run of ─ (yes|head|paste avoids %, backslashes and nested parens so
|
||||
# tmux's strftime/quote/#() parsing leave it alone); tmux truncates it to width.
|
||||
# The rule is a literal run of ─ in @rule (300 columns; tmux clips it to the client
|
||||
# width), so drawing it costs no process.
|
||||
# status-format[1] is tmux 3.7's default content template (status-left/windows/right).
|
||||
set -g status 2
|
||||
set -g status-format[0] "#[fg=#6c7086,bg=default]#(yes ─ | head -n 400 | paste -sd '')"
|
||||
set -g status-format[1] "#[align=left range=left #{E:status-left-style}]#[push-default]#{T;=/#{status-left-length}:status-left}#[pop-default]#[norange default]#[list=on align=#{status-justify}]#[list=left-marker]<#[list=right-marker]>#[list=on]#{W:#[range=window|#{window_index} #{E:window-status-style}#{?#{&&:#{window_last_flag},#{!=:#{E:window-status-last-style},default}}, #{E:window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{E:window-status-bell-style},default}}, #{E:window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{E:window-status-activity-style},default}}, #{E:window-status-activity-style},}}]#[push-default]#{T:window-status-format}#[pop-default]#[norange default]#{?loop_last_flag,,#{E:window-status-separator}},#[range=window|#{window_index} list=focus #{?#{!=:#{E:window-status-current-style},default},#{E:window-status-current-style},#{E:window-status-style}}#{?#{&&:#{window_last_flag},#{!=:#{E:window-status-last-style},default}}, #{E:window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{E:window-status-bell-style},default}}, #{E:window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{E:window-status-activity-style},default}}, #{E:window-status-activity-style},}}]#[push-default]#{T:window-status-current-format}#[pop-default]#[norange list=on default]#{?loop_last_flag,,#{E:window-status-separator}}}#[range=user|newwin] #[fg=#6c7086]+#[default] #[norange]#[nolist align=right range=right #{E:status-right-style}]#[push-default]#{T;=/#{status-right-length}:status-right}#[pop-default]#[norange default]"
|
||||
set -g @rule "────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────"
|
||||
set -g status-format[0] "#[fg=#6c7086,bg=default]#{@rule}"
|
||||
set -g status-format[1] "#[align=left range=left #{E:status-left-style}]#[push-default]#{T;=/#{status-left-length}:status-left}#[pop-default]#[norange default]#[list=on align=#{status-justify}]#[list=left-marker]<#[list=right-marker]>#[list=on]#{W:#[range=window|#{window_index} #{E:window-status-style}#{?#{&&:#{window_last_flag},#{!=:#{E:window-status-last-style},default}}, #{E:window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{E:window-status-bell-style},default}}, #{E:window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{E:window-status-activity-style},default}}, #{E:window-status-activity-style},}}]#[push-default]#{T:window-status-format}#[pop-default]#[norange default]#{?loop_last_flag,,#{E:window-status-separator}},#[range=window|#{window_index} list=focus #{?#{!=:#{E:window-status-current-style},default},#{E:window-status-current-style},#{E:window-status-style}}#{?#{&&:#{window_last_flag},#{!=:#{E:window-status-last-style},default}}, #{E:window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{E:window-status-bell-style},default}}, #{E:window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{E:window-status-activity-style},default}}, #{E:window-status-activity-style},}}]#[push-default]#{T:window-status-current-format}#[pop-default]#[norange list=on default]#{?loop_last_flag,,#{E:window-status-separator}}}#[range=user|newwin] #[fg=#6c7086]+#[default] #[norange]#[range=user|agentnext] #[fg=#6c7086]»#[default] #[norange]#[nolist align=right range=right #{E:status-right-style}]#[push-default]#{T;=/#{status-right-length}:status-right}#[pop-default]#[norange default]"
|
||||
|
||||
# The `+` appended to the window list above sits in a `range=user|newwin`
|
||||
# marker. Per tmux(1), a user range triggers the same `Status` mouse key as a
|
||||
# window range and exposes its argument in #{mouse_status_range} — window ranges
|
||||
# report the literal string "window" — so one binding can serve both: click a
|
||||
# tab to select it (tmux's stock behaviour, kept in the else branch), click the
|
||||
# `+` to open a new window. Padded with spaces on both sides so it's a wide
|
||||
# enough target to hit with a thumb.
|
||||
# `+` to open a new window, click the `»` to jump to the next window with an agent
|
||||
# mark (scripts/agent-next.sh, also prefix+Tab). Padded with spaces on both sides so
|
||||
# each is a wide enough target to hit with a thumb.
|
||||
bind -n MouseDown1Status {
|
||||
if -F '#{==:#{mouse_status_range},newwin}' {
|
||||
new-window
|
||||
} {
|
||||
switch-client -t =
|
||||
if -F '#{==:#{mouse_status_range},agentnext}' {
|
||||
run-shell '~/.config/tmux/scripts/agent-next.sh'
|
||||
} {
|
||||
switch-client -t =
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Agent state per pane — set by ~/.config/tmux/scripts/agent-state.sh <tool> <state> from the
|
||||
# Claude Code / codex / pi / opencode hooks: @agent = busy|done|input|error. @agent_badge draws
|
||||
# one glyph glued to the window number ("2✓ name") in the window list, the same for every tool: ✓ done (green),
|
||||
# ? waiting for input (yellow), ! error (red); busy draws nothing. Visiting the pane only takes
|
||||
# the colour away (pane-focus-in sets @agent_seen; needs focus-events): the glyph stays, grey,
|
||||
# until the next prompt turns the state busy. prefix K clears every mark; prefix Tab (or the »
|
||||
# in the bar) jumps to the next window with a mark, coloured ones first. A coloured glyph
|
||||
# always means "this happened while you were not looking".
|
||||
set -g @agent_badge "#{?#{==:#{@agent},done},#{?#{@agent_seen},#[fg=#6c7086],#[fg=#a6e3a1]}✓,#{?#{==:#{@agent},input},#{?#{@agent_seen},#[fg=#6c7086],#[fg=#f9e2af]}?,#{?#{==:#{@agent},error},#{?#{@agent_seen},#[fg=#6c7086],#[fg=#f38ba8]}!,}}}"
|
||||
set -g focus-events on
|
||||
set-hook -g pane-focus-in 'set -p @agent_seen 1'
|
||||
bind Tab run-shell '~/.config/tmux/scripts/agent-next.sh'
|
||||
bind K run-shell 'for p in $(tmux list-panes -a -F "##{pane_id}"); do tmux set -p -t $p -u @agent; tmux set -p -t $p -u @agent_seen; done' \; display-message "agent marks cleared"
|
||||
|
||||
# Round out the theme so no default green leaks into borders/messages/modes.
|
||||
set -g pane-border-style "fg=#313244"
|
||||
set -g pane-active-border-style "fg=#cba6f7"
|
||||
|
||||
Reference in new issue
Block a user