automate/020_kmonad-conf_print.sh

239 lines
9.4 KiB
Bash

# create a template for the dell d830
# split into header, deflayer, defcfg and defsrc to allow reuse.
conf_print_dell_d830_template_header() {
cat <<EOF
#| --------------------------------------------------------------------------
KMonad: ISO Dell D830 Template
This file contains UK and 'defsrc' configurations for a Dell D830
with an ISO keyboard. Copy out the 'defsrc' layer to start your own
keyboard configuration. Copy out the 'deflayer' template to easily start
a new layer with matching 'transparent' buttons.
-------------------------------------------------------------------------- |#
EOF
}
# conf_print_dell_d830_template_header | tee ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_header_generic() {
cat <<EOF
#| --------------------------------------------------------------------------
KMonad: ISO Dell D830 Template
This file contains UK and 'defsrc' configurations for a Dell D830
with an ISO keyboard. Copy out the 'defsrc' layer to start your own
keyboard configuration. Copy out the 'deflayer' template to easily start
a new layer with matching 'transparent' buttons.
EOF
}
# conf_print_dell_d830_template_header_generic | tee ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_empty_generic() {
cat <<EOF
(deflayer empty
_ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _
)
-------------------------------------------------------------------------- |#
EOF
}
# conf_print_dell_d830_template_deflayer_empty_generic | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_empty() {
cat <<EOF
(deflayer empty
_ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_empty | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defcfg_generic() {
cat <<EOF
(defcfg
;; ** For Linux **
;;input (device-file "/dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd")
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "KMonad seniply-iso-wide")
cmp-seq cmp
;; ** For Windows **
;; input (low-level-hook)
;; output (send-event-sink)
;; ** For MacOS **
;; input (iokit-name "my-keyboard-product-string")
;; output (kext)
fallthrough true
)
EOF
}
# conf_print_dell_d830_template_defcfg_generic | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defcfg() {
cat <<EOF
(defcfg
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "Kmonad kbd")
"/run/current-system/sw/bin/sleep 1 && /run/current-system/sw/bin/setxkbmap -option caps:swapescape,compose:ralt")
cmp-seq 'ralt' ;; Set the compose key to 'RightAlt'
comp-seq-delay '5' ;; 5ms delay between each compose-key sequence press
fallthrough 'true' ;; Set to true to emit unhandled events
allow-cmd 'false' ;; Set to false to disable command execution in KMonad
)
EOF
}
# conf_print_dell_d830_template_defcfg | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defsrc() {
cat <<EOF
(defsrc
vold volu mute gui kprt nlck pause ins home pgup
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del end pgdn
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ]
caps a s d f g h j k l ; ' \# ret
lsft z x c v b n m , . / rsft
lctl fn lmet lalt spc ralt rctl up
left down rght
)
EOF
}
# conf_print_dell_d830_template_defsrc | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defalias_extend() {
cat <<EOF
(defalias
ext (layer-toggle extend) ;; Bind 'ext' to the Extend Layer
)
EOF
}
# conf_print_dell_d830_template_defalias_extend | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_defalias() {
cat <<EOF
(defalias
cpy C-c
pst C-v
cut C-x
udo C-z
all C-a
fnd C-f
bk Back
fw Forward
)
EOF
}
# conf_print_dell_d830_template_defalias | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
# Using this as tje first layer after the defsrc preserves querty as the default
conf_print_dell_d830_template_deflayer_querty() {
cat <<EOF
(deflayer querty
vold volu mute gui kprt nlck pause ins home pgup
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del end pgdn
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ]
caps a s d f g h j k l ; ' \# ret
lsft z x c v b n m , . / rsft
lctl fn lmet lalt spc ralt rctl up
left down rght
)
EOF
}
# conf_print_dell_d830_template_deflayer_querty | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_colemak_dh() {
cat <<EOF
(deflayer colemak-dh
_ _ _ _ _ _ _ _ _ _
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _ _ _
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
@ext a r s t g m n e i o ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl _ lmet lalt spc ralt rmet _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_colemak_dh | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_colemak_dhk() {
cat <<EOF
(deflayer colemak-dhk
_ _ _ _ _ _ _ _ _ _
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _ _ _
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
@ext a r s t g k n e i o ' \\ ret
lsft z x c d v 102d m h , . / rsft
lctl _ lmet lalt spc ralt rmet _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_colemak_dhk | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
conf_print_dell_d830_template_deflayer_extend() {
cat <<EOF
(deflayer extend
_ _ _ _ _ _ _ _ _ _
_ play rewind previoussong nextsong ejectcd refresh brdn brup www mail prog1 prog2
_ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _ _ _
_ esc @bk @fnd @fw ins pgup home up end menu prnt slck
_ lalt lmet lsft lctl ralt pgdn lft down rght del caps _ _
_ @udo @cut @cpy tab @pst _ pgdn bks lsft lctl comp _
_ _ _ _ ret _ _ _
_ _ _
)
EOF
}
# conf_print_dell_d830_template_deflayer_extend | tee -a ${DEST}/.config/kmonad/keymap/template/dell_D830_iso.kbd
cat <<EOF
(deflayer empty
_ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _
)
EOF