From ced182019900391f8ea3d12e068b16b73a0968b7 Mon Sep 17 00:00:00 2001 From: "Jason E. Hale" Date: Wed, 14 Mar 2018 16:07:03 +0000 Subject: [PATCH] New port: sysutils/msiklm MSI Keyboard Light Manager (MSIKLM) is an easy-to-use command-line tool that allows users to configure the backlight of SteelSeries keyboards found in MSI gaming notebooks. It offers similar functionality to the SteelSeries Engine for Windows. WWW: https://github.com/Gibtnix/MSIKLM Run tested on an MSI GE62VR 7RF Apache Pro --- sysutils/Makefile | 1 + sysutils/msiklm/Makefile | 42 +++++++++++++++++++++ sysutils/msiklm/distinfo | 3 ++ sysutils/msiklm/files/Makefile.bsd | 11 ++++++ sysutils/msiklm/files/msiklm.conf.sample.in | 33 ++++++++++++++++ sysutils/msiklm/files/pkg-message.in | 11 ++++++ sysutils/msiklm/pkg-descr | 6 +++ 7 files changed, 107 insertions(+) create mode 100644 sysutils/msiklm/Makefile create mode 100644 sysutils/msiklm/distinfo create mode 100644 sysutils/msiklm/files/Makefile.bsd create mode 100644 sysutils/msiklm/files/msiklm.conf.sample.in create mode 100644 sysutils/msiklm/files/pkg-message.in create mode 100644 sysutils/msiklm/pkg-descr diff --git a/sysutils/Makefile b/sysutils/Makefile index bf075d49acf8..962c0f9e153a 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -686,6 +686,7 @@ SUBDIR += mountsmb2 SUBDIR += mpiexec SUBDIR += mptd + SUBDIR += msiklm SUBDIR += msktutil SUBDIR += msyslog SUBDIR += mtpfs diff --git a/sysutils/msiklm/Makefile b/sysutils/msiklm/Makefile new file mode 100644 index 000000000000..e3e52fd99448 --- /dev/null +++ b/sysutils/msiklm/Makefile @@ -0,0 +1,42 @@ +# $FreeBSD$ + +PORTNAME= msiklm +DISTVERSION= g20180227 +CATEGORIES= sysutils + +MAINTAINER= jhale@FreeBSD.org +COMMENT= MSI keyboard light manager + +LICENSE= GPLv3+ +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= amd64 i386 +ONLY_FOR_ARCHS_REASON= This hardware is only found on x86 systems + +LIB_DEPENDS= libhidapi.so:comms/hidapi + +USES= dos2unix localbase:ldflags uidfix +DOS2UNIX_FILES= README.md +USE_GITHUB= yes +GH_ACCOUNT= Gibtnix +GH_PROJECT= MSIKLM +GH_TAGNAME= 46dd076 + +MAKEFILE= ${FILESDIR}/Makefile.bsd +PLIST_FILES= bin/msiklm +PORTDOCS= README.md + +OPTIONS_DEFINE= DEVD DOCS +OPTIONS_DEFAULT= DEVD + +DEVD_PLIST_FILES= etc/devd/msiklm.conf.sample +DEVD_SUB_FILES= msiklm.conf.sample pkg-message + +post-install-DEVD-on: + ${INSTALL_DATA} ${WRKDIR}/msiklm.conf.sample ${STAGEDIR}${PREFIX}/etc/devd + +post-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} + +.include diff --git a/sysutils/msiklm/distinfo b/sysutils/msiklm/distinfo new file mode 100644 index 000000000000..5aa77019a0ea --- /dev/null +++ b/sysutils/msiklm/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1520932266 +SHA256 (Gibtnix-MSIKLM-g20180227-46dd076_GH0.tar.gz) = 371d889a9f0c2d81d8bf5a9bb48a50215d46e129c4424bacba570acb559e2d33 +SIZE (Gibtnix-MSIKLM-g20180227-46dd076_GH0.tar.gz) = 22164 diff --git a/sysutils/msiklm/files/Makefile.bsd b/sysutils/msiklm/files/Makefile.bsd new file mode 100644 index 000000000000..036dceaaf625 --- /dev/null +++ b/sysutils/msiklm/files/Makefile.bsd @@ -0,0 +1,11 @@ +# $FreeBSD$ + +BINDIR= ${PREFIX}/bin +PROG= msiklm +SRCS= src/main.c src/msiklm.c +CFLAGS+= -Wall -W -D_REENTRANT +LDADD= -lhidapi +# Change to MK_MAN=no after 10.3 support is dropped +NO_MAN= yes + +.include diff --git a/sysutils/msiklm/files/msiklm.conf.sample.in b/sysutils/msiklm/files/msiklm.conf.sample.in new file mode 100644 index 000000000000..e48cc56835da --- /dev/null +++ b/sysutils/msiklm/files/msiklm.conf.sample.in @@ -0,0 +1,33 @@ +# $FreeBSD$ +# +# This entry runs the 'msiklm' utility upon device attach to set +# a default keyboard backlight theme. + +# You may adjust ARGS to suit your preference. +# Generally, the ARGS syntax is " ". +# Some examples are listed below, but consult 'msiklm help' and +# %%DOCSDIR%%/README.md +# for more detailed information. + +# Confirm the ARGS work as expected by running (as superuser): +# msiklm +# before placing in the options substatement below. + +# Examples: +# set ARGS "red,white,blue high wave"; +# set ARGS "green,blue,red medium breathe"; +# set ARGS "orange low"; +# set ARGS "off"; + +options { + set ARGS "red,blue,green high normal"; +}; + +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1770"; + match "product" "0xff00"; + action "%%PREFIX%%/bin/msiklm $ARGS"; +}; diff --git a/sysutils/msiklm/files/pkg-message.in b/sysutils/msiklm/files/pkg-message.in new file mode 100644 index 000000000000..3af659c5c1b4 --- /dev/null +++ b/sysutils/msiklm/files/pkg-message.in @@ -0,0 +1,11 @@ +----------------------------------------------------------------------- + + A sample devd(8) configuration file has been installed as: + %%PREFIX%%/etc/devd/msiklm.conf.sample + + You may want to copy this file to: + %%PREFIX%%/etc/devd/msiklm.conf + and configure it to your liking if you want msiklm to automatically + set your keyboard backlight to a default upon system boot/resume. + +----------------------------------------------------------------------- diff --git a/sysutils/msiklm/pkg-descr b/sysutils/msiklm/pkg-descr new file mode 100644 index 000000000000..a24cd04316c4 --- /dev/null +++ b/sysutils/msiklm/pkg-descr @@ -0,0 +1,6 @@ +MSI Keyboard Light Manager (MSIKLM) is an easy-to-use command-line +tool that allows users to configure the backlight of SteelSeries +keyboards found in MSI gaming notebooks. It offers similar +functionality to the SteelSeries Engine for Windows. + +WWW: https://github.com/Gibtnix/MSIKLM