Change ZSH configuration
- Enable keychain - Fix ls alias - Added sway startup script
This commit is contained in:
@@ -15,7 +15,7 @@ is_debian_based() {
|
|||||||
return 1 # NO Debian-based
|
return 1 # NO Debian-based
|
||||||
}
|
}
|
||||||
|
|
||||||
alias ls="eza --color=always --group-directories-first --icons"
|
alias ls="eza --color=always --group-directories-first --icons=always"
|
||||||
|
|
||||||
# Replace some more things with better alternatives
|
# Replace some more things with better alternatives
|
||||||
if is_debian_based; then
|
if is_debian_based; then
|
||||||
|
|||||||
@@ -1,9 +1,55 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
||||||
exec sway
|
|
||||||
else
|
# XDG Settings Basic
|
||||||
exec dbus-launch --exit-with-session sway
|
export XDG_CONFIG_HOME=${HOME}/.config
|
||||||
fi
|
export XDG_DATA_HOME=${HOME}/.local/share
|
||||||
|
export XDG_CACHE_HOME=${HOME}/.local/cache
|
||||||
|
export XDG_STATE_HOME=${HOME}/.local/state
|
||||||
|
|
||||||
|
# XDG_CONFIG_HOME
|
||||||
|
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0
|
||||||
|
|
||||||
|
# Reduces crashs for some gdk apps, like evolution
|
||||||
|
# ! Do not set as global variable. Electron Apps will not start !
|
||||||
|
# export GDK_BACKEND=wayland
|
||||||
|
|
||||||
|
# Required for tray icons on waybar
|
||||||
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
|
|
||||||
|
# Enable QT apps to have gtk theme
|
||||||
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
|
|
||||||
|
# Force wayland on qt apps
|
||||||
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
|
||||||
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
||||||
|
# Explicitly set to '96' instead of 'physical' because some apps have problems
|
||||||
|
# Looking at you nextcloud client!
|
||||||
|
# https://github.com/nextcloud/desktop/issues/1079
|
||||||
|
# https://github.com/swaywm/sway/issues/2424
|
||||||
|
export QT_WAYLAND_FORCE_DPI=96
|
||||||
|
|
||||||
|
# Make Qt apps honour DPI settings.
|
||||||
|
export QT_AUTO_SCREEN_SCALE_FACTOR=1
|
||||||
|
|
||||||
|
# Mozilla Wayland support + hardware video decoding
|
||||||
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
|
export MOZ_WAYLAND_USE_VAAPI=1
|
||||||
|
|
||||||
|
# SDL
|
||||||
|
export SDL_VIDEODRIVER=wayland
|
||||||
|
|
||||||
|
# Java under Xwayland
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
|
# Session Type for later screensharing
|
||||||
|
export XDG_SESSION_TYPE=wayland
|
||||||
|
|
||||||
|
exec dbus-launch --exit-with-session sway
|
||||||
|
else
|
||||||
|
echo "Cannot found dbus session: Sway don't work"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
[ -f "$HOME/.ghcup/env" ] && . "$HOME/.ghcup/env"
|
|
||||||
|
|
||||||
if [ -f "/home/linuxbrew/.linuxbrew/bin/brew" ]; then
|
|
||||||
# Initialize Homebrew
|
|
||||||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v starship > /dev/null 2>&1; then
|
if command -v starship > /dev/null 2>&1; then
|
||||||
# Initialize Starship
|
# Initialize Starship
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
|||||||
37
zsh/.zshrc
37
zsh/.zshrc
@@ -78,6 +78,7 @@ plugins=(
|
|||||||
command-not-found
|
command-not-found
|
||||||
fzf
|
fzf
|
||||||
gitignore
|
gitignore
|
||||||
|
keychain
|
||||||
mise
|
mise
|
||||||
zoxide
|
zoxide
|
||||||
zsh-autosuggestions
|
zsh-autosuggestions
|
||||||
@@ -122,35 +123,7 @@ fpath=(~/.zsh $fpath)
|
|||||||
autoload run-help
|
autoload run-help
|
||||||
autoload -Uz compinit && compinit -u
|
autoload -Uz compinit && compinit -u
|
||||||
|
|
||||||
# Key bindings using bindkey and fzf-tmux where possible
|
export FZF_HOME=$HOME/.oh-my-zsh/custom/plugins/fzf
|
||||||
# Ctrl+R: Enhanced reverse history search
|
source <(fzf --zsh)
|
||||||
bindkey '^R' fzf-history-widget
|
source "$FZF_HOME/shell/key-bindings.zsh"
|
||||||
|
source "$FZF_HOME/shell/completion.zsh"
|
||||||
# Ctrl+T: Fuzzy find file
|
|
||||||
bindkey '^T' fzf-file-widget
|
|
||||||
|
|
||||||
# Alt+C: Fuzzy change directory
|
|
||||||
bindkey '^[c' fzf-cd-widget
|
|
||||||
|
|
||||||
# Additional useful bindings
|
|
||||||
# Alt+H: Search and insert from history
|
|
||||||
fzf-history-widget() {
|
|
||||||
BUFFER=$(fc -l 1 | fzf --tac +s --no-sort --preview 'echo {}' | sed 's/^[ 0-9]*//')
|
|
||||||
CURSOR=$#BUFFER
|
|
||||||
zle reset-prompt
|
|
||||||
}
|
|
||||||
zle -N fzf-history-widget
|
|
||||||
|
|
||||||
fzf-file-widget() {
|
|
||||||
local file
|
|
||||||
file=$(fzf --preview 'bat --style=numbers --color=always --line-range :500 {}' 2> /dev/null) && LBUFFER+="$file"
|
|
||||||
zle reset-prompt
|
|
||||||
}
|
|
||||||
zle -N fzf-file-widget
|
|
||||||
|
|
||||||
fzf-cd-widget() {
|
|
||||||
local dir
|
|
||||||
dir=$(fd --type d | fzf --preview 'tree -a -C {} | head -100') && cd "$dir"
|
|
||||||
zle reset-prompt
|
|
||||||
}
|
|
||||||
zle -N fzf-cd-widget
|
|
||||||
|
|||||||
Reference in New Issue
Block a user