From 127cb004e2025a5091808e36cef8a0d6493d2266 Mon Sep 17 00:00:00 2001 From: Charles Daniels Date: Thu, 11 Apr 2019 15:06:47 -0400 Subject: [PATCH] update doas.conf instructions --- README.md | 16 ++++++++++------ gmixerctl/gui.py | 7 +++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 06d5249..6d562f9 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,16 @@ the mixerctl command itself. python3 setup.py install ``` +If you would like to be able to change the output device(s) that sndiod should +use, you should add the following lines to `/etc/doas.conf`. + +``` +permit nopass youruser as root cmd /usr/sbin/rcctl args set sndiod flags -f rsnd/0 +permit nopass youruser as root cmd /usr/sbin/rcctl args set sndiod flags -f rsnd/1 +permit nopass youruser as root cmd /usr/sbin/rcctl args set sndiod flags -f rsnd/2 +permit nopass youruser as root cmd /usr/sbin/rcctl args restart sndiod +``` + ## Contributing Contributions are more than welcome. If there is a feature you would like added @@ -55,15 +65,9 @@ appreciate help implementing the following features: ## Known Issues -* Configuring sndiod requires giving the user running gmixerctl access to run - `/usr/sbin/rcctl` as root. This is overly broad, but I am unsure of the - correct way to handle this, since limiting arguments with `doas.conf` - requires knowing the exact set of arguments in advance. - * The information displayed in the "sndiod" tab does not update once the application has started. - ## Rationale My first attempt at writing gmixerctl was in the form of an imgui based C++ diff --git a/gmixerctl/gui.py b/gmixerctl/gui.py index 4b465f1..d056670 100644 --- a/gmixerctl/gui.py +++ b/gmixerctl/gui.py @@ -79,8 +79,11 @@ class SndiodButton(tkinter.Button): except Exception as e: tkinter.messagebox.showwarning( "Apply Changes", - "Failed to apply rcctl flags. Maybe you need to add" + - "\n\npermit nopass youruser as root cmd /usr/sbin/rcctl" + + "Failed to apply rcctl flags. Maybe you need to add\n" + + "permit nopass youruser as root cmd /usr/sbin/rcctl args set sndiod flags -f rsnd/0\n" + + "permit nopass youruser as root cmd /usr/sbin/rcctl args set sndiod flags -f rsnd/1\n" + + "permit nopass youruser as root cmd /usr/sbin/rcctl args set sndiod flags -f rsnd/2\n" + + "permit nopass youruser as root cmd /usr/sbin/rcctl args restart sndiod\n" + "\n\nto /etc/doas.conf ?" + "\n\nerror was:\n\n{}".format(e) ) -- 2.45.2