dotfiles/setup.sh

25 lines
610 B
Bash
Raw Normal View History

2023-06-12 14:30:20 -04:00
#!/usr/bin/env bash
2023-01-22 14:23:01 -05:00
# updates all dotfiles on the system
2023-02-04 00:50:10 -05:00
TODELETE="$(command ls --almost-all files) .PS1"
2022-12-17 12:37:42 -05:00
2023-02-04 00:50:10 -05:00
(cd ../.. ; rm $TODELETE)
(cd /root ; rm $TODELETE)
2022-12-17 12:42:26 -05:00
2023-02-04 01:09:29 -05:00
cp -r ./files/. /root
2023-02-05 14:08:31 -05:00
for f in ./files/.*; do if [[ -f $f ]]; then ln ./$f ../../ ; fi; done
2023-01-22 14:23:01 -05:00
2023-01-22 14:37:41 -05:00
source ./setenv.sh
2022-12-17 12:42:26 -05:00
2023-01-22 14:23:01 -05:00
## root PS1
RED="01;31m"
cat << EOF >> /root/.PS1
2023-01-23 15:01:50 -05:00
PS1='\[\033[$RED\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
2022-12-17 01:22:43 -05:00
EOF
2023-03-19 17:31:43 -04:00
## user PS1 # TODO? put in getenv
2023-01-22 14:23:01 -05:00
GREEN="01;32m"
2023-01-22 14:37:41 -05:00
cat << EOF >> ../../.PS1
2023-01-23 15:01:50 -05:00
PS1='\[\033[$GREEN\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
2023-01-22 14:23:01 -05:00
EOF