diff --git a/.profile b/.profile deleted file mode 100644 index eba30eb..0000000 --- a/.profile +++ /dev/null @@ -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 diff --git a/.bash_aliases b/files/.bash_aliases similarity index 100% rename from .bash_aliases rename to files/.bash_aliases diff --git a/.bashrc b/files/.bashrc similarity index 85% rename from .bashrc rename to files/.bashrc index e3bb215..d7f9c40 100644 --- a/.bashrc +++ b/files/.bashrc @@ -36,9 +36,9 @@ if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH:$HOME/.local/bin" fi -# source fzf script for interactive use -if [ -f ~/git/dotfiles/.bash_fzf ] ; then - . ~/git/dotfiles/.bash_fzf +# source misc user scripts +if [ -d ~/git/dotfiles/files ] ; then + . ~/git/dotfiles/files/* fi # source headscale autocompletion script @@ -53,11 +53,6 @@ else PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ ' 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) if [ -f /usr/share/doc/pkgfile/command-not-found.bash ] ; then source /usr/share/doc/pkgfile/command-not-found.bash diff --git a/nanorc b/files/.nanorc similarity index 100% rename from nanorc rename to files/.nanorc diff --git a/files/.profile b/files/.profile new file mode 100644 index 0000000..db87235 --- /dev/null +++ b/files/.profile @@ -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 diff --git a/.tmux.conf b/files/.tmux.conf similarity index 100% rename from .tmux.conf rename to files/.tmux.conf diff --git a/setup.sh b/setup.sh index 0b880fc..0de45d3 100644 --- a/setup.sh +++ b/setup.sh @@ -1,38 +1,40 @@ #!/bin/bash # 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 -ln ./.bash* ../../ -ln ./.profile ../../ +(cd ../.. ; rm $TODELETE) +(cd /root ; rm $TODELETE) -rm /root/.bashrc /root/.profile -cp .bashrc /root -cp .profile /root -cp ./nanorc /etc/nanorc +cp ./files/* /root +ln ./files/* ../../ -# changes PS1 prompts +# dotenv +if [ ! -f ../../.env ] ; then +cat << EOF >> ../../.env SERV_COLOR="32" +USER="" +EOF +fi source ./setenv.sh ## root PS1 RED="01;31m" 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;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ ' EOF ## user PS1 GREEN="01;32m" 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;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ ' 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 - echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user fi - -echo "Install fzf, log out and log back in" diff --git a/.bash_fzf b/source/.bash_fzf similarity index 100% rename from .bash_fzf rename to source/.bash_fzf diff --git a/.colors b/source/.colors similarity index 100% rename from .colors rename to source/.colors