07-16-2020, 01:14 PM
(This post was last modified: 07-16-2020, 01:27 PM by mamboman777.)
(07-06-2020, 06:32 PM)squidd Wrote: also, a TL;DR for the scriptI am probably the one to blame, but in looking at your TL;DR there are a few changes that need to be made:
sudo nano /usr/bin/nvmelowpower.sh
#!/bin/sh sudo nvme set-feature /dev/nvme0 -f 2 -v 2
sudo nano /usr/bin/nvmehighpower.sh
#!/bin/sh sudo nvme set-features /dev/nvme0 - 2 -v 0
sudo nano /etc/sudoers
username ALL=(ALL) NOPASSWD: /usr/bin/nvme
sudo chmod a+x /usr/bin/nvmelowpower.sh
sudo chmod a+x /usr/bin/nvmehighpower.sh
open KDE System settings power management menu
Under the "On AC Power" tab under "Run Script" entered the script "/usr/bin/nvmehighpower.sh"
Under the "On Battery" tab under "run Script" enter "/usr/bin/nvmelowpower.sh"
the nvmehighpower.sh script needs to contain "sudo nvme set-feature /dev/nvme0 -f 2 -v 0" instead of what's there.
The corrected Tl;
Code:
sudo nano /usr/bin/nvmelowpower.sh
Code:
#!/bin/sh
sudo nvme set-feature /dev/nvme0 -f 2 -v 2
Power State 0 is full power, 1 is less and slower, 2 is even less and slower and on my drive power states 3 and 4 are non-operational. I have used the following as a compromise:
Code:
#!/bin/sh
sudo nvme set-feature /dev/nvme0 -f 2 -v 1
Ctrl + X to exit then enter to save.
Code:
sudo nano /usr/bin/nvmehighpower.sh
Code:
#!/bin/sh
sudo nvme set-feature /dev/nvme0 -f 2 -v 0
Ctrl + X to exit and Enter to save.
Code:
sudo nano /etc/sudoers
At the bottom of the file add substituting username with your actual username:
Code:
username ALL=(ALL) NOPASSWD: /usr/bin/nvme
Ctrl+X to exit and enter to save.
Code:
sudo chmod a+x /usr/bin/nvmelowpower.sh
Code:
sudo chmod a+x /usr/bin/nvmehighpower.sh
At this point I test each script to make sure they are working correctly. For example, on my system it looks like this:
Code:
[user@pinebookpro ~]$ /usr/bin/nvmehighpower.sh
set-feature:02 (Power Management), value:00000000
[user@pinebookpro ~]$ /usr/bin/nvmelowpower.sh
set-feature:02 (Power Management), value:0x000001
open KDE System settings power management menu
Under the "On AC Power" tab under "Run Script" entered the script "/usr/bin/nvmehighpower.sh"
Under the "On Battery" tab under "run Script" enter "/usr/bin/nvmelowpower.sh"