Trying to setup clock and wallpaper in dwm with the default login manager

Im trying to setup something similar to .xinitrc where i can put a command to set my wallpaper and also start a clock that appears on my dwm status bar but while still using the login manager (lightdm?) that is used by default with dwm enabled. Right now my dwm setup is just the services.xserver dwm being set to enabled as per the wiki guide. So is there a file that the login manager can read when dwm is booted up so that i dont have to use startx?

I believe the ~/.xprofile script will be used for this by default with display managers, as opposed to ~/.xinitrc for startx. See also this thread, which has a similar issue.

You can also use systemd units that are WantedBy=graphical-session.target - or maybe PartOf, or any of the other systemd dependency things, depending on how the units should work on restart (apparently this works reliably even on WMs nowadays due to some complicated hackery in the session script).

That said, all this will run just before dwm. If you need dwm to already be running when this script executes, you’ll need to make your dwm config do this somehow, or write a custom dwm session script.

1 Like