Skip to content

Instantly share code, notes, and snippets.

@rehno-lindeque
Last active March 16, 2019 00:42
Show Gist options
  • Save rehno-lindeque/1b27db45e445c0efccb086624bbd4205 to your computer and use it in GitHub Desktop.
Save rehno-lindeque/1b27db45e445c0efccb086624bbd4205 to your computer and use it in GitHub Desktop.
My personal keyboard layout switcher: nix-env -iE "$(curl -sL https://git.io/fjvfP)"
#! /usr/bin/env -S nix-env -if
{ pkgs ? import <nixpkgs> {}, ... }:
let
norman-layout = pkgs.fetchurl {
url = "https://gist.githubusercontent.com/rehno-lindeque/ad5fef21f15ad13a9a355bbbd41fdc0a/raw/aa7948603ee266bd2a0bb6c9778ae7dd8bd1eccb/xmodmap.norman";
sha256 = "14a63as7i35g6gkf0sqb324ck9k61w1vsdnz30sf8svnp4c0wjgq";
};
in
{
norman = pkgs.writeScriptBin "norman" ''
${pkgs.xorg.xmodmap}/bin/xmodmap ${norman-layout}
'';
jlimaj = pkgs.writeScriptBin "jlimaj" ''
${pkgs.xorg.xmodmap}/bin/xmodmap ${norman-layout}
'';
qwerty = pkgs.writeScriptBin "qwerty" ''
${pkgs.xorg.setxkbmap}/bin/setxkbmap us
'';
qwdfkj = pkgs.writeScriptBin "qwdfkj" ''
${pkgs.xorg.setxkbmap}/bin/setxkbmap us
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment