[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
@@ -0,0 +1,27 @@
|
||||
# Mark the tmux window when a long shell command finishes, through the same
|
||||
# ~/.config/tmux/scripts/agent-state.sh the coding agents use (tool tag "sh"):
|
||||
# ✓ on exit 0, ! on failure — coloured when it happened while you were elsewhere, grey once
|
||||
# visited, gone at the next command. Only commands longer than $agent_state_min_ms
|
||||
# (default 30 s) count, and interactive programs are skipped: the agents mark themselves,
|
||||
# and quitting a long nvim or lazygit session is not news. No-op outside tmux.
|
||||
set -q agent_state_min_ms; or set -g agent_state_min_ms 30000
|
||||
|
||||
function __agent_state_preexec --on-event fish_preexec
|
||||
set -q TMUX_PANE; or return
|
||||
~/.config/tmux/scripts/agent-state.sh sh busy
|
||||
end
|
||||
|
||||
function __agent_state_postexec --on-event fish_postexec
|
||||
set -l st $status # first statement: anything before it would clobber the command's status
|
||||
set -q TMUX_PANE; or return
|
||||
test "$CMD_DURATION" -gt "$agent_state_min_ms"; or return
|
||||
switch (string split -m1 ' ' -- $argv[1])[1]
|
||||
case nvim vim vi less man lazygit ssh mosh tmux claude claudes pi opencode opencodes codex aichat htop btop top journalctl tail watch
|
||||
return
|
||||
end
|
||||
if test $st -eq 0
|
||||
~/.config/tmux/scripts/agent-state.sh sh done
|
||||
else
|
||||
~/.config/tmux/scripts/agent-state.sh sh error
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
# Drop kitty's KITTY_PUBLIC_KEY from the shell environment.
|
||||
#
|
||||
# kitty generates a random 40-char base85 public key per instance and exports it
|
||||
# to every child (kitty/child.py). It is only read on the password path of kitty
|
||||
# remote control (kitty/remote_control.py: "Password usage requested but
|
||||
# KITTY_PUBLIC_KEY environment variable is not available"), which needs
|
||||
# allow_remote_control — not enabled here. `kitten ssh`, icat, clipboard and
|
||||
# shell integration never touch it.
|
||||
#
|
||||
# Why bother: tools that inline the environment into generated code get corrupted
|
||||
# when a value contains a String.replace replacement sequence. prettier's
|
||||
# --experimental-cli inlines JSON.stringify(process.env) into its parallel worker
|
||||
# and splices it with .replace(placeholder, bootloader); a `$` + backtick in the
|
||||
# key expands to "everything before the match", injecting the worker's own source
|
||||
# mid-string. Every file then fails with a bogus
|
||||
# "SyntaxError: Unexpected identifier 'string'". Roughly a 1-in-185 chance per
|
||||
# kitty launch, which is exactly as fun to debug as it sounds.
|
||||
if set -q KITTY_PUBLIC_KEY
|
||||
set -e KITTY_PUBLIC_KEY
|
||||
end
|
||||
@@ -106,7 +106,7 @@ if status is-interactive
|
||||
abbr scrcpys 'scrcpy -wS --power-off-on-close'
|
||||
abbr tts "tt -notheme -bold -showwpm -json"
|
||||
abbr tuioss "tuios --show-clock --show-keys --show-cpu --show-ram --confirm-quit"
|
||||
abbr keybinds "cd ~/.dots/ && nvim gui/.config/hypr/keybindings.conf"
|
||||
abbr keybinds "cd ~/.dots/ && nvim gui/.config/hypr/dots_binds.lua"
|
||||
abbr vpnhome "sudo wg-quick up wg0"
|
||||
abbr vpnkralizec "sudo wg-quick up kralizec-wg0"
|
||||
abbr vpnsumadija "sudo wg-quick up sumadija-wg0"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
function glow --wraps glow --description 'glow wrapped at the current terminal width; an explicit -w still wins'
|
||||
# glow never sizes itself to the terminal: glow.yml's width (or its built-in 80) applies, and
|
||||
# `width: 0` in the config means 80 too. Wide tables get squeezed into that, one word per line.
|
||||
# $COLUMNS tracks window resizes; a later -w/--width in $argv overrides this one.
|
||||
command glow --width $COLUMNS $argv
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
function md2pdf --description 'Markdown to PDF next to the source: cmark-gfm renders it, headless chromium prints it'
|
||||
# Relative image paths don't resolve (the HTML is rendered from /tmp), and chromium
|
||||
# leaves out backgrounds when printing, so code blocks lose their grey box.
|
||||
set -l html (mktemp --suffix=.html)
|
||||
begin
|
||||
echo '<meta charset="utf-8"><style>body{font-family:sans-serif;max-width:46em;margin:auto;line-height:1.5}table{border-collapse:collapse}td,th{border:1px solid #ccc;padding:.3em .6em}</style>'
|
||||
cmark-gfm -e table -e strikethrough -e autolink -e tasklist $argv[1]
|
||||
end >$html
|
||||
chromium --headless --no-pdf-header-footer --print-to-pdf=(path change-extension pdf $argv[1]) $html 2>/dev/null
|
||||
rm $html
|
||||
end
|
||||
Reference in new issue
Block a user