Changed dot-config to .config
This commit is contained in:
parent
9ea93f8144
commit
0ab0f24015
118 changed files with 29 additions and 980 deletions
21
misc/.config/zsh/.zprofile
Normal file
21
misc/.config/zsh/.zprofile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Start gpg agent
|
||||
unset SSH_AGENT_PID
|
||||
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
||||
killall gpg-agent 2>/dev/null
|
||||
eval $(gpg-agent --daemon)
|
||||
|
||||
export PATH="$PATH:~/.local/share/cargo/bin/"
|
||||
export PATH="$PATH:$JAVA_HOME/bin/"
|
||||
|
||||
if [ ! -z "$(grep nixos /etc/os-release)" ]; then
|
||||
# NixOS does not explicitly link usr local bin
|
||||
# Yes I know I'm circumventing immutability.
|
||||
export PATH=/usr/local/bin:$PATH
|
||||
fi
|
||||
|
||||
|
||||
export PATH=~/.config/emacs/bin:$PATH
|
||||
export PATH=~/.local/bin/overrides:$PATH # Overriding /usr/bin/*
|
||||
export PATH=~/.local/bin:$PATH # Highest precedence to local bin
|
||||
|
||||
export PATH=sourced:$PATH # Flag to prevent setting PATH multiple times
|
||||
68
misc/.config/zsh/.zshenv
Normal file
68
misc/.config/zsh/.zshenv
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
#!/bin/zsh
|
||||
|
||||
# source /opt/miniconda3/etc/profile.d/conda.sh
|
||||
|
||||
if [ -z "$(printf $PATH | grep :sourced:)" ] && [ "$DISPLAY" = ":10.0" ]; then
|
||||
# zprofile does not get sourced when logging in through an xrdp session (for some reason), even
|
||||
# if I try to manually source it in ~/startwm.sh. This checks for if this is through xrdp (DISPLAY=:10.0)
|
||||
# and if the :sourced: flag exists in PATH.
|
||||
source ~/.config/zsh/.zprofile
|
||||
fi
|
||||
|
||||
# Below causes discord to not launch
|
||||
# export LIBVA_DRIVER_NAME=nvidia
|
||||
# export GBM_BACKEND=nvidia-drm
|
||||
# export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
|
||||
export BROWSER="$(which firefox)"
|
||||
export EDITOR="$(which nvim)"
|
||||
|
||||
export MANPAGER='nvim +Man! -c "ZenMode" -c "map q :qa!<CR>"'
|
||||
export PAGER=
|
||||
|
||||
# export GTK_THEME=gruvbox-dark
|
||||
export GTK_THEME=Adwaita:dark
|
||||
|
||||
# Configuring input method
|
||||
export QT_IM_MODULE='fcitx'
|
||||
export SDL_IM_MODULE='fcitx'
|
||||
export XMODIFIERS='@im=fcitx'
|
||||
|
||||
# Defining XDG dirs
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_RUNTIME_DIR="/run/user/$UID"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
# Spring cleaning
|
||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
|
||||
export EMACS_INIT_FILE="$XDG_CONFIG_HOME/emacs"
|
||||
export GIT_CONFIG="$XDG_CONFIG_HOME/git/config"
|
||||
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||
export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc"
|
||||
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter"
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
||||
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
|
||||
export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python"
|
||||
export PYTHONUSERBASE="$XDG_DATA_HOME/python"
|
||||
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
||||
export SSB_HOME="$XDG_DATA_HOME/zoom"
|
||||
export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var"
|
||||
export TLDR_CACHE_DIR="$XDG_CACHE_HOME/tldr"
|
||||
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
|
||||
export VIMINIT='let $MYVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/vimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYVIMRC'
|
||||
export WINEPREFIX="$XDG_DATA_HOME/wine"
|
||||
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
|
||||
export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc"
|
||||
|
||||
export JAVA_HOME="/usr/lib/jvm/default"
|
||||
export XSECURELOCK_PASSWORD_PROMPT='kaomoji'
|
||||
export DOOMDIR="$HOME/.config/doom"
|
||||
|
||||
export WALLPAPER=~/.config/wallpaper
|
||||
|
||||
export SUDO_PROMPT="$(cowsay $(fortune))
|
||||
Sudo password: "
|
||||
|
||||
25
misc/.config/zsh/.zshhighlighting
Normal file
25
misc/.config/zsh/.zshhighlighting
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
ZSH_HIGHLIGHT_STYLES[default]=none
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[command]=fg=none
|
||||
ZSH_HIGHLIGHT_STYLES[arg0]=fg=none
|
||||
ZSH_HIGHLIGHT_STYLES[precommand]=fg=none
|
||||
ZSH_HIGHLIGHT_STYLES[function]=fg=none
|
||||
ZSH_HIGHLIGHT_STYLES[alias]=fg=none
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=007 # Dimmed white
|
||||
ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=green
|
||||
ZSH_HIGHLIGHT_STYLES[builtin]=none
|
||||
ZSH_HIGHLIGHT_STYLES[commandseparator]=none
|
||||
ZSH_HIGHLIGHT_STYLES[hashed-command]=none
|
||||
ZSH_HIGHLIGHT_STYLES[path]=none
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]=none
|
||||
ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=blue
|
||||
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=none
|
||||
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=none
|
||||
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=none
|
||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=yellow
|
||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=yellow
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=cyan
|
||||
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=cyan
|
||||
ZSH_HIGHLIGHT_STYLES[assign]=none
|
||||
|
||||
249
misc/.config/zsh/.zshrc
Executable file
249
misc/.config/zsh/.zshrc
Executable file
|
|
@ -0,0 +1,249 @@
|
|||
#!/bin/zsh
|
||||
|
||||
[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \
|
||||
source "$EAT_SHELL_INTEGRATION_DIR/zsh"
|
||||
|
||||
# Get it out of here
|
||||
[ -d ~/Downloads ] && [ -z "$(ls ~/Downloads)" ] && rmdir ~/Downloads/
|
||||
|
||||
# ZSH Configurations
|
||||
unsetopt autocd # Change directory just by typing its name (hurts performance)
|
||||
setopt interactivecomments # Allow comments in interactive mode
|
||||
setopt complete_aliases # Allows auto-completion with aliases
|
||||
setopt magicequalsubst # Enable filename expansion for arguments of the form ‘anything=expression’
|
||||
setopt nonomatch # Hide error message if there is no match for the pattern
|
||||
setopt notify # Report the status of background jobs immediately
|
||||
setopt numericglobsort # Sort filenames numerically when it makes sense
|
||||
setopt promptsubst # Enable command substitution in prompt
|
||||
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
|
||||
setopt hist_ignore_dups # ignore duplicated commands history list
|
||||
setopt hist_ignore_space # ignore commands that start with space
|
||||
setopt hist_verify # show command with history expansion to user before running it
|
||||
unsetopt ksharrays # 0-indexing arrays breaks highlighting
|
||||
|
||||
# vi mode
|
||||
bindkey -v
|
||||
bindkey -M vicmd -r ":"
|
||||
export KEYTIMEOUT=1
|
||||
|
||||
# Change cursor shape for different vi modes.
|
||||
function zle-keymap-select {
|
||||
if [[ ${KEYMAP} == vicmd ]] ||
|
||||
[[ $1 = 'block' ]]; then
|
||||
echo -ne '\e[1 q'
|
||||
elif [[ ${KEYMAP} == main ]] ||
|
||||
[[ ${KEYMAP} == viins ]] ||
|
||||
[[ ${KEYMAP} = '' ]] ||
|
||||
[[ $1 = 'beam' ]]; then
|
||||
echo -ne '\e[5 q'
|
||||
fi
|
||||
}
|
||||
zle -N zle-keymap-select
|
||||
zle-line-init() {
|
||||
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
|
||||
echo -ne "\e[5 q"
|
||||
}
|
||||
zle -N zle-line-init
|
||||
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
||||
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
||||
|
||||
## ALIASES ##
|
||||
|
||||
# The rice repo
|
||||
alias config='git --git-dir $HOME/repos/dotfiles/ --work-tree=$HOME'
|
||||
|
||||
# WSL
|
||||
alias wclip='/mnt/c/Windows/System32/clip.exe'
|
||||
alias wclipget='/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -c Get-Clipboard'
|
||||
|
||||
alias s='sudo ' # Allow aliases to be passed to sudo
|
||||
alias pypr='sh -c pypr'
|
||||
alias asciiquarium='asciiquarium -t'
|
||||
alias ll='ls -l'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
alias python='python3'
|
||||
alias xournal='xournalpp'
|
||||
alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
|
||||
alias sxiv='nsxiv'
|
||||
alias blueman='blueman-manager'
|
||||
alias spotify='dlkiller spotify'
|
||||
alias zoom='dlkiller zoom'
|
||||
alias tor='torbrowser-launcher'
|
||||
alias emax="devour emacsclient -c -a 'emacs' 1>/dev/null"
|
||||
alias em="emacsclient -nw -a 'emacs -nw'"
|
||||
|
||||
# Colorful output
|
||||
alias ls='LC_COLLATE=C ls --color=auto --group-directories-first -hN -A'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias diff='diff --color=auto'
|
||||
alias ip='ip --color=auto'
|
||||
alias gcc='grc gcc'
|
||||
alias ifconfig='grc ifconfig'
|
||||
alias make='grc make'
|
||||
alias netstat='grc netstat'
|
||||
alias nmap='grc nmap'
|
||||
alias ping='grc ping'
|
||||
alias ping='grc ping'
|
||||
alias uptime='grc uptime'
|
||||
|
||||
## FUNCTIONS ##
|
||||
|
||||
function colors {
|
||||
for i in {0..255}; do
|
||||
print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$"\n"};
|
||||
done
|
||||
}
|
||||
|
||||
function increase_opacity {
|
||||
printf "\033]11;rgba:00/00/00/ff\007"
|
||||
}
|
||||
function decrease_opacity {
|
||||
printf "\033]11;rgba:00/00/00/00\007"
|
||||
}
|
||||
|
||||
function pwdterm {
|
||||
# New terminal in the current working directory
|
||||
setsid -f $TERMINAL -e $SHELL >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
function ya() {
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
fi
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
|
||||
function lfcd {
|
||||
tmp="$(mktemp)"
|
||||
command lf -last-dir-path="$tmp" "$@"
|
||||
if [ -f "$tmp" ]; then
|
||||
dir="$(cat "$tmp")"
|
||||
rm -f "$tmp"
|
||||
if [ -d "$dir" ]; then
|
||||
if [ "$dir" != "$(pwd)" ]; then
|
||||
cd "$dir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function nix-clean {
|
||||
nix-env --delete-generations old
|
||||
nix-store --gc
|
||||
nix-channel --update
|
||||
nix-env -u --always
|
||||
for link in /nix/var/nix/gcroots/auto/*
|
||||
do
|
||||
rm $(readlink "$link")
|
||||
done
|
||||
nix-collect-garbage -d
|
||||
}
|
||||
|
||||
# This script was automatically generated by the broot program
|
||||
# More information can be found in https://github.com/Canop/broot
|
||||
# This function starts broot and executes the command
|
||||
# it produces, if any.
|
||||
# It's needed because some shell commands, like `cd`,
|
||||
# have no useful effect if executed in a subshell.
|
||||
function br {
|
||||
local cmd cmd_file code
|
||||
cmd_file=$(mktemp)
|
||||
if broot --outcmd "$cmd_file" "$@"; then
|
||||
cmd=$(<"$cmd_file")
|
||||
command rm -f "$cmd_file"
|
||||
eval "$cmd"
|
||||
else
|
||||
code=$?
|
||||
command rm -f "$cmd_file"
|
||||
return "$code"
|
||||
fi
|
||||
}
|
||||
|
||||
function nix_shell_menu {
|
||||
shell_dir="$HOME/shells"
|
||||
shells=$(ls "$shell_dir")
|
||||
selection=$(echo "$shells" | rofi -dmenu)
|
||||
nix-shell "$shell_dir/$selection" --run "
|
||||
export name=${selection%.*};
|
||||
$([ "$1" = "fhs" ] && echo "fhs-run ")$([ "$1" = "sudo" ] && echo "sudo ")$SHELL
|
||||
"
|
||||
}
|
||||
|
||||
function nixstore () {
|
||||
cd "$(dirname $(readlink -f $(which "$1")))"
|
||||
}
|
||||
|
||||
# function man () {
|
||||
# emacsclient -nw --eval '(progn (man "'$1'"))'
|
||||
# }
|
||||
|
||||
## KEYBINDS ##
|
||||
|
||||
zle -N increase_opacity
|
||||
zle -N decrease_opacity
|
||||
bindkey '^[s' decrease_opacity
|
||||
bindkey '^[a' increase_opacity
|
||||
|
||||
bindkey -s '^e' 'ya\n'
|
||||
bindkey -s '^n' 'nix_shell_menu'
|
||||
|
||||
zle -N pwdterm
|
||||
bindkey '^[^M' pwdterm
|
||||
|
||||
# Enable completion features
|
||||
autoload -Uz compinit
|
||||
compinit -d ~/.cache/zcompdump
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # case insensitive tab completion
|
||||
|
||||
# Remove green background of simlinks
|
||||
LS_COLORS+=':ow=01;33'
|
||||
|
||||
# Don't consider certain characters part of the word
|
||||
WORDCHARS=${WORDCHARS//\/}
|
||||
|
||||
# History configurations
|
||||
export HISTFILE=~/.local/share/history
|
||||
HISTSIZE=1000
|
||||
SAVEHIST=2000
|
||||
alias history="history 0" # force zsh to show the complete history
|
||||
|
||||
export GPG_TTY=$(tty)
|
||||
|
||||
if [ ! -z "$(grep nixos /etc/os-release)" ]; then
|
||||
# Shell niceties
|
||||
source /run/current-system/sw/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
source /run/current-system/sw/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
||||
# Use zsh as default nix build shell
|
||||
source /run/current-system/sw/share/zsh-nix-shell/nix-shell.plugin.zsh
|
||||
nix-shell-name() {
|
||||
# If hopping into a pkg subshell, the shell name should reflect the
|
||||
# package linked. (i.e.: 'nix-shell -p nyancat' => 'export name=nyancat')
|
||||
if [ "$1" = "-p" ]; then
|
||||
nix-shell "$@" --command "export name='$2'"
|
||||
else
|
||||
nix-shell "$@"
|
||||
fi
|
||||
}
|
||||
alias nix-shell=nix-shell-name
|
||||
else
|
||||
source ~/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
|
||||
fi
|
||||
|
||||
source ~/.config/zsh/.zshhighlighting
|
||||
|
||||
if [ -f ~/.config/zsh/.zshpersonalrc ]; then
|
||||
source ~/.config/zsh/.zshpersonalrc
|
||||
fi
|
||||
|
||||
accent_color="$(cat $HOME/.config/colors/accent)"
|
||||
starship config format "'''[╭──\([\$username@\$hostname](bold $accent_color)\)-\[\$directory\](-\[\$git_branch\$git_metrics\$git_status\])(-\[\$nix_shell\])]($accent_color) \$cmd_duration
|
||||
[╰─]($accent_color)[\$shell](bold $accent_color) '''"
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue