From 4b06e8405168b9d1b14dff180da1f8c48d0b3965 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Mon, 13 Jun 2022 20:14:56 +0300 Subject: [PATCH] add systemd service for changing ownership of huawei-wmi files --- bin/chown-huawei-wmi.sh | 10 ++++++++++ systemd/huawei-wmi-owner.service | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100755 bin/chown-huawei-wmi.sh create mode 100644 systemd/huawei-wmi-owner.service diff --git a/bin/chown-huawei-wmi.sh b/bin/chown-huawei-wmi.sh new file mode 100755 index 0000000..b29d827 --- /dev/null +++ b/bin/chown-huawei-wmi.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +readonly WMI=/sys/devices/platform/huawei-wmi + +echo "started" + +echo "$(/bin/whoami)" + +chmod g+w "$WMI/leds/platform::micmute/brightness" +chown root:huawei-wmi "$WMI/leds/platform::micmute/brightness" diff --git a/systemd/huawei-wmi-owner.service b/systemd/huawei-wmi-owner.service new file mode 100644 index 0000000..270d58c --- /dev/null +++ b/systemd/huawei-wmi-owner.service @@ -0,0 +1,10 @@ +[Unit] +Description=Huawei WMI Privilege (other) +After=sys-devices-platform-huawei\x2dwmi.device + +[Service] +Type=oneshot +ExecStart=/home/daniil/dotfiles/bin/chown-huawei-wmi.sh + +[Install] +WantedBy=sys-devices-platform-huawei\x2dwmi.device