KDE automatically runs programs and scripts located in its Autostart directories at session startup. This includes standard applications, as well as shell scripts written in Bash, zsh, or other shells. The behavior even extends to running scripts upon session logout, providing flexible session lifecycle management.
Additional startup scenarios outside the KDE session can be handled through Linux tools like crontab or systemd. These allow more complex scheduling or system-level service management, supplementing the default options within KDE.
Configuration files can be created manually or generated using the integrated Autostart tool found in KDE's System Settings. This graphical interface enables adding, removing, or adjusting startup items, offering a straightforward way to tailor session behavior.
Steps to configure autostart program for KDE:
- Launch System Settings from the launcher.
- Go to Startup and Shutdown from the sidebar menu.
- Click on Autostart on the sidebar.
- Click on Add button at the bottom of the screen.
- Click on Add Application to add program to launch during KDE startup.
- Filter and choose application from the list and click OK.
- Click on the Add button again to now start adding shell script.
- Click on the Add Login Script button to add shell script to automaically start during KDE startup.
- Browse script using the file picker and click Open.
By default it is set to create a symlink / softlink to your actual shell script.
Make sure the user has execute permission on the script or application.
Related: How to change file and folder permissions in Linux - Launch terminal.
- Check content of generated Autostart desktop file.
- Check generated softlink in Autostart script directory.

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.