From 51c64ace9703744d13a3f7c0685319e66bc461c9 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:42:52 +0200 Subject: [PATCH] init nixy loop --- home/programs/shell/tmux.nix | 3 +-- home/scripts/nixy/default.nix | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/home/programs/shell/tmux.nix b/home/programs/shell/tmux.nix index d482a83..7d7b993 100644 --- a/home/programs/shell/tmux.nix +++ b/home/programs/shell/tmux.nix @@ -3,7 +3,6 @@ let Config = pkgs.writeShellScriptBin "Config" '' SESSION="Nixy Config" - NIXY_SCRIPT="while true; do nixy; read; done" tmux has-session -t "$SESSION" 2>/dev/null @@ -16,7 +15,7 @@ let tmux send-keys -t "$SESSION" "sleep 0.2 && clear && cd ~/.config/nixos/ && vim" C-m tmux new-window -t "$SESSION" -n "nixy" - tmux send-keys -t "$SESSION":1 "sleep 0.2 && clear && cd ~/.config/nixos/ && $NIXY_SCRIPT" C-m + tmux send-keys -t "$SESSION":1 "sleep 0.2 && clear && cd ~/.config/nixos/ && nixy loop" C-m tmux new-window -t "$SESSION" -n "lazygit" tmux send-keys -t "$SESSION":2 "sleep 0.2 && clear && cd ~/.config/nixos/ && lazygit" C-m diff --git a/home/scripts/nixy/default.nix b/home/scripts/nixy/default.nix index 1330694..f0f9214 100644 --- a/home/scripts/nixy/default.nix +++ b/home/scripts/nixy/default.nix @@ -62,6 +62,13 @@ let elif [[ $1 == "remote" ]];then cd ~/.config/nixos && git add . && git commit -m "update" && git push ssh jack -S -C "cd /home/hadi/.config/nixos && git pull && sudo -S nixos-rebuild switch --flake ~/.config/nixos#jack" + elif [[ $1 == "loop" ]];then + while true; do + nixy + read -p "Press enter to continue, e to exit" -n 1 REPLY + echo + [[ $REPLY == "e" ]] && exit 0 + done else echo "Unknown argument" fi