Skip to content

Instantly share code, notes, and snippets.

@Shou
Last active May 20, 2019 10:06
Show Gist options
  • Save Shou/edd305027bbaa9fe1f8fa36eba3ca6b9 to your computer and use it in GitHub Desktop.
Save Shou/edd305027bbaa9fe1f8fa36eba3ca6b9 to your computer and use it in GitHub Desktop.
My Ubuntu setup script
echo "Making dev directories"
mkdir -p ~/Prog ~/Build ~/.config/fish ~/.ghc
echo "Apt: installing dev tools+libs"
sudo apt update
sudo apt install -y curl git libfreetype6-dev libfontconfig1-dev \
xclip apt-transport-https ca-certificates software-properties-common libgmp3-dev
sudo usermod -a -G docker $USER
echo "Apt: installing Firefox" # we can probably install this with nix
sudo apt-add-repository ppa:mozillateam/firefox-next -y
sudo apt upgrade -y
sudo apt dist-upgrade -y &
echo "Installing Nix: the 'purely functional package manager'"
curl https://nixos.org/nix/install | sh
. /home/benedict/.nix-profile/etc/profile.d/nix.sh
echo "Nix: installing Fish, Neovim, Tmux, Rust, Haskell (stack), Idris"
nix-env -i fish neovim tmux rustc cargo cmake stack ripgrep fd idris bat docker docker-compose &
wait # here because Apt is garbage
echo "Installing GNOME session"
sudo apt install -y gnome-session gdm3 &
echo "Setup Neovim: installing Plug, plugin manager for [Neo]vim"
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim &
echo "TODO: we should pull a Neovim init file with plugins here"
echo "Building and installing Alacritty: 'a cross-platform, GPU-accelerated terminal emulator'"
git clone https://github.com/jwilm/alacritty.git ~/Build/alacritty
cd ~/Build/alacritty
cargo build --release
sudo cp target/release/alacritty /usr/local/bin
sudo desktop-file-install alacritty.desktop
sudo update-desktop-database
cd ~
wait # again! wow
echo "Ensuring dependencies are installed"
sudo apt install -f
echo "Downloading dotfiles: Tmux, Fish, GHCi"
curl https://raw.githubusercontent.com/Shou/dotfiles/master/.tmux.conf -o ~/.tmux.conf &
curl https://raw.githubusercontent.com/Shou/dotfiles/master/.config/fish/config.fish -o ~/.config/fish/config.fish &
curl https://raw.githubusercontent.com/Shou/dotfiles/master/.ghc/ghci.conf -o ~/.ghc/ghci.conf &
echo "Configure GNOME 3"
dconf write /org/gnome/desktop/interface/clock-show-seconds true
dconf write /org/gnome/desktop/calendar/show-weekdate true
dconf write /org/gnome/desktop/interface/clock-show-date true
dconf write /org/gnome/desktop/wm/preferences/resize-with-right-button true
dconf write /org/gnome/desktop/wm/keybindings/close "['<Super>c']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-down "['<Super>j']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-up "['<Super>k']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-down "['<Super><Shift>j']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-up "['<Super><Shift>k']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-1 "['<Super>1']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-2 "['<Super>2']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-3 "['<Super>3']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-4 "['<Super>4']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-5 "['<Super>5']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-6 "['<Super>6']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-7 "['<Super>7']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-8 "['<Super>8']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-9 "['<Super>9']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-1 "['<Super><Shift>1']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-2 "['<Super><Shift>2']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-3 "['<Super><Shift>3']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-4 "['<Super><Shift>4']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-5 "['<Super><Shift>5']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-6 "['<Super><Shift>6']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-7 "['<Super><Shift>7']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-8 "['<Super><Shift>8']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-9 "['<Super><Shift>9']"
echo "Setting shell to Fish"
sudo chsh -s /usr/bin/fish $USER
echo "Installing Oh My Fish: 'The Fishshell Framework'"
curl -L https://get.oh-my.fish | fish
echo "Installing Fisherman: plugin manager for Fish"
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs https://git.io/fisher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment