summaryrefslogtreecommitdiff
path: root/common/modules/window_managers/scripts.nix
diff options
context:
space:
mode:
authorbee <beebeeb5k@gmail.com>2026-05-08 02:03:19 +0530
committerbee <beebeeb5k@gmail.com>2026-05-08 02:03:19 +0530
commit34d86d83e848020764f419458ca888532893eec3 (patch)
treee806e485c28edf658e02fea032cd6ed14b0078e8 /common/modules/window_managers/scripts.nix
parent819cba6808c560628ec46176297a76219cebf9b4 (diff)
tmux wrapped terminal script
Diffstat (limited to 'common/modules/window_managers/scripts.nix')
-rw-r--r--common/modules/window_managers/scripts.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/modules/window_managers/scripts.nix b/common/modules/window_managers/scripts.nix
new file mode 100644
index 0000000..1d854ae
--- /dev/null
+++ b/common/modules/window_managers/scripts.nix
@@ -0,0 +1,23 @@
+{ pkgs, config }:
+
+{
+ terminal = pkgs.writeShellScript "terminal" ''
+ TERM="${config.beeMods.terminal.default}"
+ SESSION="_main"
+
+ if pgrep -x "$TERM" >/dev/null; then
+ if tmux ls &>/dev/null; then
+ tmux neww
+ exit 0
+ else
+ exec $TERM -e tmux new -s $SESSION
+ fi
+ else
+ if tmux ls &>/dev/null; then
+ exec $TERM -e tmux attach
+ else
+ exec $TERM -e tmux new -s $SESSION
+ fi
+ fi
+ '';
+}