Skip to content

Commit

Permalink
Install to /lib/systemd/system-sleep if the distribution patches systemd
Browse files Browse the repository at this point in the history
This fixes suspend behaviour on Ubuntu

Fixes milgner#16
  • Loading branch information
arichardson committed Nov 10, 2016
1 parent 0a70b6a commit a6f58e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ if(INSTALL_UDEV_RULE)
endif()
if(INSTALL_SYSTEMD_SLEEP_SCRIPT)
configure_file(k290-fnkeyctl.sh.in ${CMAKE_CURRENT_BINARY_DIR}/k290-fnkeyctl.sh @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/k290-fnkeyctl.sh DESTINATION /usr/lib/systemd/system-sleep/)
if(IS_DIRECTORY /usr/lib/systemd/system-sleep/)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/k290-fnkeyctl.sh DESTINATION /usr/lib/systemd/system-sleep/)
endif()
# some distributions (e.g. Ubuntu) patch systemd to use /lib/systemd/system-sleep/ instead
if(IS_DIRECTORY /lib/systemd/system-sleep/)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/k290-fnkeyctl.sh DESTINATION /lib/systemd/system-sleep/)
endif()
endif()

if(INSTALL_PM_UTILS_SLEEP_SCRIPT)
configure_file(20-k290.sh.in ${CMAKE_CURRENT_BINARY_DIR}/20-k290.sh @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/20-k290.sh DESTINATION /etc/pm/sleep.d/)
Expand Down

0 comments on commit a6f58e9

Please sign in to comment.