• Autostart before launch DE


    Hi! I need to run the command before start the DE. Cinnamon 2.6.8.
    In what file I need to write the command?
    setkeycodes e016 188

  • Open System Settings and go to Startup Applications and add it there.

  • @herbie said:
    before start the DE

  • Well you would have to login first then add the program to the Startup Applications. Then log out and when you login again the program will run.

  • @herbie said:
    I know. But why me these swings?

  • Now I’m confused. Explain “swings” please.

  • @herbie said:

    Why do I need such difficulties? It only complicates process of loading the PC

  • This is the way I do it…

    first I create /usr/lib/systemd/system/rc-local.service with the following contents:

    [Unit]
    Description=/etc/rc.local Compatibility
    ConditionPathExists=/etc/rc.local
    Before=network.target
    Wants=network.target

    [Service]
    Type=forking
    ExecStart=/etc/rc.local start
    TimeoutSec=0
    StandardOutput=tty
    RemainAfterExit=yes
    SysVStartPriority=99

    [Install]
    WantedBy=multi-user.target

    then do the following:
    cd /etc/systemd/system/multi-user.target.wants
    ln -s /usr/lib/systemd/system/rc-local.service rc-local.service
    systemctl enable rc-local.service

    finally, create /etc/rc.local with the commands you want, make it executable with chmod, and remember to have “exit 0” as last line. In your case it should be something like this:

    setkeycodes e016 188
    exit 0

    I know it’s a bit long, but once you create the service you can use it anytime, just add the commands you want to rc.local

  • Now I understand. I thought he meant just before the DE was up and wanted to run an application.
    Great that you provided that information as I have done the same thing.

  • @Gryphon said:
    exec sudo …
    need to write at the beginning of the command?

  • @herbie said:

    [email protected] ~]$ sudo systemctl status rc-local.service
    ● rc-local.service - /etc/rc.local Compatibility
    Loaded: loaded (/usr/lib/systemd/system/rc-local.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Ср 2015-06-17 18:34:22 EEST; 4min 43s ago
    Process: 223 ExecStart=/etc/rc.local start (code=exited, status=203/EXEC)

    июн 17 18:34:21 Arch-PC systemd[1]: Starting /etc/rc.local Compatibility…
    июн 17 18:34:21 Arch-PC systemd[223]: Failed at step EXEC spawning /etc/r…r
    июн 17 18:34:22 Arch-PC systemd[1]: rc-local.service: control process ex…03
    июн 17 18:34:22 Arch-PC systemd[1]: Failed to start /etc/rc.local Compat…y.
    июн 17 18:34:22 Arch-PC systemd[1]: Unit rc-local.service entered failed…e.
    июн 17 18:34:22 Arch-PC systemd[1]: rc-local.service failed.
    Hint: Some lines were ellipsized, use -l to show in full.

  • solved. thank’s

  • I received and e-mail that this was unsolved and viewing the above text I have decided to show you my rc-local.service which works perfectly

    [Unit]
    Description=/etc/rc.local Compatibility

    [Service]
    Type=oneshot

    is forking instead of oneshot needed here?

    ExecStart=/etc/rc.local
    #TimeoutSec=0
    #StandardInput=tty
    RemainAfterExit=yes

    [Install]
    WantedBy=multi-user.target
    Now rc.local in the /etc folder must be executable.

cinnamon73 autostart7 Posts 13Views 3030
Log in to reply