Skip to content

Instantly share code, notes, and snippets.

@xvzftube
Last active March 15, 2023 22:01
Show Gist options
  • Save xvzftube/9d798b3bc7b2ba7d935f48a61ee6a3f7 to your computer and use it in GitHub Desktop.
Save xvzftube/9d798b3bc7b2ba7d935f48a61ee6a3f7 to your computer and use it in GitHub Desktop.
dwm setup
#!/bin/sh
# License: GNU GPLv3
sudo apt-get update && sudo apt-get upgrade -y
# assumes no desktop environment -- must install Xorg things
sudo apt-get --no-install-recommends install xserver-xorg xserver-xorg-video-fbdev \
xinit pciutils xinput xfonts-100dpi xfonts-75dpi xfonts-scalable libx11-dev libxft-dev libxinerama-dev xorg-dev -y
# install other common utils
sudo apt-get install build-essential curl neovim make tmux git python3-pip neofetch stow -y
# R section inspired by https://cran.r-project.org/bin/linux/debian/
# R - dependencies necessary to add a new repository over HTTPS (CRAN GPG depends on these)
sudo apt-get install dirmngr apt-transport-https ca-certificates software-properties-common gnupg2
# R - Add the CRAN GPG key and enable the CRAN repository by adding to /etc/apt/sources.list
sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
sudo add-apt-repository 'deb http://cloud.r-project.org/bin/linux/debian buster-cran40/'
sudo apt update
sudo apt install -t buster-cran40 r-base
sudo apt install r-base-dev r-cran-tidyverse
# OpenBlas library to get higher performance for linear algebra operations
sudo libopenblas-base -y
# make a home for init.vim
mkdir -p dotfiles/nvim/.config/nvim/
wget -O dotfiles/nvim/.config/nvim/init.vim https://gist.githubusercontent.com/xvzftube/5380163d8fc9090796eb6fcc61fe022d/raw/fd03d77226a52da1fc9017e82873a26c35f8f199/init.vim
# fancy font
cd /usr/share/fonts/
sudo git clone https://github.com/adobe-fonts/source-code-pro.git
cd
sudo fc-cache -fv
# install st and set font. If something goes wrong delete config.h and try again manually.
git clone https://git.suckless.org/st
cd st
sed -i '7 a static char *font = "Source Code Pro:pixelsize=16:antialias=true:autohint=true";' config.def.h
sed -i '9d' config.def.h
sudo make install
cd
# install dwm
git clone https://git.suckless.org/dwm
cd dwm
sed -i '9 a static const char *fonts[] = { "Source Code Pro:size=12" };' config.def.h
sed -i '10 a static const char dmenufont[] = "Source Code Pro:size=12";' config.def.h
sed -i '8d' config.def.h
sed -i '8d' config.def.h
sudo make install
cd
# install dmenu and set font
git clone https://git.suckless.org/dmenu
cd dmenu
sed -i '6 a "Source Code Pro:size=12"' config.def.h
sed -i '8d' config.def.h
sudo make install
cd
# vimplug
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
# jedi is an autocomplete library. Very nice for vim.
pip3 install jedi flake8 isort pynvim black
# stow configs
cd dotfiles
stow nvim
cd
# get xsession ready to go
touch ~/.xsession
echo '#!/bin/sh' >> ~/.xsession
echo 'xterm &' >> ~/.xsession
echo 'exec dwm' >> ~/.xsession
# install a browser
sudo apt install firefox-esr -y
# instructions:
# startx # to get into dwm
# Alt-Shift-Enter # to open st
# Alt-Shift-c # to close a window
# Alt-p # start dmenu application launcher
# nvim into dotfiles/nvim/.config/nvim and run :PlugInstall # to install all vim packages
@xvzftube
Copy link
Author

xvzftube commented Dec 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment