From 546d2209a7e07e88913e54f5458d44a66459d580 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Tue, 12 May 2020 19:12:38 -0500 Subject: [PATCH] Add polkit rule to enable modemamanger for users in group plugdev --- Makefile | 3 +++ configs/00-sxmo.rules | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 configs/00-sxmo.rules diff --git a/Makefile b/Makefile index 6f4dbeb..dab9a77 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ install: programs/sxmo_setpineled programs/sxmo_setpinebacklight programs/sxmo_s mkdir -p $(PREFIX)/etc/alsa/conf.d/ cp configs/alsa_sxmo_enable_dmix.conf $(PREFIX)/etc/alsa/conf.d/ + mkdir -p $(PREFIX)/etc/polkit-1/rules.d + cp configs/00-sxmo.rules $(PREFIX)/etc/polkit-1/rules.d/ + mkdir -p $(PREFIX)/usr/bin cp scripts/*/* $(PREFIX)/usr/bin diff --git a/configs/00-sxmo.rules b/configs/00-sxmo.rules new file mode 100644 index 0000000..c1b52dd --- /dev/null +++ b/configs/00-sxmo.rules @@ -0,0 +1,7 @@ +polkit.addRule(function(action, subject) { + if (action.id.indexOf("org.freedesktop.ModemManager1.") == 0 && + subject.isInGroup("plugdev")) { + + return polkit.Result.YES; + } +});