mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-12-23 11:12:48 +01:00
added zsh_tmux
This commit is contained in:
parent
62edb3639d
commit
a6df36aa40
@ -10,6 +10,8 @@ touch ~/.zshenv # Creates .zshenv
|
|||||||
cat zshenv > ~/.zshenv.default.backup # Backs up .zsh_exports.
|
cat zshenv > ~/.zshenv.default.backup # Backs up .zsh_exports.
|
||||||
touch ~/.zsh_functions
|
touch ~/.zsh_functions
|
||||||
cat ~/.zsh_functions > ~/.zsh_functions.default.backup # Backs up .zsh_functions .
|
cat ~/.zsh_functions > ~/.zsh_functions.default.backup # Backs up .zsh_functions .
|
||||||
|
touch ~/.zsh_tmux
|
||||||
|
cat ~/.zsh_tmux > ~/.zsh_tmux.default.backup
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
echo "Installing zsh_aliases."
|
echo "Installing zsh_aliases."
|
||||||
cat zsh_aliases > ~/.zsh_aliases
|
cat zsh_aliases > ~/.zsh_aliases
|
||||||
@ -23,4 +25,7 @@ echo "zsh_exports installed."
|
|||||||
echo "Installing zsh_functions"
|
echo "Installing zsh_functions"
|
||||||
cat zsh_functions > ~/.zsh_functions
|
cat zsh_functions > ~/.zsh_functions
|
||||||
echo "zsh_functions installed."
|
echo "zsh_functions installed."
|
||||||
|
echo "Installing zsh_tmux..."
|
||||||
|
cat zsh_tmux > ~/.zsh_tmux
|
||||||
|
echo "zsh_tmux installed."
|
||||||
echo "Installation has completed. Now run 'source ~/.zshrc' to enable the new things."
|
echo "Installation has completed. Now run 'source ~/.zshrc' to enable the new things."
|
||||||
|
17
zsh_tmux
Normal file
17
zsh_tmux
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Different ways to start tmux on zsh startup.
|
||||||
|
|
||||||
|
# Starts tmux always on start of zsh, not only on SSH login, and quits from bash when tmux quits. (Modified from Cubox's script and William Shallum's tmux on SSH login http://william.shallum.net/random-notes/automatically-start-tmux-on-ssh-login )
|
||||||
|
#if [[ $TERM != "screen" ]]
|
||||||
|
#then
|
||||||
|
# tmux has-session -t 0 && tmux attach-session -t 0 || tmux new-session -s 0 && exit
|
||||||
|
#fi
|
||||||
|
|
||||||
|
# Starts tmux on SSH login. (From http://william.shallum.net/random-notes/automatically-start-tmux-on-ssh-login )
|
||||||
|
# I personally think that this is more suitable for me than that which I made. TIP: replace "remote" with name of server.
|
||||||
|
if [ "$PS1" != "" -a "${STARTED_TMUX:-x}" = x -a "${SSH_TTY:-x}" != x ]
|
||||||
|
then
|
||||||
|
STARTED_TMUX=1; export STARTED_TMUX
|
||||||
|
sleep 1
|
||||||
|
( (tmux has-session -t remote && tmux attach-session -t remote) || (tmux new-session -s remote) ) && exit 0
|
||||||
|
echo "tmux failed to start"
|
||||||
|
fi
|
12
zshrc
12
zshrc
@ -44,14 +44,4 @@ zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
|||||||
source ~/.zsh_aliases
|
source ~/.zsh_aliases
|
||||||
source ~/.zshenv
|
source ~/.zshenv
|
||||||
source ~/.zsh_functions
|
source ~/.zsh_functions
|
||||||
|
source ~/.zsh_tmux
|
||||||
## DO NOT PUT ANYTHING BELOW THIS LINE OR YOUR CHANGES MAY GET IGNORED BY BASH!
|
|
||||||
#sleep 1;
|
|
||||||
|
|
||||||
# Gives second time to press CTRL + C in case you want to prevent action by tmux.
|
|
||||||
|
|
||||||
# Starts tmux always on start of bash, not only on SSH login, and quits from bash when tmux quits. WARNING: I DON'T KNOW WHAT HAPPENS IF YOU DON'T HAVE TMUX INSTALLED! (Modified from Cubox's script and William Shallum's tmux on SSH login http://william.shallum.net/random-notes/automatically-start-tmux-on-ssh-login )
|
|
||||||
#if [[ $TERM != "screen" ]]
|
|
||||||
#then
|
|
||||||
# tmux has-session -t 0 && tmux attach-session -t 0 || tmux new-session -s 0 && exit
|
|
||||||
#fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user