Comments (8)
you can try
# useradd -m -d /mnt/bar foo
# adduser foo sudo
# su foo
$ cd ~
$ echo "echo $SUDO_USER" > test.sh
$ sudo sh test.sh
workaround is to rewrite script in way that part of it could run with regular user rights (that part would create stuff for user) and the rest of the installation script would ask you for root
from naga_keypadmapper.
Sorry, I did not explain myself well. In the install script I just changed the HOME variable using getent passwd $SUDO_USER. So that is ok. But yeah, as you have root you can just su USER. Good idea, I will keep it in mind.
I meant in naga.cpp, you need to read the configuration from $HOME of the user, but with getenv you get home of root (is this true btw?). I changed so the mapping.txt is read from /home/$SUDO_USER/.naga . But this is not necessarily general.
from naga_keypadmapper.
BTW, I am not able to autostart it. Calling naga at the end of nagastart doesnt seem to be enough. And calling sudo naga asks for password, so you cannot auto start it. Any ideas?.
For the moment I am just starting it manually with nohup sudo nagastart.sh > /dev/null
from naga_keypadmapper.
- It depends on who owns the process(in most cases). If it's run via root it will check default variable $HOME of root (if not set otherwise). And since we start this tool (at least in ubuntu) with autostart in users profile and the process that starts it owns the user, it does uses his home.
Also I don't think that you need any tweaking of the executable, if you want to specify HOME for naga executable you can edit nagastart.sh to includeexport HOME=path
and put whatever you need there (if you're the only user, otherwise you need to call it from somewhere else, child processes will share these env variables). - I've made it so that sudo shouldn't be neccessary. Either you can chmod the naga events in /dev/input with
chmod o+r
or you use this https://github.com/apocatarsis/Naga_KeypadMapper/blob/master/install.sh#L46-L48
either way the executable should work without root privileges, that was my intention
from naga_keypadmapper.
- Yeah the export HOME is much secure. I'll change it.
- Oh really? I'll check later, not needing root would be dope!
from naga_keypadmapper.
Ok so now I am a bit lost. Please give me a hand whenever you can. I think I may screwed up a little. Using the current master:
1. Where does the install.sh copy mapping.txt?, /root/.naga or /home/user/.naga??
2. Where does naga.cpp looks for mapping.txt?, in /root/.naga or /home/user/.naga??
I think the problem with the user in the other issue could be related to this.
Thank you very much Destroyer. I appologize for the inconvinience..
from naga_keypadmapper.
- I thought you should know since you've pushed this commit, but afaik it should copy mapping.txt to home/user/.naga (but I dunno why using this complicated syntax)
- As I've said it depends if it's ran by root it looks at /root/ (or $HOME of root) and if it's ran by regular user it looks at /home/user (or $HOME of the user). If it's ran via installation script it will look for mapping in home of that user.
but from what I can see I should push merge from testlab as soon as possible so that I can work on just one version and not two
edit: merged
I've also removed testlab branch in order to prevent issues with merging and commiting as it's not needed right now.
from naga_keypadmapper.
I am closing this ticket now, if you need more help, just reopen it.
from naga_keypadmapper.
Related Issues (20)
- You guys are gods HOT 2
- run= runs 2x the same thing somehow HOT 15
- Xinput not detecting naga 2014 on ubuntu 17.10 HOT 1
- Assigning a key to "Space" makes entire computer lag HOT 3
- unintended keystrokes recorded with xev on Ubuntu 17.10 HOT 1
- Syntax for Numpad HOT 1
- "No naga devices found or you don't have permission to access them." When run the nagastart.sh HOT 1
- Not executing the same key twice with delay HOT 1
- Naga Chroma can't map 2 top buttons (back and forward) HOT 2
- Support on Wayland ? HOT 2
- buttons 13 and 14 can't detect release HOT 2
- Buttons 13 and 14 still do their original actions HOT 5
- Naga, back forward buttons wont remap
- Input lag HOT 4
- Xinput not disabling default keypad input
- Getting Syntax Error HOT 1
- Remake HOT 1
- nagastart.sh aborts immediately after launching.
- Support for Razer Naga X HOT 1
- No naga devices found or you don't have permission to access them. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from naga_keypadmapper.