From c49dc83d7bef29cd986d969fb507c45066189591 Mon Sep 17 00:00:00 2001 From: Rob Date: Tue, 19 Nov 2024 06:41:25 +0000 Subject: [PATCH] add .bashrc --- dot-files/.bashrc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dot-files/.bashrc diff --git a/dot-files/.bashrc b/dot-files/.bashrc new file mode 100644 index 0000000..435c48e --- /dev/null +++ b/dot-files/.bashrc @@ -0,0 +1,28 @@ +## bash prompt styling +PS1="\[\e[32m\][\u@\h\]]:\[\e[34m\]\w\[\e[0m\]\$ " + +echo "## Mache ssh key verfügbar##" +eval "$(ssh-agent -s)" +ssh-add ~/.ssh/id_bfds_gitea + +echo "==============" +echo "## Wechsel zu aktueller NixOS config Verzeichnis ##" +echo "## run: git status" +cd /etc/nixos/ +git status + +echo "==============" +alias tmuxxx='tmux -f /etc/nixos/dot-files/.tmux.conf new -d -s mainsession' +alias tmuxx='tmux -f /etc/nixos/dot-files/.tmux.conf attach -t mainsession' +### !! if not running inside tmux, ask user to start tmux or create session !! +if [ -z "$TMUX" ]; then + if ! tmux ls &> /dev/null; then + tmuxxx + fi + + read -p "tmux starten (tmuxx / tmuxxx)? (j/n): " answer + if [ "$answer" = "j" ] || [ "$answer" = "y" ]; then + tmuxx + fi +fi +### !! if not running inside tmux !!