Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-desktop - replace contents to rely on uwsm to start a systemd session. Remove hyprland-session.service #8376

Merged
merged 5 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,15 @@ if(NO_SYSTEMD)
else()
message(STATUS "SYSTEMD support is requested (NO_SYSTEMD not defined)...")
add_compile_definitions(USES_SYSTEMD)
configure_file(systemd/hyprland-session.service.in
systemd/hyprland-session.service @ONLY)

# session file -systemd
install(FILES ${CMAKE_SOURCE_DIR}/systemd/hyprland-systemd.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/wayland-sessions)

# install systemd service
install(FILES ${CMAKE_BINARY_DIR}/systemd/hyprland-session.service
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/user)
# session file -uwsm
if(NO_UWSM)
message(STATUS "UWSM support is disabled...")
else()
message(STATUS "UWSM support is enabled (NO_UWSM not defined)...")
install(FILES ${CMAKE_SOURCE_DIR}/systemd/hyprland-uwsm.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/wayland-sessions)
endif()
endif()

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
Expand Down
8 changes: 6 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ backtrace_dep = cpp_compiler.find_library('execinfo', required: false)
epoll_dep = dependency('epoll-shim', required: false) # timerfd on BSDs

# Handle options
if get_option('systemd').enabled()
systemd = dependency('systemd')
systemd_option = get_option('systemd')
systemd = dependency('systemd', required: systemd_option)
systemd_option.enable_auto_if(systemd.found())

if (systemd_option.enabled())
message('Enabling systemd integration')
add_project_arguments('-DUSES_SYSTEMD', language: 'cpp')
subdir('systemd')
endif
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
option('systemd', type: 'feature', value: 'auto', description: 'Enable systemd integration')
option('uwsm', type: 'feature', value: 'enabled', description: 'Enable uwsm integration (only if systemd is enabled)')
option('legacy_renderer', type: 'feature', value: 'disabled', description: 'Enable legacy renderer')
option('tracy_enable', type: 'boolean', value: false , description: 'Enable profiling')
2 changes: 1 addition & 1 deletion nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ in
(mapAttrsToList mesonEnable {
"xwayland" = enableXWayland;
"legacy_renderer" = legacyRenderer;
"systemd" = withSystemd;
"uwsm" = false;
})
(mapAttrsToList mesonBool {
"b_pch" = false;
Expand Down
16 changes: 0 additions & 16 deletions systemd/hyprland-session.service.in

This file was deleted.

7 changes: 0 additions & 7 deletions systemd/hyprland-systemd.desktop

This file was deleted.

6 changes: 6 additions & 0 deletions systemd/hyprland-uwsm.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Name=Hyprland (uwsm-managed)
Comment=An intelligent dynamic tiling Wayland compositor
Exec=uwsm start -N Hyprland -D Hyprland -C An_intelligent_dynamic_tiling_Wayland_compositor -- Hyprland
DesktopNames=Hyprland
Type=Application
24 changes: 7 additions & 17 deletions systemd/meson.build
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
install_data(
'hyprland-systemd.desktop',
install_dir: join_paths(get_option('datadir'), 'wayland-sessions'),
install_tag: 'runtime',
)

conf_data = configuration_data()
conf_data.set('PREFIX', get_option('prefix'))
conf_data.set('BINDIR', get_option('bindir'))
user_unit_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir',
pkgconfig_define: ['prefix', get_option('prefix')])

configure_file(
configuration: conf_data,
input: 'hyprland-session.service.in',
output: '@BASENAME@',
install_dir: user_unit_dir )
if (get_option('uwsm').allowed())
install_data(
'hyprland-uwsm.desktop',
install_dir: join_paths(get_option('datadir'), 'wayland-sessions'),
install_tag: 'runtime',
)
endif
Loading