Skip to content

Commit

Permalink
Merge pull request #12 from alexmohr/dev
Browse files Browse the repository at this point in the history
Version 1.3.0
  • Loading branch information
alexmohr authored Apr 30, 2020
2 parents 377f2ae + c460cbc commit 0272a6d
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 65 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
cmake_minimum_required(VERSION 3.12)
project(thinkpad_keyboard_backlight)
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 2)
set(PROJECT_VERSION_PATCH 1)
set(PROJECT_VERSION_MINOR 3)
set(PROJECT_VERSION_PATCH 0)

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


set(CMAKE_INSTALL_PREFIX /usr/bin)
set(CMAKE_CXX_STANDARD 17)

Expand All @@ -28,6 +29,8 @@ set(OPTIMIZATION_LEVEL "-O3")
# "" None
set(DEBUG_LEVEL "")

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1")

# Configure C++ compiler flags
set(CMAKE_CXX_FLAGS "${OPTIMIZATION_LEVEL} \
${DEBUG_LEVEL} \
Expand All @@ -40,10 +43,16 @@ set(APP_TARGET_PATH ${CMAKE_INSTALL_PREFIX}/keyboard_backlight)
set(APP_NAME keyboard_backlight)

find_package (Threads)
# Some versions of gcc need to link filesystem lib
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
set(CXX_FILESYSTEM_LIBRARIES stdc++fs)
else()
set(CXX_FILESYSTEM_LIBRARIES)
endif()


add_executable(${APP_NAME} kbd_backlight.cpp)
target_link_libraries (keyboard_backlight ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (keyboard_backlight ${CMAKE_THREAD_LIBS_INIT} ${CXX_FILESYSTEM_LIBRARIES})

install(TARGETS keyboard_backlight DESTINATION ${CMAKE_INSTALL_PREFIX})

Expand Down
1 change: 1 addition & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ url='https://github.com/alexmohr/keyboard-backlight'
license=('MIT')
depends=('libinput')
makedepends=('git' 'cmake' 'gcc')
backup=('etc/systemd/system/keyboard_backlight.service')

source=("git+https://github.com/alexmohr/keyboard-backlight")
sha512sums=('SKIP')
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ other devices as well
### Arch Linux
The package is in the AUR and called ``tp-kb-backlight-git``

### Install from source
To build the binary run
### Build from source
Requirements to build the software from source are:
* Compiler with C++17 suppport
* CMake

To build the binary run:
````
mkdir build
cd build
Expand Down Expand Up @@ -52,7 +56,7 @@ sudo rm /usr/bin/keyboard_backlight

## Configuration
````
keyboard_backlight 1.2.1
keyboard_backlight 1.3.0
-h show this help
-i ignore an input device
This device does not re enable keyboard backlight.
Expand All @@ -65,9 +69,8 @@ keyboard_backlight 1.2.1
1 use all internal mice only
2 ignore mice
-b set keyboard backlight device path
defaults to /sys/class/leds/tpacpi::kbd_backlight
defaults to /sys/class/leds/tpacpi::kbd_backlight/brightness
-f stay in foreground and do not start daemon
-s Set a brightness value from 0..2 and exit
-s Set a brightness value and exit
````


Loading

0 comments on commit 0272a6d

Please sign in to comment.