kmonad instead of xmodmap

This commit is contained in:
Ingolf Wagner 2023-06-02 14:08:07 +02:00
parent 922a5a66e2
commit d80ac3b5a0
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
8 changed files with 99 additions and 74 deletions
nixos/components/gui/home-manager

View file

@ -1,32 +1,5 @@
{ pkgs, lib, config, ... }:
with lib;
let
# todo : use kmonad
xmodmapConfig = pkgs.writeText "xmodmap" ''
!
! Swap Caps_Lock and Control_L
!
! replace capslock keys with Escape Keys
! remove Lock = Caps_Lock
clear Lock
add Lock = Scroll_Lock
keysym Caps_Lock = Escape
! Set Right function Key to Windows-key
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
! Map umlauts to RIGHT ALT + <key>
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
'';
in
{
imports = [
@ -219,9 +192,6 @@ in
# todo : still needed?
home.file.".xprofile".text = ''
# load keyboard mappings
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
# to allow sudo commands to access X
# todo : only allow the browsers and rambox access
${pkgs.xorg.xhost}/bin/xhost +
@ -281,11 +251,6 @@ in
environment.systemPackages =
let
fixKeyboard = pkgs.writeScriptBin "fix-Keyboard" # sh
''
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
'';
fixXhost = pkgs.writeScriptBin "fix-xhost" # sh
''
${pkgs.xorg.xhost}/bin/xhost + &> /dev/null
@ -294,8 +259,6 @@ in
fixX = pkgs.writeScriptBin "fix-X" # sh
''
${fixKeyboard}/bin/fix-Keyboard
for file in `ls ~/.screenlayout`
do
echo $file
@ -313,7 +276,6 @@ in
[
fixX
fixXhost
fixKeyboard
];
};

View file

@ -314,33 +314,8 @@ in
# autorandr --change # automatically detects the setup
"${cfg.config.modifier}+BackSpace" =
let
xmodmapConfig = pkgs.writeText "xmodmap" ''
!
! Swap Caps_Lock and Control_L
!
! replace capslock keys with Escape Keys
! remove Lock = Caps_Lock
clear Lock
add Lock = Scroll_Lock
keysym Caps_Lock = Escape
! Set Right function Key to Windows-key
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
! Map umlauts to RIGHT ALT + <key>
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
'';
script = pkgs.writers.writeBash "autorandr" ''
${pkgs.autorandr}/bin/autorandr --change
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
${backgroundCommand}
'';
in