Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Startup command in /etc/init.d/boot.local?

  1. #1
    Join Date
    Dec 2008
    Location
    Sydney, Australia
    Posts
    1,021

    Default Startup command in /etc/init.d/boot.local?

    I've modified a few keyboard mappings with the command "setxkbmap us_de" and that works fine whenever run through a terminal but I'd like to make it permanent. Put the command in boot.local but nothing happens: is this because it's run too early in the boot process, or because the full path to us_de is required?
    The alternative method, using the "skeleton" file, that I've read about seems rather complicated...

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Startup command in /etc/init.d/boot.local?

    Code:
    # Here you should add things, that should happen directly after booting
    # before we're going to the first run level.
    Those comments tell you when it's run. Even before the first runlevel, that means definitely no X server is running (level 5).

  3. #3
    Join Date
    Dec 2008
    Location
    Sydney, Australia
    Posts
    1,021

    Default Re: Startup command in /etc/init.d/boot.local?

    That's what I suspected. So how do I run it later? Is the complicated "skeleton" procedure really my only option?

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Startup command in /etc/init.d/boot.local?

    There are some files that are executed during X server startup. Is it something you want to apply to every instance of X running on your machine?

  5. #5
    Join Date
    Dec 2008
    Location
    Sydney, Australia
    Posts
    1,021

    Default Re: Startup command in /etc/init.d/boot.local?

    Yes. As indicated above, it simply modifies the standard keyboard mapping.

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Startup command in /etc/init.d/boot.local?

    If you are running KDE4, simplest would probably to put a script in ~/.kde4/Autostart/. This can be a link to a common script somewhere else.

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Startup command in /etc/init.d/boot.local?

    In fact it may be simpler than that. If you look at /usr/share/kde4/config/kdm/kdmrc you will see that it calls /etc/X11/xdm/Xsetup. Reading through that, around line 211 you will see that if /etc/X11/Xkbmap exists, it will get sent to setxkbmap. So all you have to do is put your mapping in /etc/X11/Xkbmap. You will also see that there are different Xkbmaps that can be used for different kinds of X sessions, but presumably you only care about the one on the console.

  8. #8
    Join Date
    Dec 2008
    Location
    Sydney, Australia
    Posts
    1,021

    Default Re: Startup command in /etc/init.d/boot.local?

    Hmmm. Put the following script

    Code:
    #!/bin/bash
    setxkbmap us_de
    into ~/.kde/autostart/ as us_de.sh and it didn't work.

    As to your second suggestion, my kdmrc contains no references to Xkbmap or setxkbmap around line 211, or anywhere else for that matter. Nor does /etc/X11/Xkbmap exist...

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Startup command in /etc/init.d/boot.local?

    It's not your kdmrc, it's the system one, I already showed you the full path. And it's not kdmrc anyway, it's /etc/X11/xdm/'Xsetup that refers to setxkbmap.

    You have to create /etc/X11/Xkbmap to be a link or a copy of your us_de.

    Also if you are running KDE4, it's ~/.kde4/Autostart. And make sure the file is executable (chmod 755 ...)

    Get some spectacles, mate.

  10. #10
    Join Date
    Dec 2008
    Location
    Sydney, Australia
    Posts
    1,021

    Default Re: Startup command in /etc/init.d/boot.local?

    Making the script executable did indeed make the difference!

    Quote Originally Posted by ken_yap View Post
    It's not your kdmrc, it's the system one, I already showed you the full path. And it's not kdmrc anyway, it's /etc/X11/xdm/'Xsetup that refers to setxkbmap.

    You have to create /etc/X11/Xkbmap to be a link or a copy of your us_de.

    Also if you are running KDE4, it's ~/.kde4/Autostart. And make sure the file is executable (chmod 755 ...)

    Get some spectacles, mate.
    Already have glasses, although the optician sent me a reminder only the other day to have an eye test. You may have a point :-)
    Thanks for your help.

Page 1 of 2 12 LastLast

Posting Permissions

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