Skip to content

Commit

Permalink
Lock uwsm desktop file behind feature flag
Browse files Browse the repository at this point in the history
The file in the repo cannot be used in NixOS due to missing full paths,
and the fact that `uwsm` does not have access to `PATH` to find the
listed binaries. Might be useful in other situations as well.
  • Loading branch information
fufexan committed Nov 11, 2024
1 parent 41a93c4 commit bec6b05
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,13 @@ else()
add_compile_definitions(USES_SYSTEMD)

# session file -uwsm
install(FILES ${CMAKE_SOURCE_DIR}/systemd/hyprland-uwsm.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/wayland-sessions)
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
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ epoll_dep = dependency('epoll-shim', required: false) # timerfd on BSDs
systemd_option = get_option('systemd')
systemd = dependency('systemd', required: systemd_option)
systemd_option.enable_auto_if(systemd.found())
get_option('uwsm').enable_auto_if(systemd_option.allowed())

if (systemd_option.enabled())
message('Enabling systemd integration')
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: 'auto', 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')
12 changes: 7 additions & 5 deletions systemd/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
install_data(
'hyprland-uwsm.desktop',
install_dir: join_paths(get_option('datadir'), 'wayland-sessions'),
install_tag: 'runtime',
)
if (get_option('uwsm'))
install_data(
'hyprland-uwsm.desktop',
install_dir: join_paths(get_option('datadir'), 'wayland-sessions'),
install_tag: 'runtime',
)
endif

0 comments on commit bec6b05

Please sign in to comment.