Add elksmart-comm for transceiving infrared codes
All checks were successful
Alpine 3.20 Success
OpenBSD 7.5 Success

The receive functionality is quite unstable,
however useful enough for something that is officially unsupported.

The gadget is picky about cables,
but it has ridiculous reach when it works.
This commit is contained in:
2024-08-27 20:36:50 +02:00
parent fbc7454647
commit 9e91058ed9
5 changed files with 716 additions and 6 deletions

View File

@@ -19,13 +19,15 @@ find_package (PkgConfig REQUIRED)
pkg_check_modules (x REQUIRED x11 xext xextproto)
pkg_check_modules (pulse REQUIRED libpulse)
pkg_check_modules (dbus REQUIRED dbus-1)
pkg_check_modules (libusb libusb-1.0)
pkg_check_modules (gdm gdm glib-2.0 gio-2.0)
include_directories (
${x_INCLUDE_DIRS} ${pulse_INCLUDE_DIRS} ${dbus_INCLUDE_DIRS})
link_directories (
${x_LIBRARY_DIRS} ${pulse_LIBRARY_DIRS} ${dbus_LIBRARY_DIRS})
option (WITH_GDM "Compile with GDM support" ${gdm_FOUND})
option (WITH_USB "Compile with USB utilities" ${libusb_FOUND})
option (WITH_GDM "Compile with GDM utilities" ${gdm_FOUND})
# Generate a configuration file
configure_file (${PROJECT_SOURCE_DIR}/config.h.in
@@ -57,10 +59,16 @@ target_link_libraries (wmstatus
${x_LIBRARIES} ${pulse_LIBRARIES} ${dbus_LIBRARIES})
add_threads (wmstatus)
if (WITH_USB)
add_executable (elksmart-comm elksmart-comm.c)
target_include_directories (elksmart-comm PUBLIC ${libusb_INCLUDE_DIRS})
target_link_directories (elksmart-comm PUBLIC ${libusb_LIBRARY_DIRS})
target_link_libraries (elksmart-comm ${libusb_LIBRARIES})
endif ()
if (WITH_GDM)
include_directories (${gdm_INCLUDE_DIRS})
link_directories (${gdm_LIBRARY_DIRS})
add_executable (gdm-switch-user gdm-switch-user.c)
target_include_directories (gdm-switch-user PUBLIC ${gdm_INCLUDE_DIRS})
target_link_directories (gdm-switch-user PUBLIC ${gdm_LIBRARY_DIRS})
target_link_libraries (gdm-switch-user ${gdm_LIBRARIES})
endif ()
@@ -95,7 +103,7 @@ endif ()
# These should be accessible by users, but need to touch system devices.
# Use the setuid bit, for simplicity.
foreach (target brightness input-switch)
foreach (target brightness input-switch elksmart-comm)
if (${target} IN_LIST targets)
list (REMOVE_ITEM targets ${target})
install (TARGETS ${target} DESTINATION ${CMAKE_INSTALL_BINDIR}