This commit is contained in:
David Heinemeier Hansson 2024-05-25 13:52:00 -07:00
commit 8353d5986e
21 changed files with 342 additions and 0 deletions

0
README.md Normal file
View File

52
dotfiles/.bashrc Normal file
View File

@ -0,0 +1,52 @@
# Setup history
shopt -s histappend
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
force_color_prompt=yes
color_prompt=yes
PS1=$'\uf0a9 '
PS1="\[\e]0;\w\a\]$PS1"
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
export PATH="./bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin"
export EDITOR="nvim"
set +h
alias ls='eza -lh --group-directories-first --icons'
alias lt='eza --tree --level=2 --long --icons --git'
alias ff="fzf --preview 'batcat --style=numbers --color=always {}'"
alias spfy='spotify --force-device-scale-factor=1.5'
alias r='./bin/rails'
alias n='nvim'
alias g='git'
alias d='docker'
alias gcm='git commit -m'
alias gcam='git commit -a -m'
alias gcad='git commit -a --amend'
alias load-dconf='cat ~/.config/gnome-settings.ini | dconf load /'
export KAMAL_REGISTRY_PASSWORD="dckr_pat_1-VLgNpkPxENCjLuZSS6AM-zfD4"
export HAYSTACK_GLOBAL_DATABASE_VERSION=8
eval "$(/usr/bin/rbenv init - bash)"
eval "$(nodenv init -)"
eval "$(zoxide init bash)"
export PATH=$PATH:/home/dhh/.spicetify

View File

@ -0,0 +1,47 @@
[env]
TERM = "xterm-256color"
[window]
padding.x = 16
padding.y = 14
decorations = "none"
[font]
normal = { family = "CaskaydiaMono Nerd Font", style = "Regular" }
size = 9
[keyboard]
bindings = [
{ key = "F11", action = "ToggleFullscreen" }
]
[colors]
[colors.primary]
background = '#1a1b26'
foreground = '#a9b1d6'
# Normal colors
[colors.normal]
black = '#32344a'
red = '#f7768e'
green = '#9ece6a'
yellow = '#e0af68'
blue = '#7aa2f7'
magenta = '#ad8ee6'
cyan = '#449dab'
white = '#787c99'
# Bright colors
[colors.bright]
black = '#444b6a'
red = '#ff7a93'
green = '#b9f27c'
yellow = '#ff9e64'
blue = '#7da6ff'
magenta = '#bb9af7'
cyan = '#0db9d7'
white = '#acb0d0'
[colors.selection]
background = '#7aa2f7'

16
dotfiles/aliases Normal file
View File

@ -0,0 +1,16 @@
# File system
alias ls='eza -lh --group-directories-first --icons'
alias lt='eza --tree --level=2 --long --icons --git'
alias ff="fzf --preview 'batcat --style=numbers --color=always {}'"
# Tools
alias n='nvim'
alias g='git'
alias d='docker'
alias bat='batcat'
# Git
alias gcm='git commit -m'
alias gcam='git commit -a -m'
alias gcad='git commit -a --amend'

30
dotfiles/bashrc Normal file
View File

@ -0,0 +1,30 @@
# History control
shopt -s histappend
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
# Autocompletion
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# Prefer current-directory bins
export PATH="./bin:$PATH"
set +h
# Load configuration first from omabox, then local overwrites
for file in ~/.{prompt,exports,aliases}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file"
[ -r "$file.local" ] && [ -f "$file.local" ] && source "$file.local"
done
unset file
# Run iniitializers
eval "$(rbenv init - bash)"
eval "$(nodenv init -)"
eval "$(zoxide init bash)"

44
dotfiles/inputrc Normal file
View File

@ -0,0 +1,44 @@
set meta-flag on
set input-meta on
set output-meta on
set convert-meta off
set completion-ignore-case on
set completion-prefix-display-length 2
set show-all-if-ambiguous on
set show-all-if-unmodified on
# Arrow keys match what you've typed so far against your command history
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories on
# Do not autocomplete hidden files unless the pattern explicitly begins with a dot
set match-hidden-files off
# Show all autocomplete results at once
set page-completions off
# If there are more than 200 possible completions for a word, ask to show them all
set completion-query-items 200
# Show extra file information when completing, like `ls -F` does
set visible-stats on
$if Bash
# Be more intelligent when autocompleting by also looking at the text after
# the cursor. For example, when the current line is "cd ~/src/mozil", and
# the cursor is on the "z", pressing Tab will not autocomplete it to "cd
# ~/src/mozillail", but to "cd ~/src/mozilla". (This is supported by the
# Readline used by Bash 4.)
set skip-completed-text on
# Coloring for Bash 4 tab completions.
set colored-stats on
$endif
# End with local overrides
$include ~/.inputrc.local

5
dotfiles/prompt Normal file
View File

@ -0,0 +1,5 @@
force_color_prompt=yes
color_prompt=yes
PS1=$'\uf0a9 '
PS1="\[\e]0;\w\a\]$PS1"

View File

