Results 1 to 3 of 3

Thread: [SOLVED]Execute commands at startup

  1. #1
    Join Date
    Aug 2020
    Beans
    8

    [SOLVED]Execute commands at startup

    Ubuntu 18.04

    I need to modify my keyboard at startup. I put
    Code:
    #!/bin/sh -e
    # rc.local
    #
    
    xmodmap -e "keycode  68 = Home"
    xmodmap -e "keycode  67 = Delete"
    0
    in rc.local, but that doesn't work. So where should I have it put it? Thanks in advance.
    Last edited by ionmich1; August 14th, 2020 at 04:55 PM.

  2. #2
    Join Date
    Dec 2014
    Beans
    2,579

    Re: Execute commands at startup

    rc.local - even if it does get executed, which needs activation of the service rc-local.service and /etc/rc.local has to be executable and needs a valid shebang line - would be a bad place for these commands because it runs before the GUI is started. Put the script in some file in your home and create a desktop file in ~/.config/autostart for it. That's what I do to set my touchpad to tap-to-click, which for some reason isn't available as an option in the settings ...

    Holger

  3. #3
    Join Date
    Aug 2020
    Beans
    8

    Re: Execute commands at startup

    Quote Originally Posted by Holger_Gehrke View Post
    rc.local - even if it does get executed, which needs activation of the service rc-local.service and /etc/rc.local has to be executable and needs a valid shebang line - would be a bad place for these commands because it runs before the GUI is started. Put the script in some file in your home and create a desktop file in ~/.config/autostart for it. That's what I do to set my touchpad to tap-to-click, which for some reason isn't available as an option in the settings ...

    Holger
    Thank you for the speedy reply, and the appropriate solution.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •