This commit is contained in:
Inhji 2023-09-06 07:12:30 +02:00
commit f642700fe4
12 changed files with 145 additions and 36 deletions

5
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "dotbot"]
path = dotbot
path = submodules/dotbot
url = https://github.com/anishathalye/dotbot
[submodule "fisher"]
path = submodules/fisher
url = https://github.com/jorgebucaran/fisher

View File

@ -16,12 +16,10 @@ pacman -S fish git curl
# Do the dance
git clone https://git.inhji.de/inhji/dotfiles.git .dotfiles
# Normal desktop
# Base install, rn installs only fish
~/.dotfiles/install
# If installing on MNT Reform
~/.dotfiles/install -c install-reform.conf.yaml
# If installing on a headless server
~/.dotfiles/install -c install-headless.conf.yaml
# Switch shells
chsh -s /usr/bin/fish
@ -31,15 +29,8 @@ Install fisher
----------------
```bash
# Debian/Ubuntu
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
# Arch Linux
yay -S fisher
# Now install plugins
fisher install pure-fish/pure
fisher install jethrokuan/z
# Temporarily load fisher and then install all plugins in fish_plugins
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher update
```
Tips

View File

@ -2,6 +2,7 @@
set -x -U GOPATH $HOME/.go
set PATH $PATH $HOME/.local/bin $HOME/.mix $HOME/.mix/escripts $HOME/.cargo/bin $GOPATH/bin
## Variables
set DOTFILES $HOME/.dotfiles
set NOTES $HOME/Documents/Sync/Notes/MyVault
set TERMINAL 'alacritty'
@ -10,14 +11,11 @@ set -gx EDITOR 'nano'
alias r='source ~/.config/fish/config.fish && echo "Fish config reloaded."'
if test -e /usr/bin/lsd
alias ls="lsd"
alias ll="lsd -lh"
alias la="lsd -A"
else
alias ls="ls"
alias ll="ls -lh"
alias la="ls -A"
## Environment setup
# Apply .profile: use this to put fish compatible .profile stuff in
if test -f ~/.fish_profile
source ~/.fish_profile
end
if test -d $HOME/.asdf
@ -27,8 +25,47 @@ end
alias up="sudo apt update && sudo apt list --upgradable"
alias ug="sudo apt upgrade"
# Hide welcome message
set fish_greeting
set VIRTUAL_ENV_DISABLE_PROMPT "1"
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
## Functions
function backup --argument filename
cp $filename $filename.bak
end
## Useful aliases
# Reload fish config
alias r='clear && source ~/.config/fish/config.fish'
# Nicer ls if nothing els is available
alias ls="ls"
alias ll="ls -lh"
alias la="ls -A"
alias lt="ls -ald .*"
# Replace ls with exa
if test -e /usr/bin/exa
alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs
alias ll='exa -l --color=always --group-directories-first --icons' # long format
alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
alias l.='exa -ald --color=always --group-directories-first --icons .*' # show only dotfiles
end
# Add apt aliases for updating / upgrading if available
if test -e (whereis apt)
alias up="sudo apt update && sudo apt list --upgradable"
alias ug="sudo apt upgrade"
end
# Elixir / phoenix aliases
alias phx="iex -S mix phx.server"
# Systemd alias
alias start="sudo systemctl start"
alias restart="sudo systemctl restart"
alias stop="sudo systemctl stop"
@ -36,11 +73,31 @@ alias enable="sudo systemctl enable"
alias disable="sudo systemctl disable"
alias sta="sudo systemctl status"
alias dot="hx $DOTFILES"
alias notes="hx $NOTES"
## Helpers
# Generate SSH key
alias sshkey='ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 -C "(whoami)@(hostname)-(date +'%y%m%d')"'
# Get the error messages from journalctl
alias jctl="journalctl -p 3 -xb"
# Recent installed packages
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
# Cleanup orphaned packages
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
alias cal="ncal -3Mb"
if status is-interactive
# Commands to run in interactive sessions can go here
end
## Load asdf if available
if test -e ~/.asdf/asdf.fish
source ~/.asdf/asdf.fish
end
## Run fastfetch if session is interactive
if status --is-interactive && type -q fastfetch
fastfetch --load-config neofetch
end

View File

@ -0,0 +1,44 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR ZO_CMD:zo
SETUVAR Z_CMD:z
SETUVAR Z_DATA:/home/inhji/\x2elocal/share/z/data
SETUVAR Z_DATA_DIR:/home/inhji/\x2elocal/share/z
SETUVAR Z_EXCLUDE:\x5e/home/inhji\x24
SETUVAR __fish_initialized:3400
SETUVAR _fisher_danhper_2F_fish_2D_ssh_2D_agent_files:\x7e/\x2econfig/fish/functions/__ssh_agent_is_started\x2efish\x1e\x7e/\x2econfig/fish/functions/__ssh_agent_start\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fish\x2dssh\x2dagent\x2efish
SETUVAR _fisher_franciscolourenco_2F_done_files:\x7e/\x2econfig/fish/conf\x2ed/done\x2efish
SETUVAR _fisher_jethrokuan_2F_z_files:\x7e/\x2econfig/fish/functions/__z\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_add\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_clean\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_complete\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/z\x2efish
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
SETUVAR _fisher_jorgebucaran_2F_hydro_files:\x7e/\x2econfig/fish/functions/fish_mode_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_prompt\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/hydro\x2efish
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejethrokuan/z\x1efranciscolourenco/done\x1ejorgebucaran/hydro\x1edanhper/fish\x2dssh\x2dagent
SETUVAR _fisher_upgraded_to_4_4:\x1d
SETUVAR _hydro_git_58137:main\u2022\x20
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:blue
SETUVAR fish_color_comment:red
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:green
SETUVAR fish_color_error:brred
SETUVAR fish_color_escape:brcyan
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:brcyan
SETUVAR fish_color_param:cyan
SETUVAR fish_color_quote:yellow
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr

View File

@ -5,4 +5,6 @@
[core]
excludesfile = ~/.gitignore
[init]
defaultBranch = main
defaultBranch = main
[pull]
ff = true

View File

@ -1,2 +0,0 @@
# Postinstall for MNT Reform

View File

@ -3,7 +3,7 @@
set -e
CONFIG="install.conf.yaml"
DOTBOT_DIR="dotbot"
DOTBOT_DIR="submodules/dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

View File

@ -1,9 +0,0 @@
- shell:
- [git submodule update --init --recursive, Updating submodules]
- create:
- ~/.config
- ~/.config/fish
- link:
~/.config/fish/config.fish: config/fish/config.fish

19
install.conf.yaml Normal file
View File

@ -0,0 +1,19 @@
- shell:
- [git submodule update --init --recursive, Updating submodules]
- create:
- ~/.config
- ~/.config/fish
- link:
~/.gitconfig: config/git/gitconfig
~/.gitignore: config/git/gitignore
~/.ssh/config: config/ssh/config
~/.config/fish:
glob: true
path: config/fish/*
- shell:
-
command: ./scripts/fisher.sh
stdout: true

3
scripts/fisher.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env fish
source ./submodules/fisher/functions/fisher.fish
fisher update

1
submodules/fisher Submodule

@ -0,0 +1 @@
Subproject commit ed7c28ea78515bebd368da3374db00dd5077afd5