feat(config): add ghostty terminal and refactor neovim configuration

- Add ghostty terminal configuration with custom themes and settings
- Add multiple color themes (ayu-dark, catppuccin variants, moonfly)
- Configure ghostty appearance: font, opacity, keybindings
- Refactor nvim basic setup to use modern vim.opt API
- Modernize LSP configuration with LspAttach autocmd
- Update nvim-tree configuration for latest API
- Simplify codecompanion plugin setup
- Pin nvim-treesitter to main branch
- Improve sway-dbus script with XDG runtime checks
This commit is contained in:
jay
2026-05-12 11:14:13 +08:00
parent 36a51d8127
commit 45e1e6f235
13 changed files with 353 additions and 201 deletions
+26 -17
View File
@@ -6,25 +6,34 @@ export XDG_CURRENT_DESKTOP=sway # xdg-desktop-portal
export XDG_SESSION_DESKTOP=sway # systemd
export XDG_SESSION_TYPE=wayland # xdg/systemd
#if command -v dbus-update-activation-environment >/dev/null; then
# dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
#fi
# without this, systemd starts xdg-desktop-portal without these environment variables,
# and the xdg-desktop-portal does not start xdg-desktop-portal-wrl as expected
# https://github.com/emersion/xdg-desktop-portal-wlr/issues/39#issuecomment-638752975
#systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
if [ -d "$HOME/.config/environment.d" ]; then
for f in "$HOME"/.config/environment.d/*.conf; do
[ -f "$f" ] || continue
while IFS= read -r line || [ -n "$line" ]; do
# Skip empty lines and comments
case "$line" in
'' | '#'*) continue ;;
esac
# Export the variable
export "$line"
done <"$f"
done
fi
# use systemd-run here, because systemd units inherit variables from ~/.config/environment.d
# shellcheck disable=SC2068
#systemd-run --quiet --unit=sway --user --wait sway $@
#systemctl --user stop sway-session.target
max_attempts=50
attempt=0
while [ ! -d "/run/user/$(id -u)" ]; do
if [ "$attempt" -ge "$max_attempts" ]; then
echo "Error: XDG_RUNTIME_DIR not available after $max_attempts attempts" >&2
exit 1
fi
sleep 0.2
attempt=$((attempt + 1))
done
#systemctl --user unset-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
#if command -v dbus-update-activation-environment >/dev/null; then
# dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
#fi
#dbus-launch --exit-with-session sway
dbus-run-session sway
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
dbus-run-session sway "$@"
# this teardown makes it easier to switch between compositors
unset DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE