diff --git a/.xkb/symbols/mac_onelvl b/.xkb/symbols/mac_levels similarity index 66% rename from .xkb/symbols/mac_onelvl rename to .xkb/symbols/mac_levels index 003e698..cc4a19b 100644 --- a/.xkb/symbols/mac_onelvl +++ b/.xkb/symbols/mac_levels @@ -1,4 +1,4 @@ -default partial xkb_symbols "mac_onelvlsym" { +default partial xkb_symbols "mac_levelssym" { // LEFT to Begin Line replace key { type[Group1]= "ONE_LEVEL_CTRL", @@ -14,13 +14,19 @@ default partial xkb_symbols "mac_onelvlsym" { // Up to Mac Home replace key { type[Group1]= "ONE_LEVEL_CTRL", - symbols[Group1]= [ Up, NoSymbol ], + symbols[Group1]= [ Up, Up, NoSymbol ], actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=)] }; // Down to Mac End replace key { type[Group1]= "ONE_LEVEL_CTRL", - symbols[Group1]= [ Down, NoSymbol ], + symbols[Group1]= [ Down, Down, NoSymbol ], actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=)] }; + // CTRL BKSP to DELETE + replace key { + type[Group1]= "TWO_LEVEL_CTRL", + symbols[Group1]= [ BackSpace, BackSpace, NoSymbol ], + actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=,clearmods=Control)] + }; }; diff --git a/.xkb/types/mac_levels b/.xkb/types/mac_levels new file mode 100644 index 0000000..1c47c33 --- /dev/null +++ b/.xkb/types/mac_levels @@ -0,0 +1,20 @@ +default partial xkb_types "addmac_levels" { + type "ONE_LEVEL_CTRL" { + modifiers= Shift+Control; + map[Shift]= Level2; + map[Control]= Level3; + map[Shift+Control]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Caps"; + level_name[Level3]= "With Control"; + }; + type "TWO_LEVEL_CTRL" { + modifiers= Shift+Control; + map[Shift]= Level2; + map[Control]= Level3; + map[Shift+Control]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Caps"; + level_name[Level3]= "With Control"; + }; +}; diff --git a/.xkb/types/mac_onelvl b/.xkb/types/mac_onelvl deleted file mode 100644 index 32f2f38..0000000 --- a/.xkb/types/mac_onelvl +++ /dev/null @@ -1,11 +0,0 @@ -default partial xkb_types "addmac_onelvl" { - type "ONE_LEVEL_CTRL" { - modifiers= Shift+Control; - map[Shift]= Level2; - map[Control]= Level3; - map[Shift+Control]= Level3; - level_name[Level1]= "Base"; - level_name[Level2]= "Caps"; - level_name[Level3]= "With Control"; - }; -}; diff --git a/mac_wordwise.sh b/mac_wordwise.sh index 4ca1474..e4ffdbf 100755 --- a/mac_wordwise.sh +++ b/mac_wordwise.sh @@ -1,8 +1,8 @@ #!/bin/bash mkdir -p ~/.xkb/{keymap,symbols,types} -cp ./.xkb/symbols/mac_onelvl ~/.xkb/symbols/mac_onelvl -cp ./.xkb/types/mac_onelvl ~/.xkb/types/mac_onelvl +cp ./.xkb/symbols/mac_levels ~/.xkb/symbols/mac_levels +cp ./.xkb/types/mac_levels ~/.xkb/types/mac_levels setxkbmap -option -setxkbmap -print > ~/.xkb/keymap/kbd.mac.onelvl -line=$(cat ~/.xkb/keymap/kbd.mac.onelvl | grep -n 'xkb_symbols' | cut -f1 -d:) -sed -ie "${line}s/)\"/)+altwin(ctrl_alt_win)+mac_onelvl(mac_onelvlsym)\"/g" ~/.xkb/keymap/kbd.mac.onelvl +setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui +line=$(cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_symbols' | cut -f1 -d:) +sed -ie "${line}s/)\"/)+altwin(ctrl_alt_win)+mac_levels(mac_levelssym)\"/g" ~/.xkb/keymap/kbd.mac.gui diff --git a/system-config/xactive.sh b/system-config/xactive.sh index 4430dd7..c196cca 100755 --- a/system-config/xactive.sh +++ b/system-config/xactive.sh @@ -15,7 +15,7 @@ swapbehavior=$4 swapcmd_term="setxkbmap -option;setxkbmap -option altwin:swap_alt_win" fallbackcmd_gui="" if [[ "$systemtype" == "windows" || "$systemtype" == "mac" ]]; then - swapcmd_gui="setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.onelvl $DISPLAY" + swapcmd_gui="setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY" check_gt="setxkbmap -query | grep -v 'swap_alt_win' 1>/dev/null" check_tg="setxkbmap -query | grep -q 'swap_alt_win'" elif [[ "$swapbehavior" == "both_mac" ]]; then