Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Lenovo C940 with 16gb ram, 1tb ssd, running Fedora 39 Cinnamon desktop which is up to date. I am also using a wireless Logitech mouse with the dongle plugged into a type "A" usb port (there is only one type "A" port). This all works great except when the C940 is in suspend mode, the slightest movement of the mouse will awaken it. I have discovered that the following will prevent this from occurring:
Code:
sudo echo "XHC" > /proc/acpi/wakeup
However, this only works for the current session and at next boot it has to be run again. Is it possible to use the GUI "Startup Applications" to run a script containing this command? The issue there might be that to run it I need to be su. Will sudo and the subsequent password work in script? I'm not sure I want to do that even if it will. The other question is how to get the script into the "Startup Applications" list? I see no way to do that unless I edit one of the items already there.
I'm not sure if this applies, but I also have a wireless Logitech mouse and dongle and it also wakes up my system if I move it (a really old XPS laptop running Debian 12). In my case, the mouse has a small switch on the bottom that turns the power to the mouse on and off (and if it's off, no amount of moving or clicking will wake up the system). Turn the switch back on, and any movement wakes the machine. The mouse is a "Logi" model M650 L. It uses a single replaceable AA battery (not rechargable by the way).
Yes. That does work as long as I remember to switch off the mouse before closing the lid. The command in post #1 works just fine until a reboot then it has to be run again. I'm wondering how to put that command into the list of "startup application" in the "menu" "system settings" (cinnamon desktop). Thanks.
Thanks. I'll check those out.
The first thing I notice is that the video references Linux Mint. Also, this video shows only how to add an existing application to the startup menu in Linux Mint (I'm using Fedora) but it appears to work the same in this case.
However my issue is, I think, that I need to add a custom command as su (not sudo). I ran across an old comment that said clicking on Startup Applications > + > Choose Application > Add Application the system will show every application available. So, if I add an executable file somewhere will it show up and be selectable here? That seems easy enough. However, I'm not sure how to deal with the fact that I need to be su to run the command. Also, where should the executable file be stored?
Maybe there is a better way to do it?
I searched the other 5 suggestions that rokytnji offered and found nothing that appears pertinent.
I've found statements indicating that it is easy to add the command into the /etc/rc.local file which will run it at startup. These are the instructions I found:
Running a program automatically on Linux startup via rc.local
rc.local is a legacy script from the System V init system, executed before displaying a login screen for the desktop environment or terminal login prompt. It is typically a Bash shell script capable of running any commands.
To configure your rc.local script, follow these steps:
As the root user, open or create the /etc/rc.local file using your preferred editor if it doesn't exist.
Code:
$ sudo vi /etc/rc.local
Add placeholder code to the file.
#!/bin/bash
exit 0
It must start with interpreter (/bin/bash) and ends with an exit code (0 is for success)
Insert commands and logic as needed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.