Skip to content

Commit

Permalink
Add -v / --version commands, update help message
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Van Lierde <[email protected]>
  • Loading branch information
webketje committed Nov 25, 2019
1 parent 11910a2 commit 184b0e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/usr/share/tuxedo-backlight-control/backlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
class BacklightControl():
DEVICE_PATH = '/sys/devices/platform/tuxedo_keyboard/'
MODULE_PATH = '/sys/module/tuxedo_keyboard'
VERSION = '0.5'

modes = (
'color',
Expand Down Expand Up @@ -161,10 +162,14 @@ def display_colors(self):
if cmd == '--help' or cmd == '-h':
with open(sd + '/help.txt', 'r') as fin:
exit(fin.read())

if cmd == '--version' or cmd == '-v':
exit(BacklightControl.VERSION)

if not os.path.isdir(BacklightControl.DEVICE_PATH):
exit('Tuxedo Backlight Ctrl: The tuxedo_keyboard module is not installed at ' + BacklightControl.DEVICE_PATH)
elif cmd == 'ui':

if cmd == 'ui':
subprocess.call(['/usr/share/tuxedo-backlight-control/ui.py'])
elif cmd == 'off':
backlight.state = 0
Expand Down
6 changes: 4 additions & 2 deletions src/usr/share/tuxedo-backlight-control/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ By Kevin Van Lierde <[email protected]>
Usage:
-h, --help Display this message

-v, --version Display app version

ui Start the TUXEDO Backlight Control UI

off Turn off keyboard backlight
Expand All @@ -15,8 +17,8 @@ Usage:
color <color>{1,4} Set the keyboard backlight to a single color, one of:
white, silver, gray, yellow, orange, red, maroon, crimson,
fuchsia, purple, rose, cyan, turquoise, teal, blue, navy,
olive, lime, green,
OR any valid colors defined in /etc/tuxedo-backlight-control/colors.conf
olive, lime, green, OR any valid color_name=hex_value pairs
defined in /etc/tuxedo-backlight-control/colors.conf

Alternatively, set the keyboard to 4 distinct colors,
in the order: left, center, right, extra. Only regions supported
Expand Down

0 comments on commit 184b0e1

Please sign in to comment.