Auto Update
This commit is contained in:
parent
0e7be258d9
commit
8df363428d
9 changed files with 30 additions and 38 deletions
15
.profile
15
.profile
|
@ -1,15 +0,0 @@
|
||||||
if [ -d ~/git/dotfiles ] ; then
|
|
||||||
bash ~/git/dotfiles/pull.sh
|
|
||||||
rm ~/.bashrc ~/.bash_aliases ~/.profile
|
|
||||||
(cd ~/git/dotfiles
|
|
||||||
ln ./.bashrc ../../
|
|
||||||
ln ./.bash_aliases ../../
|
|
||||||
ln ./.profile ../../)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO remove eventually
|
|
||||||
if [ -f ~/.bash_fzf ] ; then
|
|
||||||
rm ~/.bash-fzfrc ~/.bash_fzf
|
|
||||||
fi
|
|
||||||
|
|
||||||
. ~/.bashrc
|
|
|
@ -36,9 +36,9 @@ if [ -d "$HOME/bin" ] ; then
|
||||||
PATH="$HOME/bin:$PATH:$HOME/.local/bin"
|
PATH="$HOME/bin:$PATH:$HOME/.local/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# source fzf script for interactive use
|
# source misc user scripts
|
||||||
if [ -f ~/git/dotfiles/.bash_fzf ] ; then
|
if [ -d ~/git/dotfiles/files ] ; then
|
||||||
. ~/git/dotfiles/.bash_fzf
|
. ~/git/dotfiles/files/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# source headscale autocompletion script
|
# source headscale autocompletion script
|
||||||
|
@ -53,11 +53,6 @@ else
|
||||||
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get function to see available colors for PS1
|
|
||||||
if [ -f ~/git/dotfiles/.colors ] ; then
|
|
||||||
. ~/git/dotfiles/.colors
|
|
||||||
fi
|
|
||||||
|
|
||||||
# fetch uninstalled package names when attempting command (arch only)
|
# fetch uninstalled package names when attempting command (arch only)
|
||||||
if [ -f /usr/share/doc/pkgfile/command-not-found.bash ] ; then
|
if [ -f /usr/share/doc/pkgfile/command-not-found.bash ] ; then
|
||||||
source /usr/share/doc/pkgfile/command-not-found.bash
|
source /usr/share/doc/pkgfile/command-not-found.bash
|
10
files/.profile
Normal file
10
files/.profile
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
TODELETE="$(command ls --almost-all ~/git/dotfiles/files)"
|
||||||
|
|
||||||
|
if [ -d ~/git/dotfiles ] ; then
|
||||||
|
bash ~/git/dotfiles/pull.sh
|
||||||
|
(cd ~ ; rm $TODELETE)
|
||||||
|
(cd ~/git/dotfiles
|
||||||
|
ln ./files/* ../../)
|
||||||
|
fi
|
||||||
|
|
||||||
|
. ~/.bashrc
|
32
setup.sh
32
setup.sh
|
@ -1,38 +1,40 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# updates all dotfiles on the system
|
# updates all dotfiles on the system
|
||||||
rm ../../.bash* ../../.profile /root/.bash* /etc/nanorc ../../.PS1 /root/.PS1
|
TODELETE="$(command ls --almost-all files) .PS1"
|
||||||
|
|
||||||
cp ./.bash* /root
|
(cd ../.. ; rm $TODELETE)
|
||||||
ln ./.bash* ../../
|
(cd /root ; rm $TODELETE)
|
||||||
ln ./.profile ../../
|
|
||||||
|
|
||||||
rm /root/.bashrc /root/.profile
|
cp ./files/* /root
|
||||||
cp .bashrc /root
|
ln ./files/* ../../
|
||||||
cp .profile /root
|
|
||||||
cp ./nanorc /etc/nanorc
|
|
||||||
|
|
||||||
# changes PS1 prompts
|
# dotenv
|
||||||
|
if [ ! -f ../../.env ] ; then
|
||||||
|
cat << EOF >> ../../.env
|
||||||
SERV_COLOR="32"
|
SERV_COLOR="32"
|
||||||
|
USER=""
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
source ./setenv.sh
|
source ./setenv.sh
|
||||||
|
|
||||||
## root PS1
|
## root PS1
|
||||||
RED="01;31m"
|
RED="01;31m"
|
||||||
cat << EOF >> /root/.PS1
|
cat << EOF >> /root/.PS1
|
||||||
PS1='\[\033[$RED\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
PS1='\[\033[$RED\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
||||||
#PS1='\[\033[$RED\]\u\[\033[01;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
## user PS1
|
## user PS1
|
||||||
GREEN="01;32m"
|
GREEN="01;32m"
|
||||||
cat << EOF >> ../../.PS1
|
cat << EOF >> ../../.PS1
|
||||||
PS1='\[\033[$GREEN\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
PS1='\[\033[$GREEN\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
||||||
#PS1='\[\033[$GREEN\]\u\[\033[01;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ -f ../../.env ] ; then
|
## lazyness is bad
|
||||||
|
#if [ -f ../../.env ] ; then
|
||||||
|
# rm /etc/sudoers.d/user
|
||||||
|
# echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user
|
||||||
|
#fi
|
||||||
|
if [ -f /etc/sudoers.d/user ] ; then
|
||||||
rm /etc/sudoers.d/user
|
rm /etc/sudoers.d/user
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Install fzf, log out and log back in"
|
|
||||||
|
|
Loading…
Reference in a new issue