Skip to content

Commit

Permalink
fix(Suspend): Add restart service for InputPlumber after resume.
Browse files Browse the repository at this point in the history
  • Loading branch information
pastaq committed May 2, 2024
1 parent 1d8cd69 commit d252c00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ assets = [
{ source = "target/release/inputplumber", dest = "/usr/bin/inputplumber", mode = "755" },
{ source = "rootfs/usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf", dest = "/usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf", mode = "644" },
{ source = "rootfs/usr/lib/systemd/system/inputplumber.service", dest = "/usr/lib/systemd/system/inputplumber.service", mode = "644" },
{ source = "rootfs/usr/lib/systemd/system/inputplumber-resume.service", dest = "/usr/lib/systemd/system/inputplumber-resume.service", mode = "644" },
{ source = "rootfs/usr/share/inputplumber/devices/*.yaml", dest = "/usr/share/inputplumber/devices/", mode = "644" },
{ source = "rootfs/usr/share/inputplumber/schema/*.json", dest = "/usr/share/inputplumber/schema/", mode = "644" },
{ source = "rootfs/usr/share/inputplumber/capability_maps/*.yaml", dest = "/usr/share/inputplumber/capability_maps/", mode = "644" },
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ install: build ## Install inputplumber to the given prefix (default: PREFIX=/usr
$(PREFIX)/bin/$(NAME)
install -D -m 644 rootfs/usr/share/dbus-1/system.d/$(DBUS_NAME).conf \
$(PREFIX)/share/dbus-1/system.d/$(DBUS_NAME).conf
install -D -m 644 rootfs/usr/lib/systemd/system/$(NAME).service \
$(PREFIX)/lib/systemd/system/$(NAME).service
install -D -m 644 -t $(PREFIX)/usr/lib/systemd/system/ \
rootfs/lib/systemd/system/*
install -D -m 644 rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb \
$(PREFIX)/lib/udev/hwdb.d/59-inputplumber.hwdb
install -D -m 644 -t $(PREFIX)/share/$(NAME)/devices/ \
Expand All @@ -67,6 +67,7 @@ uninstall: ## Uninstall inputplumber
rm $(PREFIX)/bin/$(NAME)
rm $(PREFIX)/share/dbus-1/system.d/$(DBUS_NAME).conf
rm $(PREFIX)/lib/systemd/system/$(NAME).service
rm $(PREFIX)/lib/systemd/system/$(NAME)-resume.service
rm $(PREFIX)/lib/udev/hwdb.d/59-inputplumber.hwdb
rm -rf $(PREFIX)/share/$(NAME)/devices/
rm -rf $(PREFIX)/share/$(NAME)/schema/
Expand Down
10 changes: 10 additions & 0 deletions rootfs/usr/lib/systemd/system/inputplumber-resume.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Restart InputPlumber after resume
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/bin/systemctl --no-block restart inputplumber.service

[Install]
WantedBy=suspend.target

0 comments on commit d252c00

Please sign in to comment.