You are not logged in.
Pages: 1
Topic closed
Hello.
I would like to execute a little script when linux starts or when the Desktop Environment starts. How could I do it?
Thank you.
Last edited by pedrojoxe2 (2009-12-15 13:19:26)
Offline
add it to ~/.xinitrc
Online
Offline
Put the script in:
~/.config/autostart and make sure to chmod +x it.
Regards
Only if he runs a wm/de that actually executes that file.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
sHyLoCk wrote:Put the script in:
~/.config/autostart and make sure to chmod +x it.
Regards
Only if he runs a wm/de that actually executes that file.
Yep. If the OP doesn't clearly state his wm/de there can be 100s of answers. Like putting it in rc.local
Note: he says at Linux startup or de startup.
Regards
Last edited by sHyLoCk (2009-12-15 12:37:54)
Offline
Ok, thanks to everybody. Finally I found another solution for my problem instead of executing a script every time I start linux. But I'll save your answers in case I want to do it in the future.
Thank you.
Offline
Good, but maybe it could help other people if you post your solution...
ZaQ
Offline
Here is how to autostart scripts:
-------------------------------------------------------------------
Create a new file in "/etc/systemd/system/" (e.g. script.service) and add the following contents:
[Unit]
Description=Script
[Service]
ExecStart=/usr/bin/script
[Install]
WantedBy=multi-user.target
put your script in "/usr/bin/" and make sure to make it executable. and then enable the service.
$ sudo chmod 755 /usr/bin/script
$ sudo systemctl enable script.service
The next time yout restart the script should autostart
If you want the script to run without restarting, type:
$ sudo systemctl start script.service
Last edited by tunnelrat (2017-04-02 15:44:02)
Offline
Please do not necrobump, especially solved threads, and especially when the information is already well documented on the wiki.
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed