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

Refactor to be sudoers-friendly (= rebase #87) #145

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hseg
Copy link

@hseg hseg commented Mar 31, 2020

Rebased version of #87.
Patch reduces the set of commands to whitelist down to one.
Also, it changes the calling convention used by the PM unit from setting an
envvar to passing a fixed string.

Some misc shellcheck warnings are also cleaned up, most significantly:

  • quoting in the dry run code
  • quoting in the command line construction
  • the fresh display search code (avoiding parsing ls output)

Note: implementation nonessentially uses Bash 4 features.
With minor duplication, older bashes can be supported.

@Nathoufresh
Copy link

Nathoufresh commented May 8, 2020

Great work!
It works well on my manjaro install I use it daily.

For those who wanna try here's a PKGBUILD.
And don't forget to add %users ALL=(root) NOPASSWD:/usr/bin/nvidia-toggle at the end of you sudoers file.

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

Successfully merging this pull request may close these issues.

3 participants