Add package target

pull/3/head
Werner Sembach 4 years ago
parent ab3a683a05
commit 1c4ae73518

@ -7,3 +7,16 @@ pkg_check_modules(deps REQUIRED IMPORTED_TARGET gio-2.0 udev)
add_executable(tuxedo-touchpad-switch tuxedo-touchpad-switch.cpp)
target_link_libraries(tuxedo-touchpad-switch udev PkgConfig::deps)
install(TARGETS tuxedo-touchpad-switch DESTINATION bin/)
install(FILES res/99-tuxedo-touchpad-switch.rules DESTINATION lib/udev/rules.d/)
install(FILES res/tuxedo-touchpad-switch.desktop DESTINATION /etc/xdg/autostart/) # absolute path on purpose for this file only:
# $XDG_CONFIG_DIRS dos not include a folder under /usr/ by default
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
SET(CPACK_GENERATOR DEB RPM)
SET(CPACK_PACKAGE_CONTACT "Werner Sembach <tux@tuxedocomputers.com>")
SET(CPACK_PACKAGE_VERSION 0.0.1)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hardware toggle for Tongfang/Uniwill i2c touchpads. This will toggle the touchpad-disabled-led.")
SET(CPACK_DEBIAN_PACKAGE_SECTION admin)
include(CPack)

@ -6,8 +6,7 @@ It comes with some known disfuctionalities:
- only works on desktop evnironments using gsettings/gio
- does not work on loginscreen(gdm)
- needs to be started for every user seperatly
- no script/package to setup autostart
- every user needs write access to the /dev/hidraw* device for the touchpad (udev *.rules giving read and write access included, could be trimmed down to write only)
- every user needs write access to the /dev/hidraw* device for the touchpad (udev *.rules included)
- switching between 2 users is not detected (on next toggle the software and hardware disable will be in sync again however)
Author: Werner Sembach

@ -1 +1 @@
KERNELS=="i2c-UNIW0001:00", SUBSYSTEMS=="i2c", DRIVERS=="i2c_hid", ATTRS{name}=="UNIW0001:00", SUBSYSTEM=="hidraw", MODE="0666"
KERNELS=="i2c-UNIW0001:00", SUBSYSTEMS=="i2c", DRIVERS=="i2c_hid", ATTRS{name}=="UNIW0001:00", SUBSYSTEM=="hidraw", MODE="0622"

@ -1,10 +0,0 @@
[Unit]
Description=TUXEDO Touchpad Switch
After=gdm.service
[Service]
User=gdm
ExecStart=/usr/bin/tuxedo-touchpad-switch
[Install]
WantedBy=gdm.service

@ -104,7 +104,7 @@ void send_events_handler(GSettings *settings, const char* key, __attribute__((un
}
for (auto it = devnodes.begin(); it != devnodes.end(); ++it) {
int hidraw = open((*it).c_str(), O_RDWR|O_NONBLOCK);
int hidraw = open((*it).c_str(), O_WRONLY|O_NONBLOCK);
if (hidraw < 0) {
cerr << "send_events_handler(...): open(\"" << *it << "\", O_RDWR|O_NONBLOCK) failed." << endl;
continue;

Loading…
Cancel
Save