#How to automate a command at system start up process.

12 messages · Page 1 of 1 (latest)

lusty plume
#

Hey Guys, To make my dual display work, I have to run this command optimus-manager --switch hybrid and this will logme out and then I have to login again, this feels pretty lame to me . Is there a way to automate this command? Like it will automatically run when the system starts and I don't have to login and logout and login again?

#

I'm using KDE

#

with SDDM

#

Linux itsk 6.4.7-arch1-1

sharp sparrow
lusty plume
#

NO, Now that you have mentioned it, i will try to find how to do that

lusty plume
#

How to automate a command at system starts up process.

#

How to automate a command at system start up process.

sharp sparrow
#

exempli gratia, this is the service I use to start kiwix-serve on login.

[Unit]
Description=Kiwix Server

[Service]
Type=simple
ExecStart=/usr/bin/kiwix-serve --library ${XDG_DATA_HOME}/zim/index.xml -i 127.0.0.1 -p 40080 -b -t 1 -M

ReadOnlyPaths=/

[Install]
WantedBy=default.target
#

The unit files should be stored in ~/.config/systemd/user.

#

Run

systemctl --user daemon-reload

to load the changes

Run

systemctl --user enable --now unit_name

to enable and start the unit now

  • unit_name* is a placeholder that should be replaced with