From 0cb1c4965f4fcca3f6cdba850d91e34870296edb Mon Sep 17 00:00:00 2001 From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 24 Mar 2020 16:40:48 +0000 Subject: [PATCH] New port: x11/showkeys Showkeys is a simple program to display keys being pressed on the screen. WWW: https://github.com/nibrahim/showkeys --- x11/Makefile | 1 + x11/showkeys/Makefile | 28 ++++++++++++++++++++++++++++ x11/showkeys/distinfo | 3 +++ x11/showkeys/files/patch-Makefile | 28 ++++++++++++++++++++++++++++ x11/showkeys/files/patch-keystack.c | 10 ++++++++++ x11/showkeys/pkg-descr | 16 ++++++++++++++++ 6 files changed, 86 insertions(+) create mode 100644 x11/showkeys/Makefile create mode 100644 x11/showkeys/distinfo create mode 100644 x11/showkeys/files/patch-Makefile create mode 100644 x11/showkeys/files/patch-keystack.c create mode 100644 x11/showkeys/pkg-descr diff --git a/x11/Makefile b/x11/Makefile index 894381a27614..9a99d1dfbc7a 100644 --- a/x11/Makefile +++ b/x11/Makefile @@ -292,6 +292,7 @@ SUBDIR += sessreg SUBDIR += setlayout SUBDIR += setxkbmap + SUBDIR += showkeys SUBDIR += simdock SUBDIR += simplestroke SUBDIR += sisctrl diff --git a/x11/showkeys/Makefile b/x11/showkeys/Makefile new file mode 100644 index 000000000000..ff288faf37ca --- /dev/null +++ b/x11/showkeys/Makefile @@ -0,0 +1,28 @@ +# $FreeBSD$ + +PORTNAME= showkeys +DISTVERSION= g20191004 +CATEGORIES= x11 + +MAINTAINER= 0mp@FreeBSD.org +COMMENT= Display keystrokes during screencasts or presentations + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libxosd.so:misc/xosd + +USES= localbase xorg +USE_GITHUB= yes +GH_ACCOUNT= nibrahim +GH_TAGNAME= 187d59c +USE_XORG= x11 xext xinerama xtst + +ALL_TARGET= ${PORTNAME} + +PLIST_FILES= bin/${PORTNAME} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/ + +.include diff --git a/x11/showkeys/distinfo b/x11/showkeys/distinfo new file mode 100644 index 000000000000..8c8d37c907a8 --- /dev/null +++ b/x11/showkeys/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1585063387 +SHA256 (nibrahim-showkeys-g20191004-187d59c_GH0.tar.gz) = ec7859595ee148d29115a90e39ce7a7629b5011ab0368df5782f4ef5a668c617 +SIZE (nibrahim-showkeys-g20191004-187d59c_GH0.tar.gz) = 18033 diff --git a/x11/showkeys/files/patch-Makefile b/x11/showkeys/files/patch-Makefile new file mode 100644 index 000000000000..1d8182cbfb56 --- /dev/null +++ b/x11/showkeys/files/patch-Makefile @@ -0,0 +1,28 @@ +--- Makefile.orig 2019-10-04 17:36:38 UTC ++++ Makefile +@@ -1,18 +1,18 @@ + showkeys: showkeys.c showkeys.h keystack.o +- gcc -g -Wall showkeys.c keystack.o -o showkeys -lX11 -lxosd -lpthread -lXext -lX11 -lXinerama -lXtst ++ ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} -g -Wall showkeys.c keystack.o -o showkeys -lX11 -lxosd -lpthread -lXext -lX11 -lXinerama -lXtst + + + keystack.o: keystack.c keystack.h +- gcc -c -g keystack.c ++ ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} -c -g keystack.c + + clean: + rm showkeys keystack.o record-attempt record-example + + check-syntax: +- gcc -Wall -o nul -S ${CHK_SOURCES} ++ ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} -Wall -o nul -S ${CHK_SOURCES} + +-record-attempt: record-attempt.c +- gcc -g -Wall record-attempt.c -L/usr/lib -lXtst -lxosd -lpthread -lXext -lX11 -lXinerama -o record-attempt ++record-attempt: tests/record-attempt.c ++ ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} -g -Wall tests/record-attempt.c -L/usr/lib -lXtst -lxosd -lpthread -lXext -lX11 -lXinerama -o record-attempt + +-record-example: record-example.c +- gcc -g -Wall record-example.c -L/usr/lib -lXtst -lxosd -lpthread -lXext -lX11 -lXinerama -o record-example ++record-example: tests/record-example.c ++ ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} -g -Wall tests/record-example.c -L/usr/lib -lXtst -lxosd -lpthread -lXext -lX11 -lXinerama -o record-example diff --git a/x11/showkeys/files/patch-keystack.c b/x11/showkeys/files/patch-keystack.c new file mode 100644 index 000000000000..11cf5c737d9f --- /dev/null +++ b/x11/showkeys/files/patch-keystack.c @@ -0,0 +1,10 @@ +--- keystack.c.orig 2020-03-24 16:28:07 UTC ++++ keystack.c +@@ -11,6 +11,7 @@ + #include + #include + ++#include "config.h" + #include "keystack.h" + + static void diff --git a/x11/showkeys/pkg-descr b/x11/showkeys/pkg-descr new file mode 100644 index 000000000000..ab772c4243a9 --- /dev/null +++ b/x11/showkeys/pkg-descr @@ -0,0 +1,16 @@ +Showkeys is a simple program to display keys being pressed on the screen. + +It is useful while making presentations and screencasts. The audience will be +able to see the keys being pressed. + +It is similar to key-mon. Key-mon has more features than showkeys. The +advantages of showkeys are + +1. Doesn't use GTK/GNOME. +2. Uses libXosd to display keys directly onto the screen. +3. No floating windows that always need to be on top. This is very useful if + you're using a tiling WM like Xmonad. +4. Keystroke history. key-mon has this but doesn't show modifiers. showkeys + does this using an Emacs style key notation. + +WWW: https://github.com/nibrahim/showkeys