elementary / switchboard-plug-applications

Switchboard Applications Plug
https://elementary.io
GNU General Public License v3.0
14 stars 12 forks source link

Set a terminal command or a file to be run/executed at start up (EOS 6 Beta) #158

Open KarkanAlzwayed opened 3 years ago

KarkanAlzwayed commented 3 years ago

Would it be possible to have a terminal command or a script file to be set to run/executed at start up? It only lets me choose an app when I go to settings/applications/startup. Unless, it is somewhere and I can't find it. Thanks

jeremypw commented 3 years ago

There should be an entry at the bottom of the add popup in Settings/Applications/Startup that allows you to enter a custom command (I use this to start the ibus daemon). There are a few bugs/limitations StartupCommand with it but it basically works.

KarkanAlzwayed commented 3 years ago

@jeremypw thank you. How about an executable file?

jeremypw commented 3 years ago

If I remember right, one of the limitations is you cannot execute something that requires a terminal (i.e. does not have a .desktop file)

KarkanAlzwayed commented 3 years ago

@jeremypw The whole thing is that I want to fix the capslock delay (you know how it is on linux) with this, but it requires a script file(fixer.sh) to be run at start up. It does mention a way of running a terminal command to achieve that, but the command never worked for me, so I am trying to run that file at start up through the settings instead of the terminal like I used to do on KDE. It is either this, or I hope/wish that the dev team would implement a small fix in the Odin release to fix the capslock delay. It is driving me crazy. lol

jeremypw commented 3 years ago

Try using this as your custom command:

/bin/bash -c "xkbcomp /home/<user>/.config/xkbmap $DISPLAY"

Replace <user> by your username.

You will need to copy the custom xkbmap file out of the repository and into your ~/.config folder. You will not need the shellscript (I have used the functional line from the script in the above command)

WARNING: There is no guarantee that the xkbmap in the repository you quoted is correct or will match you keyboard - have a backup layout installed in settings. Check that you can still type your password before logging out.

You can check whether the command ran or had errors after start up by typing sudo cat /var/log/syslog | grep custom in a terminal.

KarkanAlzwayed commented 3 years ago

@jeremypw that actually worked like a charm. Thank you. Added this command into settings/applications/startup/plus sign bottom left /bin/bash -c "xkbcomp /home/<username>/.config/xkbmap $DISPLAY" Thanks again

jeremypw commented 3 years ago

Glad to hear it works. I think I'll leave this open as it be nice to have a more user friendly way of setting a script to run at startup e.g. a dialog getting the directory to run in, script path and parameters then constructing the full command transparently.