Skip to content

Commit

Permalink
wshowkeys: init at 2019-09-26
Browse files Browse the repository at this point in the history
  • Loading branch information
primeos committed Mar 29, 2020
1 parent 773c84d commit a09a08c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
./programs/wavemon.nix
./programs/waybar.nix
./programs/wireshark.nix
./programs/wshowkeys.nix
./programs/x2goserver.nix
./programs/xfs_quota.nix
./programs/xonsh.nix
Expand Down
22 changes: 22 additions & 0 deletions nixos/modules/programs/wshowkeys.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.programs.wshowkeys;
in {
meta.maintainers = with maintainers; [ primeos ];

options = {
programs.wshowkeys = {
enable = mkEnableOption ''
wshowkeys (displays keypresses on screen on supported Wayland
compositors). It requires root permissions to read input events, but
these permissions are dropped after startup'';
};
};

config = mkIf cfg.enable {
security.wrappers.wshowkeys.source = "${pkgs.wshowkeys}/bin/wshowkeys";
};
}
35 changes: 35 additions & 0 deletions pkgs/tools/wayland/wshowkeys/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ stdenv, fetchurl
, meson, pkg-config, wayland, ninja
, cairo, libinput, pango, wayland-protocols, libxkbcommon
}:

let
version = "2019-09-26";
commit = "a9bf6bca0361b57c67e4627bf53363a7048457fd";
in stdenv.mkDerivation rec {
pname = "wshowkeys-unstable";
inherit version;

src = fetchurl {
url = "https://git.sr.ht/~sircmpwn/wshowkeys/archive/${commit}.tar.gz";
sha256 = "0b21z3csd3v4lw5b8a6lpx5gfsdk0gjmm8906sa72hyfd1p39b7g";
};

nativeBuildInputs = [ meson pkg-config wayland ninja ];
buildInputs = [ cairo libinput pango wayland-protocols libxkbcommon ];

meta = with stdenv.lib; {
description = "Displays keys being pressed on a Wayland session";
longDescription = ''
Displays keypresses on screen on supported Wayland compositors (requires
wlr_layer_shell_v1 support).
Note: This tool requires root permissions to read input events, but these
permissions are dropped after startup. The NixOS module provides such a
setuid binary (use "programs.wshowkeys.enable = true;").
'';
homepage = "https://git.sr.ht/~sircmpwn/wshowkeys";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ primeos ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3092,6 +3092,8 @@ in

wob = callPackage ../tools/misc/wob { };

wshowkeys = callPackage ../tools/wayland/wshowkeys { };

xob = callPackage ../tools/X11/xob { };

z-lua = callPackage ../tools/misc/z-lua { };
Expand Down

0 comments on commit a09a08c

Please sign in to comment.