diff --git a/install.sh b/install.sh index f1add76..ce30a29 100755 --- a/install.sh +++ b/install.sh @@ -67,10 +67,10 @@ echo "$DISPLAY" | sudo tee -a /etc/systemd/system/naga.service.d/naga.conf > /de sudo udevadm control --reload-rules && sudo udevadm trigger sleep 0.5 -sudo cat /etc/sudoers | grep -qxF "razerInput ALL=($USER) ALL" || printf "\nrazerInput ALL=($USER) ALL\n" | sudo EDITOR='tee -a' visudo > /dev/null +sudo cat /etc/sudoers | grep -qxF "razerInput ALL=($USER) NOPASSWD:ALL" || printf "\nrazerInput ALL=(%s) NOPASSWD:ALL\n" "$USER" | sudo EDITOR='tee -a' visudo > /dev/null grep -qF 'xhost +SI:localuser:razerInput' ~/.profile || printf "\nxhost +SI:localuser:razerInput\n" >> ~/.profile -sudo touch /home/razerInput/.profile && grep -qxF "export PATH=\`sudo -u $USER echo \$PATH\`" /home/razerInput/.profile || echo "export PATH=\`sudo -u $USER echo \$PATH\`" | sudo tee -a /home/razerInput/.profile > /dev/null -sudo -u razerInput bash -c "export PATH=$PATH" +sudo printf '#!/bin/sh\nexport PATH=$(sudo -u %s echo $PATH)' "$USER" | sudo tee /usr/local/bin/Naga_Linux/nagaPathExport.sh > /dev/null +sudo chmod 755 /usr/local/bin/Naga_Linux/nagaPathExport.sh xhost +SI:localuser:razerInput sudo systemctl enable naga diff --git a/src/nagaX11.cpp b/src/nagaX11.cpp index d0d9f64..7087394 100644 --- a/src/nagaX11.cpp +++ b/src/nagaX11.cpp @@ -536,6 +536,7 @@ int main(const int argc, const char *const argv[]) if (strstr(argv[1], "serviceHelper") != NULL) { (void)!(system("/usr/local/bin/Naga_Linux/nagaXinputStart.sh")); + (void)!(system("/usr/local/bin/Naga_Linux/nagaPathExport.sh")); if (argc > 2) NagaDaemon(string(argv[2]).c_str()); else