diff --git a/.config/x11/xprofile b/.config/x11/xprofile index 846cb22..6e95b15 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -1,19 +1,18 @@ #!/bin/sh -DPI=96 - -xrandr --dpi "$DPI" # This file runs when a DM logs you into a graphical session. # If you use startx/xinit like a Chad, this file will also be sourced. +xrandr --dpi 96 # Set DPI. User may want to use a larger number for larger screens. setbg & # set the background with the `setbg` script -#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & # Uncomment to use Xresources colors/settings on startup -mpd & # music player daemon-you might prefer it as a service though +#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup remaps & # run the remaps script, switching caps/esc and more; check it for more info -xcompmgr & # xcompmgr for transparency -dunst & # dunst for notifications -xset r rate 300 50 & # Speed xrate up -unclutter & # Remove mouse when idle + +autostart="mpd xcompmgr dunst unclutter" + +for program in $autostart; do + pidof -s "$program" || setsid -f "$program" +done >/dev/null 2>&1 # This line autostarts an instance of Pulseaudio that does not exit on idle. # This is "necessary" on Artix due to a current bug between PA and @@ -21,3 +20,6 @@ unclutter & # Remove mouse when idle pidof -s runit && ! pidof -s pulseaudio >/dev/null 2>&1 && setsid -f pulseaudio --start --exit-idle-time=-1 >/dev/null 2>&1 + +# Ensure that xrdb has finished running before moving on to start the WM/DE. +[ -n "$xrdbpid" ] && wait "$xrdbpid"