Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must run as root to use #13

Open
REALERvolker1 opened this issue Dec 1, 2022 · 4 comments
Open

Must run as root to use #13

REALERvolker1 opened this issue Dec 1, 2022 · 4 comments

Comments

@REALERvolker1
Copy link

REALERvolker1 commented Dec 1, 2022

Hey there,
I just got this program, and I quickly ran into a big issue -- I have to run all of these commands as root.

This is a pretty large barrier, because it means I can't integrate this into my desktop (mouse battery bar module, scripts to quickly change settings, etc)

I looked around online for safe ways to run this without using sudo or pkexec, but I could not find a safe way to do so.

Has anyone else found a workaround for this problem? I am running Fedora 37 if that helps.
image

@korkje
Copy link
Owner

korkje commented Dec 1, 2022

I don't have a solution that I've used myself, but I briefly mentioned a potential fix here, check that out: #1

If you end up figuring this out, please let me know!

@REALERvolker1
Copy link
Author

I put the following in /etc/udev/rules.d/69-hid.rules

# Edited by vlk on 12/02/22
# Here's the guide I followed:
# https://github.com/libusb/hidapi/blob/master/udev/69-hid.rules

# Line that lets me access Glorous Model O Wireless
SUBSYSTEMS=="usb", ATTRS{idVendor}=="258a", ATTRS{idProduct}=="2011", TAG+="uaccess"

# Line that lets me access Glorious Model O Wireless when unplugged
SUBSYSTEMS=="usb", ATTRS{idVendor}=="258a", ATTRS{idProduct}=="2022", TAG+="uaccess"

No issues so far. I don't know why I did not try that beforehand, I think I was just scared I would break something.

From there I can run mow report battery | grep -o '[0-9]*' and I get the raw percentage.

Thanks a ton!

btw could you add this to the readme? I am pretty sure I am not the only person who ran into this issue.

@korkje
Copy link
Owner

korkje commented Dec 4, 2022

This is great, thanks! I'll just try it out myself too first, and I'll write it into the readme shortly 👍

@tingox
Copy link

tingox commented Aug 19, 2024

On FreeBSD, you can use a devd file like this

root@kg-core2:~ # cat /usr/local/etc/devd/gloriousominus.conf
# allow non-root users to have access to the Glorious Model O- Wireless mouse
#
# wired
notify 100 {
	match "system" "USB";
	match "subsystem" "DEVICE";
	match "type" "ATTACH";
	match "vendor" "0x258a";
	match "product" "0x2013";
# Please uncomment the line below and change the group name to suit
# your own needs.
	action "chgrp operator /dev/$cdev && chmod 660 /dev/$cdev";
};
# wireless
notify 100 {
	match "system" "USB";
	match "subsystem" "DEVICE";
	match "type" "ATTACH";
	match "vendor" "0x258a";
	match "product" "0x2024";
# Please uncomment the line below and change the group name to suit
# your own needs.
	action "chgrp operator /dev/$cdev && chmod 660 /dev/$cdev";
};

create the file and restart devd with service devd restart. You might have to unplug the dongle / moouse and plug it in again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants