summaryrefslogtreecommitdiff
path: root/common/modules/window_managers/scripts.nix
diff options
context:
space:
mode:
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
+ '';
+}