Refactor the entire configuration
With the release of the Nvidia 555 beta drivers and their improvements to the Wayland experience I've finally decided to return to NixOS with Hyprland again after 2 years of running Gentoo and Opensuse Tumbleweed on X11. So this is me committing the work done so far from the last couple of days. Future commits will be more incremental.
This commit is contained in:
parent
97c86fb014
commit
75b13ac379
72 changed files with 2045 additions and 196 deletions
4
users/hu/packages/zsh/config/conf.d/alias.zsh
Normal file
4
users/hu/packages/zsh/config/conf.d/alias.zsh
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
alias reload="exec zsh"
|
||||
|
11
users/hu/packages/zsh/config/conf.d/color.zsh
Executable file
11
users/hu/packages/zsh/config/conf.d/color.zsh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
alias ls='ls --color=auto'
|
||||
alias ll='ls -lah --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
|
||||
term_name=$(ps -o comm= "$PPID")
|
||||
if [ "$term_name" = "xterm" ] && [ -n "$(command -v "transset")" ]; then
|
||||
transset -a 0.95 > /dev/null
|
||||
fi
|
||||
|
18
users/hu/packages/zsh/config/conf.d/completions.zsh
Executable file
18
users/hu/packages/zsh/config/conf.d/completions.zsh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if [ -z "$FZF_TAB_FILE" ] && [ ! -d "$HOME/.cache/fzf-tab" ]; then
|
||||
echo "Installing fzf-tab"
|
||||
git clone "https://github.com/Aloxaf/fzf-tab" "$HOME/.cache/fzf-tab"
|
||||
FZF_TAB_FILE="$HOME/.cache/fzf-tab/fzf-tab.plugin.zsh"
|
||||
fi
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
source "$FZF_TAB_FILE"
|
||||
zstyle ':completion:*:git-checkout:*' sort false
|
||||
|
||||
if [ -n "$TMUX" ]; then
|
||||
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
|
||||
fi
|
||||
|
6
users/hu/packages/zsh/config/conf.d/env.zsh
Executable file
6
users/hu/packages/zsh/config/conf.d/env.zsh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if [ -n "$(command -v qt5ct)" ] && [ -z "$DESKTOP_SESSION" ]; then
|
||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||
fi
|
||||
|
9
users/hu/packages/zsh/config/conf.d/fuck.zsh
Executable file
9
users/hu/packages/zsh/config/conf.d/fuck.zsh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if [ -n "$(command -v thefuck)" ]; then
|
||||
fuck() {
|
||||
eval $(thefuck --alias)
|
||||
fuck
|
||||
}
|
||||
fi
|
||||
|
5
users/hu/packages/zsh/config/conf.d/gpg.zsh
Executable file
5
users/hu/packages/zsh/config/conf.d/gpg.zsh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
GPG_TTY=$(tty)
|
||||
export GPG_TTY
|
||||
|
6
users/hu/packages/zsh/config/conf.d/manpager.zsh
Executable file
6
users/hu/packages/zsh/config/conf.d/manpager.zsh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if [ -n "$(command -v "nvim")" ]; then
|
||||
export MANPAGER='nvim +Man!'
|
||||
fi
|
||||
|
46
users/hu/packages/zsh/config/conf.d/path.zsh
Executable file
46
users/hu/packages/zsh/config/conf.d/path.zsh
Executable file
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
add_to_path() {
|
||||
if [ -d "$1" ] && [[ "$PATH" != *"$1"* ]]; then
|
||||
PATH="$PATH:$1"
|
||||
fi
|
||||
}
|
||||
|
||||
add_to_path "$HOME/.local/bin"
|
||||
|
||||
# Language package mangers
|
||||
if [ -n "$(command -v go)" ]; then
|
||||
export GOPATH="$HOME/.local/share/go"
|
||||
add_to_path "$HOME/.local/share/go/bin"
|
||||
fi
|
||||
|
||||
if [ -n "$(command -v npm)" ]; then
|
||||
if [ -f "$HOME/.npmrc" ]; then
|
||||
if [ -z "$(grep prefix "$HOME/.npmrc")" ]; then
|
||||
npm config set prefix "$HOME/.local/share/npm"
|
||||
fi
|
||||
else
|
||||
npm config set prefix "$HOME/.local/share/npm"
|
||||
fi
|
||||
add_to_path "$HOME/.local/share/npm/bin"
|
||||
fi
|
||||
|
||||
if [ -n "$(command -v cargo)" ]; then
|
||||
export CARGO_HOME="$HOME/.local/share/cargo"
|
||||
add_to_path "$HOME/.local/share/cargo/bin"
|
||||
fi
|
||||
|
||||
if [ -n "$(command -v pip3)" ] && [ -n "$(command -v virtualenv)" ]; then
|
||||
if [ ! -d "$HOME/.local/share/python3-venv" ]; then
|
||||
python3 -m venv "$HOME/.local/share/python3-venv"
|
||||
fi
|
||||
|
||||
if [ "$(grep "executable" "$HOME/.local/share/python3-venv/pyvenv.cfg" | awk '{print $3}')" \
|
||||
!= "$(realpath $(command -v python3))" ]; then
|
||||
python3 -m venv --upgrade "$HOME/.local/share/python3-venv"
|
||||
fi
|
||||
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=true
|
||||
source "$HOME/.local/share/python3-venv/bin/activate"
|
||||
fi
|
||||
|
18
users/hu/packages/zsh/config/conf.d/ps1.zsh
Executable file
18
users/hu/packages/zsh/config/conf.d/ps1.zsh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
distro=$(cat /etc/os-release | grep -w 'ID=.*' | sed -e 's/ID=//g' | awk '{print $1}')
|
||||
case "$distro" in
|
||||
"debian") dicon="%F{red}%f" ;;
|
||||
"gentoo") dicon="%F{magenta}%f" ;;
|
||||
"\"opensuse-tumbleweed\"") dicon="%F{green} %f" ;;
|
||||
"nixos") dicon="%F{cyan}%f" ;;
|
||||
*) dicon="%F{yellow}[]%f" ;;
|
||||
esac
|
||||
|
||||
setopt prompt_subst
|
||||
autoload -Uz vcs_info
|
||||
precmd () { vcs_info }
|
||||
zstyle ':vcs_info:*' formats ' %F{yellow}(%b)%f'
|
||||
|
||||
export PS1='$dicon %n@%m %F{green}%~%f$vcs_info_msg_0_> '
|
||||
|
11
users/hu/packages/zsh/config/conf.d/ssh.zsh
Executable file
11
users/hu/packages/zsh/config/conf.d/ssh.zsh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if [ -z "$DESKTOP_SESSION" ]; then
|
||||
if [ -z "$(pidof gnome-keyring-daemon)" ] && [ -n "$(command -v gnome-keyring-daemon)" ]; then
|
||||
{ eval $(gnome-keyring-daemon --start); } > /dev/null 2>&1
|
||||
export SSH_AUTH_SOCK
|
||||
else
|
||||
{ eval $(ssh-agent -s); } > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
29
users/hu/packages/zsh/config/conf.d/suggestions.zsh
Executable file
29
users/hu/packages/zsh/config/conf.d/suggestions.zsh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
export HISTFILE=~/.cache/zsh_history
|
||||
export HISTSIZE=10000
|
||||
export SAVEHIST=$HISTSIZE
|
||||
|
||||
setopt INC_APPEND_HISTORY
|
||||
setopt SHARE_HISTORY
|
||||
setopt HIST_IGNORE_SPACE
|
||||
setopt HIST_SAVE_NO_DUPS
|
||||
|
||||
if [ -z "$AUTOSUGGEST_FILE" ]; then
|
||||
import_file="/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
else
|
||||
import_file="$AUTOSUGGEST_FILE"
|
||||
fi
|
||||
|
||||
if [ ! -f "$import_file" ]; then
|
||||
if [ ! -d "$HOME/.cache/zsh-autosuggestions" ]; then
|
||||
echo "Installing zsh-autosuggestions..."
|
||||
git clone "https://github.com/zsh-users/zsh-autosuggestions.git" "$HOME/.cache/zsh-autosuggestions"
|
||||
fi
|
||||
import_file="$HOME/.cache/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
fi
|
||||
|
||||
source "$import_file"
|
||||
|
||||
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
||||
|
18
users/hu/packages/zsh/config/conf.d/syntax.zsh
Executable file
18
users/hu/packages/zsh/config/conf.d/syntax.zsh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if [ -z "$SYNTAX_FILE" ]; then
|
||||
import_file="/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
else
|
||||
import_file="$SYNTAX_FILE"
|
||||
fi
|
||||
|
||||
if [ ! -f "$import_file" ]; then
|
||||
if [ ! -d "$HOME/.cache/zsh-syntax-highlighting" ]; then
|
||||
echo "Installing zsh-syntax-highlighting..."
|
||||
git clone "https://github.com/zsh-users/zsh-syntax-highlighting.git" "$HOME/.cache/zsh-syntax-highlighting"
|
||||
fi
|
||||
import_file="$HOME/.cache/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
fi
|
||||
|
||||
source "$import_file"
|
||||
|
9
users/hu/packages/zsh/config/conf.d/tmux.zsh
Executable file
9
users/hu/packages/zsh/config/conf.d/tmux.zsh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
# Disabled until I fix my tmux config
|
||||
return
|
||||
|
||||
if [ "$TERM" = "xterm-256color" ] && [ -x "$(command -v tmux)" ]; then
|
||||
tmux new-session
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue