-
Notifications
You must be signed in to change notification settings - Fork 0
/
new-machine.sh
63 lines (52 loc) · 1.74 KB
/
new-machine.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
###################################
# new-machine.sh
# Quick and dirty script to populate my stuff on a new Ubuntu/Debian machine
###################################
## Install: curl
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/Eeemil/dotfiles/master/new-machine.sh)"
## Install: wget
# sh -c "$(wget https://raw.githubusercontent.com/Eeemil/dotfiles/master/new-machine.sh -O -)"
syncpath=${1:-'[email protected]:~/sync'}
echo "Downloading dotfiles and ssh synckey"
sudo apt install rsync
rsync -Lr --progress $syncpath $HOME/
echo "Adding synckey to ssh-agent"
pushd $HOME
mkdir .ssh
chmod 700 .ssh
ln -s $HOME/sync/.ssh/id_rsa_synckey .ssh/
ln -s $HOME/sync/.ssh/id_rsa_synckey.pub .ssh/
eval "$(ssh-agent -s)"
ssh-add $HOME/.ssh/id_rsa_synckey
echo "Adding synckey to authorized keys"
cat $HOME/.ssh/id_rsa_synckey.pub >> $HOME/.ssh/authorized_keys
echo "Adding and deploying dotfiles"
ln -s $HOME/sync/dotfiles dotfiles
$HOME/dotfiles/deploy.sh
echo "Installing git and zsh"
# Install git and zsh
sudo apt update
sudo apt install -y git zsh
# Install emacs without graphical support
if hash emacs 2>/dev/null; then
echo "Installing emacs without graphical support"
sudo apt install -y emacs2.-nox
fi
echo "Upgrading packages"
sudo apt upgrade -y
echo "Changing shell to zsh"
if [ $(which zsh) ]; then
sudo usermod -s $(which zsh) $(whoami)
fi
echo "Installing font(s)"
mkdir -p ~/.local/share/fonts
sudo apt install curl
popd
pushd ~/.local/share/fonts
curl -fLo "Shure Tech Mono for Powerline Nerd Font Complete.ttf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/ShareTechMono/complete/Shure%20Tech%20Mono%20Nerd%20Font%20Complete.ttf
popd
pushd gnome-settings
echo "Configuring gnome"
./load-settings.sh
popd