dotfiles
Cameron's Dotfiles
Mainly for my use, but it just has my vimrc and some basic bash functions
Vim Keybindings
Tools are configured for vim style keybinding.
Setup
- Clone dotfiles: 'git clone https://github.com/durhc427/dotfiles.git ~/dotfiles'
- Install dotfiles: 'cd ~/dotfiles && ./install_dotfiles.sh
- Install nvim (instructions coming)
- Install packages:
pip install --user neovimsudo pacman -S exuberant-ctagssudo pacman -S tmuxsudo pacman -S zshsudo pacman -S zathurasudo pacman -S zathura-pdf-popplersudo pacman -S texlivesudo packan -S termitesudo packan -S gvimsudo packan -S rtorrent- Install AUR Packages [with yay]:
- siji-git
- [other font package for termite I cannot remember!]
- Install Vim plugins: ':PlugClean' and ':PlugUpgrade' and ':PlugUpdate'
Arch Linux Install and Dotfiles Setup [UEFI]
Download
- Download and write arch iso to USB with dd:
sudo dd if=</path/to/archlinux-20xx.xx.xx-x86_64.iso> of=</dev/sdx>example:
sudo dd if=<~/Downloads/archlinux-2018.12.01-x86_64.iso> of=</dev/sdb>
Boot
-
Boot from USB (check your boot priority choices in boot sequence!)
-
Connect to the internet
wifimenuordhclient -v -
Check internet connection
ping archlinux.org -
Update the system clock and enable network time:
timedatectl set-ntp true
Check service status using timedatectl status
Partition
-
Partition the disks using fdisk or parted:
fdisk /dev/sdxCheck devices usinglsblkorfdisk -l(ignore results ending inrom,loop, orairoot -
Required for devices with UEFI enabled:
- Partition for root directory:
/ - EFI system partition
- example for UEFI with GPT:
- Mount Point , Partition , Partition type , Suggested size
/boot, /dev/sdx1 , EFI System , 260-512 M[SWAP], /dev/sdx2 , Linux swap , More than 512M, generally 2 x/, /dev/sdx3 , Linux , 20-30G/home, /dev/sdx4 , Linux , Remainder of device
Format
- Format the partitions, for example:
- formatting the EFI system
mkfs.fat -F32 /dev/sda1 - formatting the swap partition
mkswap /dev/sda2 swapon /dev/sda2 - formatting the Linux filesystems for root and home (if you have one)
mkfs.ext4 /dev/sda3 mkfs.ext4 /dev/sda4
- formatting the EFI system
Mount the Filesystems
- Mount root partition
mount /dev/sda3 /mnt - Mount home partition
mkdir /mnt/home mount dev/sda4 /mnt/home - Mount boot partition
mkdir /mnt/boot mount /dev/sda1 /mnt/boot
Install Base system
pacstrap /mnt base base-devel vim git networkmanager
Configure the system
- Generate an fstab file:
genfstab -U /mnt >> /mnt/etc/fstab
- Change root into the new system
arch-chroot /mnt
- Set time zone:
ln -sf /usr/share/zoneinfo/<Region>/<City> /etc/localtime
- Run hwclock(8) to generate /etc/adjtime:
hwclock --systohc
- Uncomment en_US.UTF-8 UTF-8 and other needed locales in /etc/locale.gen, and generate them with:
locale-gen
- Set the LANG variable in locale.conf(5) accordingly, for example:
/etc/locale.conf
----------------
LANG=en_US.UTF-8
- Create the hostname file:
/etc/hostname
-------------
<myhostname>
- Add matching entries to hosts(5)
/etc/hosts
----------------------------------------------
127.0.0.1 localhost
::1 localhost
127.0.1.1 <myhostname>.localdomain <myhostname>
- Set root password
passwd
Post Install
-
Login as root
-
Add non-root user
useradd -m -g users -G wheel -s /bin/bash <normie_user>
- Create password for user
passwd <normie_user>
- Set editor:
EDITOR=vim visudo
-
Look for and uncomment
%wheel ALL=(ALL) ALL -
Log in as user
Install necessary packages
- Install (not sure if this is all in base-devel)
pacman -S pulseaudio pulseaudio-alsa xorg-xinit xorg-server bspwm sxhkd libxcb xcb-util xcb-util-keysyms xcb-util-wm termite dmenu noto-fonts python pip-python zsh gvim openssh
- Font confusion? Set fonts manually in
~/.config/fontsconfig/fonts.conf
Setup window manager
-
source: https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies
-
Important: Make sure your environment variable
$XDG_CONFIG_HOMEis set or your bspwmrc will not be found. This can be done by addingXDG_CONFIG_HOME="$HOME/.config"and exportXDG_CONFIG_HOMEto your~/.profile. -
Copy
/usr/share/doc/bspwm/examples/bspwmrcto~/.config/bspwm/bspwmrcand run
chmod +x ~/.config/bspwm/bspwmrc
- Copy
/usr/share/doc/bspwm/examples/sxhkdrcto~/.config/sxhkd/sxhkdrc. example:
mkdir ~/.config && mkdir ~/.config/bspwm && mkdir ~/.config/sxhkd
cd /usr/share/doc/bspwm/examples/
cp bspwmrc ~/.config/bspwm/ && sxkhdrc ~/.config/sxkhd/
Look at this file and learn the key bindings. Change any bindings you don't like. For instance, I prefer using alt over super (windows key). Change the line at 84 to match your preferred terminal editor (change to termite )
- Open up
~/.xinitrcand add the following to the bottom:
sxhkd &
exec bspwm
- Test new configuration
Run
startxand pressSuper + Enter. A grey terminal should appear.
Install dotfiles
- Clone this repo
git clone https://github.com/durhc427/dotfiles.git
-
Install dotfiles: 'cd ~/dotfiles && ./install_dotfiles.sh
-
Install Vim plugins: ':PlugClean' and ':PlugUpgrade' and ':PlugUpdate'
Install yay (AUR Package Manager)
- detailed usage and examples: https://github.com/Jguer/yay#examples-of-custom-operations
mkdir build && cd build
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
- Install a package in yay
yay -S <package-name>
For example:
yay -S polybar
Setup SSH with github
NOTE: my dotfiles already include a git default setup with my email address, you should change this to yours
Set defaults
- Run the command to generate an SSH key, replacing Tommy Trojan's email with your own:
ssh-keygen -t rsa -b 2048 -C "ttrojan@usc.edu"
-
When prompted for a file location, use the default location (press Enter).
-
Upon success, you should receive a confirmation such as:
Your identification has been saved in /home/cs104/.ssh/id_rsa.
Your public key has been saved in /home/cs104/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:vC+4OG2u1PIeE0OKX9jiFFHuLnkYCBSsvIW8ybD873H ttrojan@usc.edu
The key's randomart image is:
+---[RSA 2048]----+
| ++o. |
| S+.o *.* |
| +.X. o |
| 0. o + |
| ..o E . |
| .=S. . + .0 |
| .*=* ... |
|.+.=o*. .. *o* |
| .++*oo. .. |
+----[SHA256]-----+
- Set git defaults:
git config --global user.name "Tommy Trojan"
git config --global user.email "ttrojan@usc.edu"
git config --global color.ui auto
git config --global core.editor vim
git config --global core.autocrlf input
git config --global push.default simple
- Check your work:
git config --list
You should see something like this:
user.name=Tommy Trojan
user.email=ttrojan@usc.edu
color.ui=auto
core.editor=subl -n -w
core.autocrlf=input
push.default=simple
Add key to github page
-
Click on Add SSH Key
-
Provide a name for the key, such as "CS104 VM Key", "MacBook Key" or "aludra Key"
-
Display the contents of your id_rsa.pub file by typing the following command at the terminal prompt.
cat ~/.ssh/id_rsa.pub
-
Copy the contents of your id_rsa.pub file and paste them into the key field. Make sure you copy the entire contents of the id_rsa.pub file. It should start with ssh-rsa and end with your email address.
-
Click Add Key
Thinkpad x240 Setup
Issues with trackpad upgraded to 3-button trackpad. http://diy.mironto.sk/thinkpad-x240-replacing-touchpad-and-keyboard/
- Remove default synaptics driver:
sudo pacman -R xf86-input-synaptics- Remove any synaptics.conf files in
/etc/X11/xorg.conf.d/ - Add the following touchpad configuration file in
/etc/X11/xorg.conf.d/:
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
MatchIsTouchpad "on"
Option "Tapping" "on"
Option "TappingButtonMap" "lmr"
EndSection