fix(ideapad-conservation-mode): use bind action in udev rule instead of add|change to avoid boot race (#61)
This commit is contained in:
@@ -62,7 +62,7 @@ local function readState()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function render(on, enabled)
|
local function render(on, enabled)
|
||||||
shortcut.setLabel(noctalia.tr(if on then "shortcut.on" else "shortcut.off"))
|
shortcut.setLabel(noctalia.tr("shortcut.label"))
|
||||||
shortcut.setIcon("battery-charging", "battery")
|
shortcut.setIcon("battery-charging", "battery")
|
||||||
shortcut.setActive(on)
|
shortcut.setActive(on)
|
||||||
shortcut.setEnabled(enabled)
|
shortcut.setEnabled(enabled)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
id = "lux/ideapad-conservation-mode"
|
id = "lux/ideapad-conservation-mode"
|
||||||
name = "IdeaPad Conservation Mode"
|
name = "IdeaPad Conservation Mode"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
plugin_api = 3
|
plugin_api = 3
|
||||||
author = "lux"
|
author = "lux"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ usermod -aG "$GROUP_NAME" "$TARGET_USER"
|
|||||||
|
|
||||||
echo "Writing $RULE_FILE..."
|
echo "Writing $RULE_FILE..."
|
||||||
cat >"$RULE_FILE" <<EOF
|
cat >"$RULE_FILE" <<EOF
|
||||||
ACTION=="add|change", SUBSYSTEM=="platform", DRIVER=="ideapad_acpi", RUN+="$CHGRP_BIN $GROUP_NAME /sys%p/conservation_mode", RUN+="$CHMOD_BIN 664 /sys%p/conservation_mode"
|
ACTION=="bind", SUBSYSTEM=="platform", DRIVER=="ideapad_acpi", RUN+="$CHGRP_BIN $GROUP_NAME /sys%p/conservation_mode", RUN+="$CHMOD_BIN 664 /sys%p/conservation_mode"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Reloading udev rules..."
|
echo "Reloading udev rules..."
|
||||||
udevadm control --reload-rules
|
udevadm control --reload-rules
|
||||||
udevadm trigger --subsystem-match=platform
|
udevadm trigger --action=bind --subsystem-match=platform
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
},
|
},
|
||||||
"shortcut": {
|
"shortcut": {
|
||||||
"na": "Conservation N/A",
|
"na": "Conservation N/A",
|
||||||
"off": "Conservation",
|
"label": "Conservation"
|
||||||
"on": "Conservation"
|
|
||||||
},
|
},
|
||||||
"title": "Conservation mode"
|
"title": "Conservation mode"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user