mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
23 lines
482 B
Nix
23 lines
482 B
Nix
{
|
|
writeShellApplication,
|
|
tmux,
|
|
symlinkJoin,
|
|
}: let
|
|
tmux-register-session = writeShellApplication {
|
|
name = "__tmux-register-session";
|
|
runtimeInputs = [tmux];
|
|
text = ''
|
|
last=/tmp/TMUX_LAST
|
|
this="$(tmux display-message -p '#S')"
|
|
if [ ! -f "$last" ] || [ "$(cat "$last")" != "$this" ]; then
|
|
echo "$this" >"$last"
|
|
fi
|
|
'';
|
|
};
|
|
in
|
|
symlinkJoin {
|
|
name = "tmux-sessionizer";
|
|
paths = [
|
|
tmux-register-session
|
|
];
|
|
}
|