nixos-config/home-manager/stvnliu/scripts/tmux-default.script.nix
Zhongheng Liu a2bf84b09e
feat: tmux configuration
script: added script to create tmux workspace
tmux-config: sets dynamic variable defaultshell to tmux
2024-12-07 19:23:58 +02:00

18 lines
483 B
Nix

{
pkgs,
config,
}: let
tmux = config.programs.tmux.package;
windowName = "code-mode";
in
pkgs.writeShellScriptBin "tmux-code" ''
#!${pkgs.bash}/bin/bash
${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null
if [ $? != 0 ]; then
# setting up session
${tmux}/bin/tmux new -s ${windowName} -d
${tmux}/bin/tmux send-keys -t ${windowName} nvim C-m
${tmux}/bin/tmux split-window -h
fi
${tmux}/bin/tmux attach -t ${windowName}
''