Skip to content

Commit

Permalink
add systemd service
Browse files Browse the repository at this point in the history
  • Loading branch information
izmyname authored and fufexan committed Feb 16, 2025
1 parent 005f0fc commit d1811e4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ add_compile_definitions(HYPRSUNSET_VERSION="${VERSION}")

message(STATUS "Configuring hyprsunset!")

configure_file(systemd/hyprsunset.service.in systemd/hyprsunset.service @ONLY)

# Get git info hash and branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
Expand Down Expand Up @@ -134,4 +136,7 @@ if(NOT DEFINED CMAKE_INSTALL_MANDIR)
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
endif()

include(GNUInstallDirs)

install(TARGETS hyprsunset)
install(FILES ${CMAKE_BINARY_DIR}/systemd/hyprsunset.service DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/user)
16 changes: 16 additions & 0 deletions systemd/hyprsunset.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=An application to enable a blue-light filter on Hyprland.
Documentation=https://wiki.hyprland.org/Hypr-Ecosystem/hyprsunset/
PartOf=graphical-session.target
Requires=graphical-session.target
After=graphical-session.target
ConditionEnvironment=WAYLAND_DISPLAY

[Service]
Type=simple
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/hyprsunset
Slice=session.slice
Restart=on-failure

[Install]
WantedBy=graphical-session.target

0 comments on commit d1811e4

Please sign in to comment.