mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
packages/tmux-sessionizer: register-session
This commit is contained in:
parent
93c6d143c4
commit
d4c5b1c667
1 changed files with 23 additions and 0 deletions
23
nix/packages/by-name/tmux-sessionizer/package.nix
Normal file
23
nix/packages/by-name/tmux-sessionizer/package.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
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
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue