[dwm] Where are programs executed automatically on system's startup?

The system doesn’t come with ~/.xinitrc, even though nitrogen (wallpaper software) is still initializing every time the system boots up. Where is this command located? What I really wanted to do is add more programs to this list…

Hi and welcome to EnOS’ forum!

Please have a look here

https://i3wm.org/docs/userguide.html#_automatically_starting_applications_on_i3_startup

and see if that is what you are looking for to do. The exec .... needs to be added to ~/.config/i3/config file.

1 Like

Welcome to :enos: forums.

As @pebcak said you can place the commands at the end of the i3 config file. Or you can create a .desktop file and place it in ~/.config/autostart. Below are basic entries you need to have in the file.

[Desktop Entry]
Version=1.12.2.1 <--- Program Version
Type=Application <--- Type of the executable
Name=Picom <-- Name
GenericName=Picom X compositor <-- Just give a name. You can do without this too
Comment=Picom is a standalone compositor for Xorg. <-- A descrition. Not needed. Can use it without this.
Categories=Utility;
Keywords=Compositor;X;
TryExec=picom -b --config /home/s4ndm4n/.config/picom/picom.conf <-- It tests if the program or file is there in the system,
Exec=picom -b --config /home/s4ndm4n/.config/picom/picom.conf <-- Runs the file if TryExec is true.

If you want to run this with any other command you can change the Exec like below.

Exec=bash -c "sleep 2 && picom -b --config /home/s4ndm4n/.config/picom/picom.conf"

Above will start the command after a 2-second delay. You can also create a service file and run it on boot. But I’ll stop with this one because it’s kind of easier than the service.

2 Likes

I forgot to mention I changed to dwm, sorry

1 Like

I forgot to mention I changed to dwm, sorry

good place to start
:innocent:
" https://wiki.archlinux.org/title/Dwm "

2 Likes

dwm.desktop

[Desktop Entry]
Encoding=UTF-8
Name=Dwm
Comment=Dynamic window manager
Exec= ~/.dwm/autostart
Icon=dwm
Type=XSession

ex autostart

#!/bin/sh

feh --bg-fill ~/Pictures/wall/wall.png &

picom & 

xbacklight -set 10 &

~/.dwm/bars/bar.sh &

dwm
2 Likes