3

linux learner here. (Running on a Debian-derived distro)

My mouse sensitivity was too high so I was able to change it, but can't seem to get it to apply on startup.

I made /etc/init.d/mouse

When I run sudo /etc/init.d/mouse start, the script works fine and the mouse settings are updated.

But I can't get it to run on startup. I tried running sudo update-rc.d mouse defaults, but it still doesn't update when I log out and back in again.

Not sure what else I'm missing in order to make it run on startup.

Related question:

Is /etc/init.d even the right place to be putting it? Or is there some other startup folder that's better for configuration type changes? (As I read init.d is a folder for applications to be run on startup)

2
  • 1
    /etc/init.d is for scripts that start and stop services on systems with SysV init (Upstart and systemd can be configured to run them, for compatibility). How do you change the sensitivity ? Unless you have a unusual setup, you are probably using xinput or xset to configure Xorg ? In that case the correct way is to change the global Xorg configuration : this affects everyone using the computer, or add the command to your .xprofile (or equivalent for your DM/DE) if it is just for your user account.
    – Leiaz
    Nov 23, 2014 at 13:11
  • /etc/init.d is for system startup, which doesn't include the GUI startup. How are you setting the mouse sensitivity? If it's via an X11 command, you need to do it when X11 starts. Usually you would add a setting to /etc/X11/xorg.conf. Nov 23, 2014 at 19:42

3 Answers 3

0

The init.d scripts aren't run on login, so it's normal that it doesn't run if you just log out and in. They only run on boot, or when changing runlevels.

/etc/init.d is the right place if the settings are global (shared amongst all users) and need only be run on boot. For simple tasks you may instead want to add the commands to /etc/rc.local, which doesn't use the start/stop lifecycle of /etc/init.d scripts.

If the settings should be applied only for a certain user or be applied on each login, the correct place is the relevant profile for your shell (~/.profile, ~/.bash_profile, ~/.bashrc, ...) or, probably more adequate if running a desktop environment, in the session startup programs (each desktop environment sets those in their own way, but they'll be found somewhere in the system settings).

0

Please run chkconfig --list | grep mouse

It should show something like this:

mouse 0:off 1:off 2:off 3:off 4:off 5:off 6:off

If it does, it indicates that the service will not run on startup. You can make it run on startup using :

chkconfig --add mouse

OR

chkconfig --level 35 mouse on

Give it a try.

0

If you want to add something to GUI logins system-wide, the classic place to do it on Debian-like distributions would be the /etc/X11/Xsession.d/ directory. The scripts within it are executed at GUI login, as the logging-in user, just before the actual desktop environment starts up.

However, your desktop environment very likely maintains user-specific mouse settings for you; such user-specific settings will always override system-wide settings. So if your desktop environment offers a GUI tool for adjusting mouse settings, try it first: any settings made with it should be automatically remembered by the desktop environment.

If you are changing mouse sensitivity using a mouse-brand-specific command-line tool that does not have a corresponding desktop environment integration (e.g. to switch the mouse DPI setting to a different value), then the above-mentioned /etc/X11/Xsession.d/ would be a good place for it.


If you want to adjust the mouse settings for the text-console mode (and the gpm package is installed), then /etc/gpm.conf would be the place for it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .