-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move conservation mode scripts to pkexec she-bang, allowing all users…
… to run them
- Loading branch information
Showing
5 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
#!/usr/bin/pkexec /usr/bin/env bash | ||
echo -n "0" | tee /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
#!/usr/bin/pkexec /usr/bin/env bash | ||
echo -n "1" | tee /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
#!/usr/bin/pkexec /usr/bin/env bash | ||
cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ polkit.addRule(function(action, subject) { | |
return polkit.Result.YES; | ||
} | ||
}); | ||
|
17 changes: 17 additions & 0 deletions
17
config/files/usr/etc/polkit-1/rules.d/conservationmode.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Allow members of the wheel group to execute the defined actions | ||
* without password authentication, similar to "sudo NOPASSWD:" | ||
*/ | ||
polkit.addRule(function(action, subject) { | ||
if ( | ||
(action.id == "org.projectatomic.rpmostree1.upgrade") && | ||
( | ||
action.lookup("program") == "/usr/bin/conservationmodeon" || | ||
action.lookup("program") == "/usr/bin/conservationmodeoff" || | ||
action.lookup("program") == "/usr/bin/conservationmodestatus" | ||
) | ||
) | ||
{ | ||
return polkit.Result.YES; | ||
} | ||
}); | ||
|