Skip to content

Commit

Permalink
keymaps (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabi1cazenave authored Nov 13, 2024
1 parent 401822c commit 9fe0ea4
Show file tree
Hide file tree
Showing 58 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
all:
@find layouts -type f \( -name '*.toml' -o -name '*.yaml' \) | while read -r file; do \
@find keymaps -type f \( -name '*.toml' -o -name '*.yaml' \) | while read -r file; do \
kalamine build "$$file" --out "$$(echo $$file | sed 's/....$$/json/')"; \
done

watch:
@inotifywait -m -r layouts -e close_write | while read -r path _action file; do \
@inotifywait -m -r keymaps -e close_write | while read -r path _action file; do \
case $$file in \
*.yaml | *.toml) echo kalamine build "$$path$$file" --out "$$path$$(basename "$${file%.*}").json";; \
esac \
Expand All @@ -21,7 +21,7 @@ clean:
install:
@echo "Installer script for XKB (GNU/Linux)."
@echo
xkalamine install layouts/ergol.toml
xkalamine install keymaps/ergol.toml

uninstall:
@echo "Unistaller script for XKB (GNU/Linux)."
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ their guide), you can just run the following command:
pipx install kalamine
```

Download the [layouts/ergol.toml][4] file in this repo and build the layout :
Download the [keymaps/ergol.toml][4] file in this repo and build the layout :

```bash
kalamine build ergol.toml
Expand All @@ -86,7 +86,7 @@ and you should be good to go !

[2]: https://github.com/OneDeadKey/kalamine
[3]: https://github.com/OneDeadKey/kalamine#installing-distributable-layouts
[4]: https://github.com/Nuclear-Squid/ergol/blob/master/layouts/ergol.toml
[4]: https://github.com/Nuclear-Squid/ergol/blob/master/keymaps/ergol.toml
[5]: https://github.com/pypa/pipx?tab=readme-ov-file#install-pipx


Expand Down Expand Up @@ -125,7 +125,7 @@ XMODIFIERS=@im=ibus
Make Your Own !
--------------------------------------------------------------------------------

If you wish to modify the layout, the `layouts/*.{toml,yaml}` are human-readable
If you wish to modify the layout, the `keymaps/*.{toml,yaml}` are human-readable
ASCII arts of the final layout. You can easily edit them, then run `make` (or
`make watch`) at the root of the repo to generate the `.json` files used to
benchmark layouts on the [stats page][1].
Expand Down Expand Up @@ -164,7 +164,7 @@ command generates the `json` stat file for this specific corpus.
[Hugo](https://gohugo.io/) can be used to serve the site, it automatically
watches and live-reload the pages upon file changes, however you still need to
have `make watch` running to ensure that the `.json` files are generated upon
modifying human-friendly layouts in `layouts/*.{to,ya}ml`.
modifying human-friendly layouts in `keymaps/*.{to,ya}ml`.

You can thus run your local instance of the Ergo‑L website either by running
`hugo server` in the [`www/`](www/) directory, or _via_:
Expand Down
2 changes: 1 addition & 1 deletion code/duck-typist.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ window.addEventListener('DOMContentLoaded', () => {
// fetch a kalamine keyboard layout
const fetchLayout = () => {
const selected = gLayout.querySelector(`option[value="${gLayout.value}"`);
return fetch(`../layouts/${selected.dataset.folder}/${gLayout.value}.json`)
return fetch(`../keymaps/${selected.dataset.folder}/${gLayout.value}.json`)
.then(response => response.json())
.then(layout => {
gKeyboard.setKeyboardLayout(layout.keymap, layout.deadkeys, gGeometry.value);
Expand Down
2 changes: 1 addition & 1 deletion code/layout-analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ window.addEventListener('DOMContentLoaded', () => {
if (value) {
const layoutFolder = document
.querySelector(`#layout option[value="${value}"]`).dataset.folder;
fetch(`../layouts/${layoutFolder}/${value}.json`)
fetch(`../keymaps/${layoutFolder}/${value}.json`)
.then(response => response.json())
.then(data => {
const selectedOption = document
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion www/content/alternatives/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ https://discord.com/channels/794732334879473684/794734985122152478/1200680341363

[compatibilité délicate]: /claviers/#les-limitations-de-bépo-béopy-optimot
[note globale sur KLAnext]: /articles/analyse_et_optimisation/#lapproche-optimot
[licence non libre]: https://github.com/Nuclear-Squid/ergol/blob/main/layouts/fr.nonfree/LICENSE.md
[licence non libre]: https://github.com/Nuclear-Squid/ergol/blob/main/keymaps/fr.nonfree/LICENSE.md
2 changes: 1 addition & 1 deletion www/content/alternatives/bepo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,4 @@ beaucoup trop élevé à notre avis — à comparer aux 6.9 % pour Ergo‑L. *
[workman]: https://workmanlayout.org
[colemak]: https://colemak.com
[lafayette]: https://qwerty-lafayette.org
[optimot]: https://github.com/Nuclear-Squid/ergol/blob/main/layouts/fr.nonfree/LICENSE.md
[optimot]: https://github.com/Nuclear-Squid/ergol/blob/main/keymaps/fr.nonfree/LICENSE.md
2 changes: 1 addition & 1 deletion www/content/dactylo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h2><span class="key_list"></span><span class="quacks">🦆</span></h2>
<x-keyboard></x-keyboard>
<p style="text-align: right;">
<span style="float: left;">
{{< layout-list >}}
{{< keymap-list >}}
<select id="dict">
<option value="fr,french_1k">Français 1k</option>
<option value="fr,french_10k" selected>Français 10k</option>
Expand Down
2 changes: 1 addition & 1 deletion www/content/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Licence
[WTFPL](http://wtfpl.net/) – Do What the Fuck You Want to Public License.


[fichier source]: /layouts/ergol.toml
[fichier source]: /keymaps/ergol.toml
[cavalier.pdf]: cavalier.pdf
[ergol_nomade.zip]: https://github.com/Nuclear-Squid/ergol/releases/download/ergol-v1.0.0/ergol_nomade.zip
[ergol_kbd.exe]: https://github.com/Nuclear-Squid/ergol/releases/download/ergol-v1.0.0/ergol_kbd.exe
Expand Down
2 changes: 1 addition & 1 deletion www/content/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<div id="sticky-select">
<form>
{{< layout-list >}}
{{< keymap-list >}}
<select id="geometry">
<option value="iso" selected>ISO</option>
<option value="ansi">ANSI</option>
Expand Down
4 changes: 2 additions & 2 deletions www/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ author = "authors"
source = "../corpus"
target = "static/corpus"
[[module.mounts]]
source = "../layouts"
target = "static/layouts"
source = "../keymaps"
target = "static/keymaps"
[[module.mounts]]
source = "static"
target = "static"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ $default_layout := "ergol" }}
{{ $layouts := dict
{{ $keymaps := dict
"en" (dict
"qwerty" "Qwerty"
"dvorak" "Dvorak"
Expand Down Expand Up @@ -36,9 +36,9 @@
}}

<select id="layout">
{{ range $language, $layouts_language := $layouts }}
{{ range $language, $keymaps_language := $keymaps }}
<option disabled>  [{{ $language }}]</option>
{{ range $json_name, $displayed_name := $layouts_language }}
{{ range $json_name, $displayed_name := $keymaps_language }}
{{ if eq $default_layout $json_name }}
<option data-folder="{{$language}}" value="{{ $json_name }}" selected> {{ $displayed_name }} </option>
{{ else }}
Expand Down
2 changes: 1 addition & 1 deletion www/layouts/shortcodes/x-keyboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{{ with .Get "data" }}
<dialog>
<input spellcheck="false" placeholder="zone de saisie {{ $name }}" />
<x-keyboard src="/layouts/fr/{{ . }}.json"></x-keyboard>
<x-keyboard src="/keymaps/fr/{{ . }}.json"></x-keyboard>
</dialog>
{{ end }}
<nav>
Expand Down

0 comments on commit 9fe0ea4

Please sign in to comment.