RaulPPelaez / Naga_KeypadMapper

This little linux xorg daemon allows you to map the side keypad of the Razer Naga series mice via a configuration file called mapping.txt under $HOME/.naga/
Other
105 stars 32 forks source link

A better placement for autostart on boot script (Daemon prevents Spacemacs from booting) #37

Closed ipsod closed 6 years ago

ipsod commented 7 years ago

This is weird, but the daemon seems to be preventing Spacemacs from launching. When I try to open Spacemacs, it hangs, and in my system monitor I see that there's a second instance of "naga" running (maybe in Spacemacs'/emacs' shell environment?).

This is a really odd problem - any idea how to fix it?

ipsod commented 7 years ago

I fixed this by removing /usr/local/bin/nagastart.sh & from my ~/.profile, and adding a symlink to the script in ~/.config/autostart-scripts on Linux Mint KDE 17.2. If that works on other distros, it might be preferable.

apocatarsis commented 7 years ago

Yep, .profile seems problematic altogether, I did not know a good distro-independent way of auto starting a script on boot. Lets see if someone using other distro can confirm your way is better. Thanks!

Destroyer commented 7 years ago

I was studying this issue and the most correct way still seems to be .config/autostart. As soon as systemd will support graphical-session.target that should solve the issue once and for all systemd distros.

apocatarsis commented 7 years ago

I think that was my initial approach (in fact there is still a naga.desktop file). But it is marked as "Only works in Ubuntu". I seem to recall that it was due to a permission issue?. Maybe it will work now.

Destroyer commented 7 years ago

In Debian that works as well, but I did not check other distros.

Ameliorate commented 6 years ago

~/.config/autostart is the proper solution, however some window managers expect the user to write scripts to execute the .desktop files manually. You should not try to automatically support window managers however. Just printing out a warning like echo "Some window managers do not support ~/.config/autostart. Please add nagastart.sh to be executed when your window manager starts." is enough.

~/.profile is always the wrong solution. Many programs will silently break if commands in ~/.profile write to stdout or stderr, since ~/.profile is executed every time a shell session is started, regardless of what program started that shell.

apocatarsis commented 6 years ago

Ok @Ameliorate I followed you suggestion, lets see how it goes. Now .profile is not modified and naga.desktop is copied to autostart. I pushed a bunch of commits.