Skip to content

Commit 0272a6d

Browse files
authored
Merge pull request #12 from alexmohr/dev
Version 1.3.0
2 parents 377f2ae + c460cbc commit 0272a6d

File tree

4 files changed

+162
-65
lines changed

4 files changed

+162
-65
lines changed

CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
cmake_minimum_required(VERSION 3.12)
22
project(thinkpad_keyboard_backlight)
33
set(PROJECT_VERSION_MAJOR 1)
4-
set(PROJECT_VERSION_MINOR 2)
5-
set(PROJECT_VERSION_PATCH 1)
4+
set(PROJECT_VERSION_MINOR 3)
5+
set(PROJECT_VERSION_PATCH 0)
66

77
# Add version compile definition
88
add_compile_definitions(VERSION="${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
99

10+
1011
set(CMAKE_INSTALL_PREFIX /usr/bin)
1112
set(CMAKE_CXX_STANDARD 17)
1213

@@ -28,6 +29,8 @@ set(OPTIMIZATION_LEVEL "-O3")
2829
# "" None
2930
set(DEBUG_LEVEL "")
3031

32+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1")
33+
3134
# Configure C++ compiler flags
3235
set(CMAKE_CXX_FLAGS "${OPTIMIZATION_LEVEL} \
3336
${DEBUG_LEVEL} \
@@ -40,10 +43,16 @@ set(APP_TARGET_PATH ${CMAKE_INSTALL_PREFIX}/keyboard_backlight)
4043
set(APP_NAME keyboard_backlight)
4144

4245
find_package (Threads)
46+
# Some versions of gcc need to link filesystem lib
47+
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
48+
set(CXX_FILESYSTEM_LIBRARIES stdc++fs)
49+
else()
50+
set(CXX_FILESYSTEM_LIBRARIES)
51+
endif()
4352

4453

4554
add_executable(${APP_NAME} kbd_backlight.cpp)
46-
target_link_libraries (keyboard_backlight ${CMAKE_THREAD_LIBS_INIT})
55+
target_link_libraries (keyboard_backlight ${CMAKE_THREAD_LIBS_INIT} ${CXX_FILESYSTEM_LIBRARIES})
4756

4857
install(TARGETS keyboard_backlight DESTINATION ${CMAKE_INSTALL_PREFIX})
4958

PKGBUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ url='https://github.com/alexmohr/keyboard-backlight'
99
license=('MIT')
1010
depends=('libinput')
1111
makedepends=('git' 'cmake' 'gcc')
12+
backup=('etc/systemd/system/keyboard_backlight.service')
1213

1314
source=("git+https://github.com/alexmohr/keyboard-backlight")
1415
sha512sums=('SKIP')

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ other devices as well
1010
### Arch Linux
1111
The package is in the AUR and called ``tp-kb-backlight-git``
1212

13-
### Install from source
14-
To build the binary run
13+
### Build from source
14+
Requirements to build the software from source are:
15+
* Compiler with C++17 suppport
16+
* CMake
17+
18+
To build the binary run:
1519
````
1620
mkdir build
1721
cd build
@@ -52,7 +56,7 @@ sudo rm /usr/bin/keyboard_backlight
5256

5357
## Configuration
5458
````
55-
keyboard_backlight 1.2.1
59+
keyboard_backlight 1.3.0
5660
-h show this help
5761
-i ignore an input device
5862
This device does not re enable keyboard backlight.
@@ -65,9 +69,8 @@ keyboard_backlight 1.2.1
6569
1 use all internal mice only
6670
2 ignore mice
6771
-b set keyboard backlight device path
68-
defaults to /sys/class/leds/tpacpi::kbd_backlight
72+
defaults to /sys/class/leds/tpacpi::kbd_backlight/brightness
6973
-f stay in foreground and do not start daemon
70-
-s Set a brightness value from 0..2 and exit
74+
-s Set a brightness value and exit
7175
````
7276

73-

0 commit comments

Comments
 (0)