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

A fix to some of the bugs listed - autostarting, revving, boot hang, etc #47

Open
AtomicRobotMan0101 opened this issue Nov 20, 2022 · 2 comments

Comments

@AtomicRobotMan0101
Copy link

AtomicRobotMan0101 commented Nov 20, 2022

Using Mint Cinnamon 22 on an MSI 62GP 7REX.

Had all the problems people were highlighting in various bugs, namely:

-- 100% revving of the CPU
-- flooding of the various logs with messages from USB to keyboard
-- logs were ballooning (hhuuuuugggeee)
-- Startup hung for 120 seconds (sometimes up to 180)
-- keyboard flickering

From a terminal prompt, I checked the problems with systemd-analyze blame. This gives one a spectacular insight into how the machine boots and what is chewing all the time/resources.

Also watching journalctl -f will show one the inner thoughts of what the system does real time.

The very worst thing? The bugs above were intermittent. They were sporadic and unpredictable. The system would behave for 3 days then BANG! It was maddening!

I also read all the bugs here, both opened and closed. I do not blame the solution provided by Gibtnix, as the root cause seemed to be some sort of hardware thing where the keyboard made an exponential demand on the USB bus and system calls for "something or other". What triggered it? FIIK.

This is what I did to fix my issues.

I'm hoping others can either use my info to fix their problems or gain an insight (I am NOT an experienced Linux user. My solution is bound to be considered sinful/heresy/stupid and I don't know what I'm doing, so think before implementing it. Read up on Dangerous Things such as using visudo). Anyone with expertise, PLEASE feel free to criticise, fix, smooth or whatever to make this "safe".

-- Either don't use the provided autostart.sh script or if you have run it, use it to remove the various doings it does, via autostart.sh --disable .... the script is clear, but for some reason the use of the UDEV user and the inclusion of /etc/udev/rules.d/90-msiklm.rules causes the system to occasionally (and unpredictably) go completely mad (??).

-- I changed the sudo file so that when I ran sudo msiklm green I was not asked for a password. I do not know the ramifications of this, but it worked....

1 - sudo visudo to edit the sudo file
2 - add this at the end of file: YourUserName ALL=(ALL) NOPASSWD: /usr/local/bin/msiklm

-- Reboot. Things should be smooth and fast now.

-- Adding an entry to the autostart. On Mint Cinnamon Vanessa this is called Startup Applications (see screenshot below). I added a new script (+), added the blurbs and added this to the Command box: sudo msiklm green. Save it.

-- Click the cogs below and your keyboard should obey. GREEN!
-- Close everything and reboot to test.

notes

-- change the preferred colour in the autostart to match the paramaters that suit your colour choices, per MSIKLM doco.
-- keyboard will only change from the default (red) to your choice upon logging on
-- works if you use the Automatic Login option for users. :)
-- I did the sudo-no-password thing for this program as it demanded the use of sudo to run. I assumed this was because it was doing some systems hardware-call devilry. I further assumed it was because the sudo-ness was out of the hands of the developer and/or due the programs location. I've no skill with this and perhaps the msiklm could have been simply moved to Home? (IDK)

Screenshot from 2022-11-21 01-32-14

@AtomicRobotMan0101
Copy link
Author

AtomicRobotMan0101 commented Nov 25, 2022

An extra note.

I found that sometimes when using the lappie (MSI 62GPM 7REX) that waking up it was defaulted to RED. The above startup didn't always run (???) so I added a script to /usr/lib/systemd/system-sleep

At the prompt, in the directory above, type sudo -s (this gives one a special kind of sudo) and then nano DoThisOnWakup.sh.

I called it DoThisOnWakeup.sh (the name isn't relevant, it can be called anything).

This is the script:

#!/bin/sh

case $1 in
    post)
        sudo /usr/local/bin/msiklm green
;;
esac

Ctrl-o (to save), Ctrl-x (to exit) then type chmod +x DoThisOnWakeup.sh which will make it executable.

Bingo. All done. When thy machine sleeps or hibernates, it should go to the colour you've chosen.

One can check to see this working (besides the keyboard turning green!) by viewing the journalctl log out with journalctl -f | grep msiklm. Leave the terminal open when you test (close/open lid, log in) and the action should be listed.

As always, I'm worse than a newbie and probably made 1000 errors here, if so and you can correct my ignorance, please feel free to do so!

@Gibtnix
Copy link
Owner

Gibtnix commented Nov 25, 2022

Thanks for your comments. Sometimes, it is also worth trying to add a short sleep before the actual command. I don't know why, but at least according to my tests, it can fix a not-always-working auto-setting. Just give sleep 3 or sleep 5 a try.

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

2 participants