tvl-depot/users/glittershark/system/home/machines/chupacabra.nix
Griffin Smith 6f2094c146 feat(gs): Bind a push-to-talk key
Bind a key, which I've located at the top-left of my right keyboard, to
a momentary push-to-talk by muting and unmuting my pulseaudio source
using xbindkeys. I had been putting this off for a while because i3
doesn't support binding different commands to keyup than to keydown
events, but the xbindkeys support appears to have solved that reasonably
well, plus it's got Scheme in it so that's cool.

If there's demand for it I'll gladly expose this as a reusable,
configurable home-manager module outside my users dir in the depot.

Change-Id: Ie591c93037dbdac364d5d8a718d99edb70780789
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1975
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-09-12 19:20:43 +00:00

53 lines
1.2 KiB
Nix

{ pkgs, lib, config, ... }:
with lib;
let
laptopKeyboardId = "25";
in {
imports = [
../platforms/linux.nix
../modules/common.nix
../modules/games.nix
../modules/rtlsdr.nix
../modules/urbint.nix
../modules/ptt.nix
];
# for when hacking
programs.home-manager.path = "/home/grfn/code/home-manager";
programs.home-manager.enable = true;
home.stateVersion = "19.09";
system.machine = {
wirelessInterface = "wlp59s0";
i3FontSize = 9;
};
systemd.user.services.laptop-keyboard = {
Unit = {
Description = "Swap caps+escape and alt+super, but only on the built-in laptop keyboard";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = (
"${pkgs.xorg.setxkbmap}/bin/setxkbmap "
+ "-device ${laptopKeyboardId} "
+ "-option caps:swapescape "
+ "-option compose:ralt "
+ "-option altwin:swap_alt_win"
);
};
};
home.packages = with pkgs; [
steam
xorg.libxcb
];
}