mult keyboards with same layout implemenations ideas #390
Replies: 3 comments 31 replies
-
IIRC, something like this was discussed previously in an issue. I think this we will be easy to do when the whole code refactor is done (especially the work in Btw, you can use a shell script to do what you want. #!/sbin/env zsh
local defsrc="${K_DEFSRC:-$HOME/.config/kmonad/defsrc.kbd}"
local baselayer="${K_BASELAYER:-$HOME/.config/kmonad/ansi_base.kbd}"
# $1 => config
# $2-$n => kmonad args
exec kmonad =(cat "$defsrc" "$baselayer" "$1") "$@[2,-1]" E.g. env K_BASELAYER=$HOME/.config/kmonad/iso_base.kbd $HOME/.local/bin/kmonad_m $HOME/.config/kmonad/80keys.kbd |
Beta Was this translation helpful? Give feedback.
-
@MuhammedZakir if you have time may I ask you for your opinion on this because I am unsure if this will work or not. I have been looking for a while now at your code snippet above and re-read the tutorial.kbd, and my question is how I specify where in the defsrc that my sublayout should be mapped to. As an example I have provided my own layouts that I want to use I also realize above that the laptop keyboards have 5 bottom row keys and the ergodox has 6, therefor I am mapping ;; 1. Below, are my three hardware keyboard layouts.
;; I have replaced the keys that are supposed to be replaced
;; by my 5 by 3 layout with underscores to make it easy to see
;; what I am trying to achieve.
(deflayer BASE_ERGODOX
XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX _ _ _ _ _ XX XX _ _ _ _ _ XX
XX _ _ _ _ _ _ _ _ _ _ XX
XX _ _ _ _ _ XX XX _ _ _ _ _ XX
XX XX _ _ _ _ _ _ XX XX
XX XX XX XX
XX XX
XX XX XX XX XX XX
)
;; in the layouts below, which are my standard lapo keyboards, I have shifted
;; `zxcvb` one step to the left in order to achieve a more comfortable 3 by 5
;; layout
(deflayer BASE_MACBOOK_PRO_SWE
XX XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX XX XX
XX _ _ _ _ _ _ _ _ _ _ XX XX XX
XX _ _ _ _ _ _ _ _ _ _ XX XX
XX _ _ _ _ _ XX _ _ _ _ _ XX XX
XX XX _ _ _ _ _ XX XX XX
)
(deflayer BASE_MACBOOK_AIR
XX XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX _ _ _ _ _ _ _ _ _ _ XX XX XX
XX _ _ _ _ _ _ _ _ _ _ XX XX
_ _ _ _ _ XX _ _ _ _ _ XX XX
XX XX _ _ _ _ _ XX XX XX
)
;; 2. And now follows my minimal layout. that should go into the layouts
;; above.
(deflayer MINIMAL_SUBLAYOUT
XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX
) |
Beta Was this translation helpful? Give feedback.
-
Here's a work around using a macro processor: #435. |
Beta Was this translation helpful? Give feedback.
-
Yo!!!
I have thought about it and it would be nice if you could create a tiny defsrc file for each keyboard you own and then
manage the actual custom layout you use with kmonad in a single file. I start a discussion thread on this here.
For example, in my use case, I use a 3 by 5 minimal layout which means that my layout fits within any keyboard that exists out there, so therefore I am imagining something like this:
Then, the next step is to modify the parser or something in the core that accounts for this.
I am imagining that one sources the
main.kbd
into each defsrc and you also would have tospecify which positions in the keyboard array that would correspond to the main layout.
I am not so good at haskell still but if I get good enough I want to implement this.
It feels like you'd take the current parser functionality and make it into a two step process kind of.
This idea makes sense, right?? :D
Beta Was this translation helpful? Give feedback.
All reactions