Skip to content

Commit

Permalink
chromebook: add xkb options for neo2 layout on chromebooks
Browse files Browse the repository at this point in the history
To support neo2 layout on chromebooks, activate the standard ralt_switch
option ("Key to choose 5th Level" -> "Right Alt chooses 5th level") as
well as the lwin_switch option included in this commit ("Chromebook
options" -> "Left Win chooses 3rd level").

For Gnome, they can be activated in the Gnome Tweak tool ("Keyboard &
Mouse" -> "Additional Layout Options").
  • Loading branch information
leezu committed May 8, 2022
1 parent b8d8097 commit 63e6bc1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chromebook/.config/xkb/rules/evdev
@@ -0,0 +1,4 @@
! option = symbols
chromebook:swap_lwin_caps = +chromebook(swap_lwin_caps)
chromebook:lwin_switch = +chromebook(lwin_switch)
! include %S/evdev
24 changes: 24 additions & 0 deletions chromebook/.config/xkb/rules/evdev.xml
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">
<xkbConfigRegistry version="1.1">
<optionList>
<group allowMultipleSelection="true">
<configItem>
<name>chromebook</name>
<description>Chromebook options</description>
</configItem>
<option>
<configItem>
<name>chromebook:swap_lwin_caps</name>
<description>Swap Search Key and CAPS</description>
</configItem>
</option>
<option>
<configItem>
<name>chromebook:lwin_switch</name>
<description>Left Win chooses 3rd level</description>
</configItem>
</option>
</group>
</optionList>
</xkbConfigRegistry>
18 changes: 18 additions & 0 deletions chromebook/.config/xkb/symbols/chromebook
@@ -0,0 +1,18 @@
// Swap the functions of the left Win key (Search) and the CAPS key.
partial modifier_keys
xkb_symbols "swap_lwin_caps" {
replace key <LWIN> { [ Caps_Lock ] };
replace key <CAPS> { [ Super_L ] };
// modifier_map Mod3 { <LWIN> };
};

// Use LWIN as modifier key
partial modifier_keys
xkb_symbols "lwin_switch" {
key <LWIN> {
type[Group1]="ONE_LEVEL",
symbols[Group1] = [ ISO_Level3_Shift ]
};
include "level3(modifier_mapping)"
};

0 comments on commit 63e6bc1

Please sign in to comment.