Skip to content

Instantly share code, notes, and snippets.

@vwood
Last active May 10, 2022 01:28
Show Gist options
  • Save vwood/187779161b7ba5909195f2aabd9f74c7 to your computer and use it in GitHub Desktop.
Save vwood/187779161b7ba5909195f2aabd9f74c7 to your computer and use it in GitHub Desktop.
Setup new ubuntu machine (20.04)
#!/bin/bash
#
# New machine setup for UBUNTU
#
# fixes bad defaults, and installs base packages
#
gsettings set org.gnome.shell.extensions.desktop-icons show-home false
gsettings set org.gnome.shell.extensions.desktop-icons show-trash false
gsettings set org.gnome.desktop.wm.preferences audible-bell false
# Porque nolos dos?
sudo apt install vim emacs
sudo apt install fonts-ricty-diminished htop lm-sensors build-essential python-is-python3 python3-distutils python3-dev
# This annoying thing causes GUI popups for command utilities, despite never using it.
sudo apt remove gnome-keyring
# Capslock -> Ctrl
sudo sed -i -e 's/XKBOPTIONS=""/XKBOPTIONS="ctrl:nocaps"/' /etc/default/keyboard
setxkbmap -option ctrl:nocaps
git clone https://github.com/vwood/.emacs.d.git
# Fix XDG directory spam
xdg-user-dirs-update --set TEMPLATES ~/Downloads
rmdir ~/Templates
mkdir ~/.xdgtrash
xdg-user-dirs-update --set PUBLICSHARE ~/.xdgtrash
rmdir ~/Public
xdg-user-dirs-update --set DOCUMENTS ~/Downloads
rmdir ~/Documents
xdg-user-dirs-update --set MUSIC ~/Downloads
rmdir ~/Music
xdg-user-dirs-update --set PICTURES ~/Downloads
rmdir ~/Picture
xdg-user-dirs-update --set VIDEOS ~/Downloads
rmdir ~/Videos
mkdir ~/workspace
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ next-tab '<Primary>Tab'
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ prev-tab '<Primary><Shift>Tab'
# Remove the binding to <Alt>Space which shadows readline binding
gsettings set org.gnome.desktop.wm.keybindings activate-window-menu []
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
# Somehow gnome found the worst of both worlds solution to focus-stealing:
# instead of having a launched application steal focus, a notification saying the application has
# launched steals focus instead.
gsettings set org.gnome.desktop.notifications show-banners false
# Custom keybindings
# <Super>T launch new terminal window
# <Super>E launch new emacs window
# <Super>F launch new firefox window
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/']"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'launch-term'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command 'gnome-terminal'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding '<Super>T'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name 'launch-emacs'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command 'emacs'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding '<Super>E'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ name 'launch-browser'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ command 'firefox'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding '<Super>F'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment