How to add command to `.desktop` file at startup?

I want to make OBS Studio automatically record at login (ideally at boot, but I can’t be bothered to deal with SystemD and that’s not what this forum is for) but haven’t been able to ascertain how to dynamically add an argument to a command when invoking it from kcm_autostart.

For instance, I need to add --startrecording and ideally --minimize-to-tray to /usr/share/applications/com.obsproject.Studio.desktop:

Worked it out:

  1. script -a -c 'obs --startrecording --minimize-to-tray' # https://discuss.kde.org/t/how-to-add-command-to-desktop-file-at-startup/6078/2?u=rokejulianlockhart
    

1 Like