feat(wayland): add idle inhibitor for wayland

This commit is contained in:
2025-09-21 23:46:57 -04:00
parent 6e075bff4a
commit ee2df36041
5 changed files with 301 additions and 2 deletions

View File

@@ -7,16 +7,51 @@ add_project_arguments([
srcfiles = files(
'src/main.c',
'src/led.c',
'src/wayland.c',
'src/acpi.c',
'src/utils.c'
)
# wayland stuff
wscanner = dependency('wayland-scanner', native: true)
wscanner_prog = find_program(
wscanner.get_variable('wayland_scanner'), native: true)
wayland_protocols = dependency('wayland-protocols', version: '>=1.41',
default_options: ['tests=false'])
wayland_protocols_datadir = wayland_protocols.get_variable('pkgdatadir')
wayland_client = dependency('wayland-client')
wayland_server = dependency('wayland-server')
wl_proto_c = []
wl_proto_h = []
wl_proto_xml = [
wayland_protocols_datadir / 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'
]
foreach prot : wl_proto_xml
wl_proto_h += custom_target(
prot.underscorify() + '-client-header',
input: prot,
output: '@BASENAME@.h',
command: [ wscanner_prog, 'client-header', '@INPUT@', '@OUTPUT@' ])
wl_proto_c += custom_target(
prot.underscorify() + '-private-code',
input: prot,
output: '@BASENAME@.c',
command: [ wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@' ])
endforeach
# build stuff
cc = meson.get_compiler('c')
math_dep = cc.find_library('m', required: true)
executable('eh', srcfiles,
wl_proto_c + wl_proto_h,
dependencies: [
math_dep
math_dep,
wayland_client,
wayland_server
],
include_directories: [
'lib/log.c/src',