nix-config/nixos/common/users/sajenim/jade/xinitrc
jasmine 0e7f2ada72
fix(jade): resolve Thunar 20s startup delay
Import DISPLAY and XAUTHORITY into systemd user environment and restart
xdg-desktop-portal-gtk service in xinitrc. This fixes the issue where
portal backends fail to start with "cannot open display" error when using
startx instead of a display manager.

Without this, Thunar waits 25 seconds for org.freedesktop.portal.Desktop
to respond before timing out and displaying.
2025-12-21 12:51:17 +08:00

23 lines
631 B
Bash

#!/bin/bash
# Setup monitors (machine-specific - consider making configurable)
xrandr --output HDMI-A-0 --mode 1920x1080 \
--output DisplayPort-0 --mode 2560x1440 --right-of HDMI-A-0
# Apply wallpaper
feh --bg-center ~/.repositories/personal/nix-config/assets/chinatown.png
# Disable screen saver and DPMS features
xset s off -dpms
# Fix for pinentry bug on NixOS
gpgconf --reload gpg-agent
# Import X display into systemd user environment
systemctl --user import-environment DISPLAY XAUTHORITY
# Start XDG desktop portal backend
systemctl --user restart xdg-desktop-portal-gtk.service
# Launch window manager
exec xmonad