Update: Xremap support for no-fn-row keyboards

This commit is contained in:
Akemi Izuko 2023-12-23 20:14:06 -07:00
parent d6e04e6ff8
commit 2962573106
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC
5 changed files with 107 additions and 1 deletions

View file

@ -43,6 +43,18 @@ vifmmv() {
cd "$dst" cd "$dst"
} }
# Keyboard layout switching =========================================
sww() {
if ! [[ -x ~/.configs_pointer/bin/switch_keyboards.sh ]]; then
echo 'No switch_keyboard.sh script found in ~.configs_pointer/bin'
exit 1
else
~/.configs_pointer/bin/switch_keyboards.sh "$@"
fi
}
complete -W "console mac pc standard fn small mini" sww
# Open command source code ========================================== # Open command source code ==========================================
# Only works for scripts and rust executables # Only works for scripts and rust executables
_viw_completions() { _viw_completions() {

View file

@ -5,6 +5,7 @@
# console Loads the console version # console Loads the console version
# mac Loads the Mac keyboard version # mac Loads the Mac keyboard version
# pc Loads the standard keyboard version # pc Loads the standard keyboard version
# fn Loads the version for a standard keyboard without an fn row
# #
# Explanation ========= # Explanation =========
# Mac keyboards place their super key adjacent to the spacebar, while standard # Mac keyboards place their super key adjacent to the spacebar, while standard
@ -32,6 +33,7 @@ USAGE: $(basename "$0") <ARG>
ARGS: ARGS:
mac Remaps assuming super is adjacent to the spacebar mac Remaps assuming super is adjacent to the spacebar
pc Remaps assuming alt is adjacent to the spacebar pc Remaps assuming alt is adjacent to the spacebar
fn Remaps assuming pc + no fn row
console Only remaps capslock to ctrl console Only remaps capslock to ctrl
help Print this message and exit help Print this message and exit
HELP HELP
@ -51,10 +53,14 @@ case "$(echo "$1" | awk '{print tolower($0)}')" in
ln -sf ~/.config/xremap/config_mac.yml ~/.config/xremap/config.yml ln -sf ~/.config/xremap/config_mac.yml ~/.config/xremap/config.yml
echo "Switching to mac layout :: ALT | SUPER | SPACE" echo "Switching to mac layout :: ALT | SUPER | SPACE"
;; ;;
pc) pc | standard)
ln -sf ~/.config/xremap/config_standard.yml ~/.config/xremap/config.yml ln -sf ~/.config/xremap/config_standard.yml ~/.config/xremap/config.yml
echo "Switching to standard layout :: SUPER | ALT | SPACE" echo "Switching to standard layout :: SUPER | ALT | SPACE"
;; ;;
fn | small | mini)
ln -sf ~/.config/xremap/config_no_fn.yml ~/.config/xremap/config.yml
echo "Switching to no-fn row standard layout :: SUPER | ALT | SPACE"
;;
*) *)
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
print_help print_help

View file

@ -3,6 +3,9 @@ modmap:
- name: Better-ctrl - name: Better-ctrl
remap: remap:
KEY_CAPSLOCK: Control_l KEY_CAPSLOCK: Control_l
- name: Closer-Esc
remap:
Control_l: KEY_ESC
keymap: keymap:
- name: disable-sleep - name: disable-sleep

82
xremap/config_no_fn.yml Normal file
View file

@ -0,0 +1,82 @@
# Standard keyboard with alt key adjacent to spacebar and no fn row at the top.
# Retains ` and ~ in the top left, while moving esc to the bottom left key
modmap:
- name: Better-ctrl
remap:
KEY_CAPSLOCK: Control_l
- name: Mac-Command
remap:
Alt_l: Super_l
Super_l: Alt_l
Alt_r: Super_r
Super_r: Alt_r
- name: No-fn-esc
remap:
Control_l: KEY_ESC
KEY_ESC: Grave # Difference from standard/pc config
keymap:
- name: disable-sleep
remap:
sleep: l
- name: Emacs-ish
application:
not: [Alacritty, zathura, org.pwmt.zathura, vimiv]
remap:
C-j: left
C-f: right
C-p: up
C-n: down
C-b: C-left
C-w: C-right
C-a: home
C-e: end
C-u: { with_mark: Shift-C-Left }
C-h: [backspace, { set_mark: false}]
C-d: [delete, { set_mark: false}]
# bracketleft, according to wev
C-leftbrace: esc
#C-space: { set_mark: true }
- name: Mac-Compatiblity
application:
not: [Alacritty]
remap:
Super_l-a: C-a
- name: Browsers
# Similar-ish to MacOS. We bind to Alt instead of Super, since Ctrl is
# already used by the emacs bindings. Alt and Super are switched for PC
# keyboards to mimic MacOS
application:
only: [chromium, google-chrome, firefox]
remap:
Alt_l-w: Control_r-w
Alt_l-n: C-n
# For searchbar focusing. L/R to prevent recursion
Control_l-l: Alt_r-l
Alt_l-l: Control_r-l
# Find-in-page
Alt_l-f: Control_r-f
# Extended emacs for discord and online editors
C-k: Shift-end
# Stop getting stuck in tabs without vimium
Alt_l-j: Control_r-Shift-Tab
Alt_l-k: Control_r-Tab
# Prevent 12am discord calls
Ctrl-apostrophe: Apostrophe
- name: Chromium
application:
only: [chromium, google-chrome]
remap:
Alt_l-Shift-n: C-Shift-n
- name: Firefox
application:
only: [firefox]
remap:
Alt_l-Shift-n: C-Shift-p

View file

@ -9,6 +9,9 @@ modmap:
Super_l: Alt_l Super_l: Alt_l
Alt_r: Super_r Alt_r: Super_r
Super_r: Alt_r Super_r: Alt_r
- name: Closer-Esc
remap:
Control_l: KEY_ESC
keymap: keymap:
- name: disable-sleep - name: disable-sleep