diff --git a/zsh/.oh-my-zsh/custom/aliases.zsh b/zsh/.oh-my-zsh/custom/aliases.zsh index d3612f2..1e41d08 100644 --- a/zsh/.oh-my-zsh/custom/aliases.zsh +++ b/zsh/.oh-my-zsh/custom/aliases.zsh @@ -15,7 +15,7 @@ is_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 if is_debian_based; then diff --git a/zsh/.profile.d/sway-startup.sh b/zsh/.profile.d/sway-startup.sh index 4ff1972..f271ca6 100755 --- a/zsh/.profile.d/sway-startup.sh +++ b/zsh/.profile.d/sway-startup.sh @@ -1,9 +1,55 @@ #!/usr/bin/env bash if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then - if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then - exec sway - else - exec dbus-launch --exit-with-session sway - fi + if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then + + # XDG Settings Basic + export XDG_CONFIG_HOME=${HOME}/.config + 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 diff --git a/zsh/.zshenv b/zsh/.zshenv index f5cf481..6327347 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -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 # Initialize Starship eval "$(starship init zsh)" diff --git a/zsh/.zshrc b/zsh/.zshrc index 8cb42cc..2cbb4d4 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -78,6 +78,7 @@ plugins=( command-not-found fzf gitignore + keychain mise zoxide zsh-autosuggestions @@ -122,35 +123,7 @@ fpath=(~/.zsh $fpath) autoload run-help autoload -Uz compinit && compinit -u -# Key bindings using bindkey and fzf-tmux where possible -# Ctrl+R: Enhanced reverse history search -bindkey '^R' fzf-history-widget - -# 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 +export FZF_HOME=$HOME/.oh-my-zsh/custom/plugins/fzf +source <(fzf --zsh) +source "$FZF_HOME/shell/key-bindings.zsh" +source "$FZF_HOME/shell/completion.zsh"