@ -0,0 +1,35 @@
themes {
tokyo-night {
fg 169 177 214
bg 26 27 38
black 56 62 90
red 249 51 87
green 158 206 106
yellow 224 175 104
blue 122 162 247
magenta 187 154 247
cyan 42 195 222
white 192 202 245
orange 255 158 100
}
}
theme "tokyo-night"
themes {
tokyo-night {
fg 169 177 214
bg 26 27 38
black 56 62 90
red 249 51 87
green 158 206 106
yellow 224 175 104
blue 122 162 247
magenta 187 154 247
cyan 42 195 222
white 192 202 245
orange 255 158 100
}
}
theme "tokyo-night"
default_layout "compact"

37
install.sh Normal file
View File

@ -0,0 +1,37 @@
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
# CLI apps
sudo apt install -y git curl fzf ripgrep bat eza zoxide btop
sudo snap install code zellij --classic
# GUI apps
sudo apt install xournalpp nautilus-dropbox alacritty
sudo snap install 1password spotify vlc zoom-client signal-desktop pinta
# Installers
source install/gnome-tailoring.sh
source install/chrome.sh
source install/fonts.sh
source install/ulauncher.sh
source install/neovim.sh
source install/lazygit.sh
source install/lazydocker.sh
source install/ruby.sh
source install/nodenv.sh
source install/gh.sh
source install/docker.sh
# Configuration
# Start
gh auth login
docker run -d --restart unless-stopped -p 3306:3306 --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8
docker run -d --restart unless-stopped -p 6379:6379 --name=redis redis

5
install/chrome.sh Normal file
View File

@ -0,0 +1,5 @@
cd ~/Downloads
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
cd -

7
install/docker.sh Normal file
View File

@ -0,0 +1,7 @@
DOCKER_COMPOSE_VERSION="2.27.0"
sudo usermod -aG docker ${USER}
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v$DOCKER_COMPOSE_VERSION/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

8
install/fonts.sh Normal file
View File

@ -0,0 +1,8 @@
cd ~/Downloads
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/CascadiaMono.zip
unzip CascadiaMono.zip -d CascadiaFont
mkdir -p ~/.local/share/fonts
cp CascadiaFont/*.ttf ~/.local/share/fonts
rm -rf CascadiaMono.zip CascadiaFont
fc-cache
cd -

5
install/gh.sh Normal file
View File

@ -0,0 +1,5 @@
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg &&
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg &&
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null &&
sudo apt update &&
sudo apt install gh -y

View File

@ -0,0 +1,3 @@
sudo apt install -y gnome-tweak-tool gnome-shell-extension-manager
echo "Use Tweak Tool to set Fonts > Size > Scaling Factor: 0.80"
echo "Use Extension Manager to install: Tactile, Blur my Shell, Just Perfection"

7
install/lazydocker.sh Normal file
View File

@ -0,0 +1,7 @@
cd ~/Downloads
LAZYDOCKER_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazydocker/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz"
tar xf lazydocker.tar.gz lazydocker
sudo install lazydocker /usr/local/bin
rm lazydocker.tar.gz
cd -

7
install/lazygit.sh Normal file
View File

@ -0,0 +1,7 @@
cd ~/Downloads
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm lazygit.tar.gz
cd -

4
install/neovim.sh Normal file
View File

@ -0,0 +1,4 @@
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt update -y
sudo apt install -y neovim
git clone https://github.com/LazyVim/starter ~/.config/nvim

12
install/nodenv.sh Normal file
View File

@ -0,0 +1,12 @@
git clone https://github.com/nodenv/nodenv.git ~/.nodenv
sudo ln -vs ~/.nodenv/bin/nodenv /usr/local/bin/nodenv
cd ~/.nodenv
src/configure && make -C src || true
cd ~/
mkdir -p "$(nodenv root)"/plugins
git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
git clone https://github.com/nodenv/nodenv-aliases.git $(nodenv root)/plugins/nodenv-aliases
nodenv install 20.11.1
nodenv global 20.11.1
sudo ln -vs $(nodenv root)/shims/* /usr/local/bin/

5
install/ruby.sh Normal file
View File

@ -0,0 +1,5 @@
DEFAULT_RUBY_VERSION="3.3.1"
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
rbenv install $DEFAULT_RUBY_VERSION
rbenv global $DEFAULT_RUBY_VERSION

9
install/typora.sh Normal file
View File

@ -0,0 +1,9 @@
sudo snap install typora
cd ~/Downloads
git clone https://github.com/dhh/ia_typora
mkdir -p ~/.local/share/fonts
cp ia_typora/fonts/iAWriterMonoS-* ~/.local/share/fonts/
fc-cache
mkdir -p ~/snap/typora/88/.config/Typora/themes/
cp ia_typora/ia_typora*.css ~/snap/typora/88/.config/Typora/themes/
cd -

4
install/ulauncher.sh Normal file
View File

@ -0,0 +1,4 @@
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:agornostal/ulauncher -y
sudo apt update -y
sudo apt install -y ulauncher