[NixOS] Set custom keyboard modifiers globally
This commit is contained in:
		| @@ -61,12 +61,10 @@ | |||||||
|   hardware.bluetooth.enable = true; |   hardware.bluetooth.enable = true; | ||||||
|   services.blueman.enable = true; |   services.blueman.enable = true; | ||||||
|  |  | ||||||
|   # Keyboard/Keymap |  | ||||||
|   console.keyMap = "us"; |  | ||||||
|  |  | ||||||
|   i18n = { |   i18n = { | ||||||
|     defaultLocale = "en_US.UTF-8"; |     defaultLocale = "en_US.UTF-8"; | ||||||
|   }; |   }; | ||||||
|  |   console.useXkbConfig = true; | ||||||
|  |  | ||||||
|   # Update timezone automatically |   # Update timezone automatically | ||||||
|   services.tzupdate.enable = true; |   services.tzupdate.enable = true; | ||||||
| @@ -85,9 +83,34 @@ | |||||||
|   hardware.keyboard.zsa.enable = true; |   hardware.keyboard.zsa.enable = true; | ||||||
|  |  | ||||||
|   services.xserver = { |   services.xserver = { | ||||||
|     exportConfiguration = true; |  | ||||||
|     enable = true; |     enable = true; | ||||||
|     layout = "us"; |  | ||||||
|  |     xkbOptions = "ctrl:swapcaps"; | ||||||
|  |     layout = "us+rwin_as_hyper"; | ||||||
|  |     extraLayouts.hyper = { | ||||||
|  |       description = "Right Alt as Hyper key"; | ||||||
|  |       languages = [ ]; | ||||||
|  |       symbolsFile = pkgs.writeText "hyper" '' | ||||||
|  |         partial modifier_keys | ||||||
|  |         xkb_symbols "rwin_as_hyper" { | ||||||
|  |           replace key <RWIN> { [ Hyper_R ] }; | ||||||
|  |           modifier_map Mod3 { <HYPR>, Hyper_L, Hyper_R }; | ||||||
|  |         }; | ||||||
|  |  | ||||||
|  |         partial modifier_keys | ||||||
|  |         xkb_symbols "home_as_hyper" { | ||||||
|  |           replace key <HOME> { [ Hyper_L ] }; | ||||||
|  |           modifier_map Mod3 { <HOME>, Hyper_L, Hyper_R }; | ||||||
|  |         }; | ||||||
|  |  | ||||||
|  |         partial modifier_keys | ||||||
|  |         xkb_symbols "ralt_as_hyper" { | ||||||
|  |           replace key <RALT> { [ Hyper_L, Hyper_L ] }; | ||||||
|  | 	        modifier_map Mod3 { <RALT>, Hyper_L }; | ||||||
|  |         }; | ||||||
|  |       ''; | ||||||
|  |     }; | ||||||
|  |  | ||||||
|     desktopManager = { |     desktopManager = { | ||||||
|       plasma5.enable = true; |       plasma5.enable = true; | ||||||
|     }; |     }; | ||||||
|   | |||||||
| @@ -2,11 +2,10 @@ | |||||||
|   xsession = { |   xsession = { | ||||||
|     enable = true; |     enable = true; | ||||||
|     preferStatusNotifierItems = true; |     preferStatusNotifierItems = true; | ||||||
|     importedVariables = [ "GDK_PIXBUF_ICON_LOADER" ]; |     importedVariables = [ "GDK_PIXBUF_ICON_LOADER" "PATH" ]; | ||||||
|     profileExtra = '' |     profileExtra = '' | ||||||
|       export ROFI_SYSTEMD_TERM="alacritty -e" |       export ROFI_SYSTEMD_TERM="alacritty -e" | ||||||
|       . "$HOME/.lib/login.sh" |       . "$HOME/.lib/login.sh" | ||||||
|       load_xkb_map.sh |  | ||||||
|     ''; |     ''; | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user