setup.sh (1484B)
1 #!/bin/sh 2 3 if [ ! -x "$(command -v git)" ]; then 4 echo "Please install git first, then re-run this script." 5 exit 1 6 fi 7 8 chmod 700 ~ 9 10 # Remove stuff OpenBSD adds by default that I don't need 11 rm -f ~/.cshrc ~/.cvsrc ~/.login ~/.mailrc ~/.Xdefaults ~/.profile 12 13 # Remove stuff Linux adds by default that I don't need 14 rm -f ~/.bash* 15 16 # Create directory structure 17 mkdir -p \ 18 ~/Documents/Projects \ 19 ~/Music \ 20 ~/Pictures \ 21 ~/Downloads \ 22 ~/.ssh 23 24 # Grab latest dotfiles and apply them to the system 25 git clone git://git.paritybit.ca/dotfiles ~/Documents/Projects/dotfiles 26 cd ~/Documents/Projects/dotfiles 27 28 for file in .????*; do 29 cp -r "$file" ~ 30 done 31 32 # Xenodm config (this'll just error out on Linux) 33 doas cp xenodm.Xresources /etc/X11/xenodm/Xresources 34 doas cp xenodm.Xsetup_0 /etc/X11/xenodm/Xsetup_0 35 36 # Install packages 37 if [ ! -x "$(command -v pkg_add)" ]; then 38 echo "Looks like this isn't an OpenBSD machine; not auto-installing packages." 39 echo "Consider installing equivalents to these:" 40 printf "%s\n" "$(cat pkglist | tr -d '-' | tr '\n' ' ')" 41 else 42 echo "Installing packages, you might want to grab a cup of tea..." 43 doas pkg_add -l ~/Documents/Projects/dotfiles/pkglist 44 set -x 45 doas ln -s /usr/bin/openrsync /usr/bin/rsync 46 doas ln -s /usr/local/bin/uctags /usr/local/bin/ctags 47 set - 48 echo "Done!" 49 fi 50 51 echo "Don't forget to enable obsdfreqd and apmd if on a laptop." 52 echo "Add 'pkill xmessage' to /etc/X11/xenodm/GiveConsole and tweak pixel offsets for current resolution."