From cb6be378c1857bd4f36475b9f74c3ee622070085 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Fri, 2 Oct 2026 13:06:54 -0400 Subject: [PATCH] feat(config): add termium PATH export, job bind shortcut, and border animation --- dot_bashrc | 4 ++ dot_config/fish/functions/_jobs_bind.fish | 54 +++++++++++++++++++ .../functions/fish_user_key_bindings.fish | 3 ++ dot_config/hypr/looknfeel.lua | 7 +++ dot_zshrc | 4 ++ 5 files changed, 72 insertions(+) create mode 100644 dot_config/fish/functions/_jobs_bind.fish diff --git a/dot_bashrc b/dot_bashrc index f780669..f0640e3 100644 --- a/dot_bashrc +++ b/dot_bashrc @@ -67,3 +67,7 @@ command -v tv >/dev/null 2>&1 && eval "$(tv init bash)" . "$HOME/.atuin/bin/env" eval "$(atuin init bash)" + +# >>> termium >>> +case ":$PATH:" in *:'/home/prad/.local/bin':*) ;; *) export PATH='/home/prad/.local/bin':"$PATH" ;; esac +# <<< termium <<< diff --git a/dot_config/fish/functions/_jobs_bind.fish b/dot_config/fish/functions/_jobs_bind.fish new file mode 100644 index 0000000..7ffe067 --- /dev/null +++ b/dot_config/fish/functions/_jobs_bind.fish @@ -0,0 +1,54 @@ +function _jobs_bind --description 'ctrl-z: fg the only job, or pick one from the jobs tv cable' + # Only reached at the prompt: while a job owns the terminal, ctrl-z is the + # tty's SIGTSTP and stops it. So ctrl-z toggles: suspend, then resume. + # Records for the `jobs` cable: display, job id, process group (tabs). + set -l recs + for line in (jobs 2>/dev/null) + set -l f (string split \t -- $line) + string match -qr '^\d+$' -- $f[1]; or continue # header row + set -a recs (printf '%%%s %-8s %s\t%s\t%s' $f[1] $f[4] $f[5] $f[1] $f[2]) + end + + set -l id + switch (count $recs) + case 0 + return + case 1 + set id (string split \t -- $recs[1])[2] + case '*' + set -lx TV_JOBS (mktemp) + printf '%s\n' $recs >$TV_JOBS + set id (_tv_inline jobs) + rm -f $TV_JOBS + end + + if test -z "$id" + commandline -f repaint + return + end + + # Run fg as a command line, not from the binding: a binding runs with the + # terminal still in fish's reader mode (extended keys on), so a job that + # never had the terminal (started with &) would get ctrl-z/ctrl-c as escape + # sequences instead of signals. The leading space keeps it out of history. + # Whatever was typed comes back at the next prompt. + set -l buf (commandline | string collect) + if test -n "$buf" + set -g __jobs_bind_buf $buf + function __jobs_bind_restore --on-event fish_prompt + functions -e __jobs_bind_restore + commandline -r -- $__jobs_bind_buf + set -e __jobs_bind_buf + end + end + + # Executing leaves "❯ __jobs_bind_fg 1" on the prompt line: step up and + # erase it, and drop fg's "Send job … to foreground" (stderr of fg only; + # the job keeps its own stdout/stderr). + function __jobs_bind_fg + printf '\033[A\033[2K\r' >/dev/tty + fg %$argv[1] 2>/dev/null + end + commandline -r -- " __jobs_bind_fg $id" + commandline -f execute +end diff --git a/dot_config/fish/functions/fish_user_key_bindings.fish b/dot_config/fish/functions/fish_user_key_bindings.fish index c4ddb16..9206e5d 100644 --- a/dot_config/fish/functions/fish_user_key_bindings.fish +++ b/dot_config/fish/functions/fish_user_key_bindings.fish @@ -24,6 +24,9 @@ function fish_user_key_bindings bind -M $mode ctrl-p _pj_bind bind -M $mode ctrl-a 'omp-session; commandline -f repaint' bind -M $mode ctrl-w 'atuin ai inline; commandline -f repaint' + # ctrl-z at the prompt: fg the only background job, or pick one from + # the jobs tv cable when there are several (_jobs_bind). + bind -M $mode ctrl-z _jobs_bind # Arrow keys: atuin owns up (bound from config.fish, survives the # fish_vi_key_bindings reset above because that only erases presets), diff --git a/dot_config/hypr/looknfeel.lua b/dot_config/hypr/looknfeel.lua index 5522959..698194c 100644 --- a/dot_config/hypr/looknfeel.lua +++ b/dot_config/hypr/looknfeel.lua @@ -80,6 +80,13 @@ o.window( -- workspacesIn/workspacesOut are not overridden anywhere, so they inherit this. hl.animation({ leaf = "workspaces", enabled = false }) +-- Slow, constant rotation of the active-border gradient (the theme's +-- hyprland_active_border; Cyberdream's is accent -> cyan). `loop` restarts +-- the angle each turn so it never eases or stops; speed is deciseconds per +-- revolution, so 100 = one lap every 10 s. Costs a redraw of the border each +-- frame while a window is mapped. +hl.animation({ leaf = "borderangle", enabled = true, speed = 100, bezier = "linear", style = "loop" }) + -- https://wiki.hypr.land/Configuring/Basics/Variables/#general -- hl.config({ -- general = { diff --git a/dot_zshrc b/dot_zshrc index 5f69007..a090a3a 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -83,3 +83,7 @@ unset _zsh_hl . "$HOME/.atuin/bin/env" eval "$(atuin init zsh)" + +# >>> termium >>> +case ":$PATH:" in *:'/home/prad/.local/bin':*) ;; *) export PATH='/home/prad/.local/bin':"$PATH" ;; esac +# <<< termium <<<