From eaf70d29098b9708feb764d6c31cabaafa9c1858 Mon Sep 17 00:00:00 2001 From: MoonlightWave-12 <135532-MoonlightWave-12@users.noreply.gitlab.gnome.org> Date: Sun, 14 Apr 2024 12:46:32 +0200 Subject: [PATCH 1/6] COPYING: Update links to match the current revision of the GPLv3 It is now identical to https://www.gnu.org/licenses/gpl-3.0.txt . Part-of: --- COPYING | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/COPYING b/COPYING index 94a9ed02..f288702d 100644 --- a/COPYING +++ b/COPYING @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. From 07ccea0fb5fd0cad656eeb7fbcbe24b299d9dd9d Mon Sep 17 00:00:00 2001 From: MoonlightWave-12 <135532-MoonlightWave-12@users.noreply.gitlab.gnome.org> Date: Sun, 14 Apr 2024 09:19:17 +0200 Subject: [PATCH 2/6] Change "http://" to "https://" Part-of: --- debian/copyright | 2 +- eekboard/eekboard-context-service.c | 2 +- eekboard/eekboard-context-service.h | 2 +- src/dbus.c | 2 +- src/dbus.h | 2 +- src/server-context-service.c | 2 +- src/server-context-service.h | 2 +- src/server-main.c | 2 +- src/style.rs | 2 +- src/xdg.rs | 8 ++++---- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/debian/copyright b/debian/copyright index 576ed9a5..8c7b70fe 100644 --- a/debian/copyright +++ b/debian/copyright @@ -173,7 +173,7 @@ License: LGPL-2+ Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . + License along with this library. If not, see . License: X11 Permission to use, copy, modify, distribute, and sell this software and diff --git a/eekboard/eekboard-context-service.c b/eekboard/eekboard-context-service.c index f11989f6..b3001653 100644 --- a/eekboard/eekboard-context-service.c +++ b/eekboard/eekboard-context-service.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include "config.h" diff --git a/eekboard/eekboard-context-service.h b/eekboard/eekboard-context-service.h index 1ba28fae..ca4e1d71 100644 --- a/eekboard/eekboard-context-service.h +++ b/eekboard/eekboard-context-service.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #if !defined(__EEKBOARD_SERVICE_H_INSIDE__) && !defined(EEKBOARD_COMPILATION) #error "Only can be included directly." diff --git a/src/dbus.c b/src/dbus.c index b894a2e1..3d48a4bb 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include "config.h" diff --git a/src/dbus.h b/src/dbus.h index 9080bf28..4eceedf6 100644 --- a/src/dbus.h +++ b/src/dbus.h @@ -14,7 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #ifndef DBUS_H_ #define DBUS_H_ 1 diff --git a/src/server-context-service.c b/src/server-context-service.c index debcb79b..06553101 100644 --- a/src/server-context-service.c +++ b/src/server-context-service.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include "config.h" diff --git a/src/server-context-service.h b/src/server-context-service.h index c47b8c91..36b5d27b 100644 --- a/src/server-context-service.h +++ b/src/server-context-service.h @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #ifndef SERVER_CONTEXT_SERVICE_H #define SERVER_CONTEXT_SERVICE_H 1 diff --git a/src/server-main.c b/src/server-main.c index ccbce2e7..a823f546 100644 --- a/src/server-main.c +++ b/src/server-main.c @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include #include diff --git a/src/style.rs b/src/style.rs index 2715743e..23356717 100644 --- a/src/style.rs +++ b/src/style.rs @@ -13,7 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see .Free + * License along with this library. If not, see .Free */ /*! CSS data loading. */ diff --git a/src/xdg.rs b/src/xdg.rs index fe88aa25..2b5f2ce1 100644 --- a/src/xdg.rs +++ b/src/xdg.rs @@ -4,8 +4,8 @@ * by "Simon Ochsenreither ", * Licensed under either of - Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) - MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) + Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0) + MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT) at your option. * @@ -13,8 +13,8 @@ at your option. * by "Simon Ochsenreither ", * Licensed under either of - Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) - MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) + Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0) + MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT) at your option. * From c21fbd86acf7db0cc160f31e810e17e4d11c7441 Mon Sep 17 00:00:00 2001 From: MoonlightWave-12 <135532-MoonlightWave-12@users.noreply.gitlab.gnome.org> Date: Sun, 14 Apr 2024 09:53:24 +0200 Subject: [PATCH 3/6] Change "GPL-3.0+" to "GPL-3.0-or-later" The "GPL-3.0+"-SPDX-license-identifier has been deprecated, and was replaced with "GPL-3.0-or-later". More information about that, is available in the "Deprecated License Identifiers"-part of https://spdx.org/licenses/ . Part-of: --- src/actors/mod.rs | 2 +- src/actors/popover.rs | 2 +- src/animation.rs | 2 +- src/data/loading.rs | 2 +- src/data/mod.rs | 2 +- src/data/parsing.rs | 2 +- src/event_loop/driver.rs | 2 +- src/event_loop/mod.rs | 2 +- src/main.rs | 2 +- src/outputs.rs | 2 +- src/panel.rs | 4 ++-- src/server-main.c | 2 +- src/state.rs | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/actors/mod.rs b/src/actors/mod.rs index 8e45d673..fe23d468 100644 --- a/src/actors/mod.rs +++ b/src/actors/mod.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2022 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Actors are parts of Squeekboard containing state independent from the main application state. diff --git a/src/actors/popover.rs b/src/actors/popover.rs index c2a3caa2..8bbca70d 100644 --- a/src/actors/popover.rs +++ b/src/actors/popover.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2022 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! The popover is opened directly by the GTK surface, diff --git a/src/animation.rs b/src/animation.rs index f1c53fd0..61b6c3f2 100644 --- a/src/animation.rs +++ b/src/animation.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2020 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Animation details */ diff --git a/src/data/loading.rs b/src/data/loading.rs index c3c26853..c26108df 100644 --- a/src/data/loading.rs +++ b/src/data/loading.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2020-2021 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Loading layout files */ diff --git a/src/data/mod.rs b/src/data/mod.rs index 99c7660b..cc85662e 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2020-2021 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Combined module for dealing with layout files */ diff --git a/src/data/parsing.rs b/src/data/parsing.rs index b70a2ffe..2525e1ae 100644 --- a/src/data/parsing.rs +++ b/src/data/parsing.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2020-2021 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Parsing of the data files containing layouts */ diff --git a/src/event_loop/driver.rs b/src/event_loop/driver.rs index 4fb57ff0..b29b5a5d 100644 --- a/src/event_loop/driver.rs +++ b/src/event_loop/driver.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2021 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! This drives the loop from the `loop` module. diff --git a/src/event_loop/mod.rs b/src/event_loop/mod.rs index 05af69a7..1fde38b9 100644 --- a/src/event_loop/mod.rs +++ b/src/event_loop/mod.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2021 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! The loop abstraction for driving state changes. diff --git a/src/main.rs b/src/main.rs index e6360bfa..d410c18a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2020,2022 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Glue for the main loop. */ diff --git a/src/outputs.rs b/src/outputs.rs index cbe7825c..ad9adcb9 100644 --- a/src/outputs.rs +++ b/src/outputs.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2019-2022 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Managing Wayland outputs */ diff --git a/src/panel.rs b/src/panel.rs index 5443f4b1..4691b0c2 100644 --- a/src/panel.rs +++ b/src/panel.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2022 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Panel state management. @@ -380,4 +380,4 @@ mod tests { }, ); } -} \ No newline at end of file +} diff --git a/src/server-main.c b/src/server-main.c index a823f546..8b3dc212 100644 --- a/src/server-main.c +++ b/src/server-main.c @@ -2,7 +2,7 @@ * Copyright (C) 2010-2011 Daiki Ueno * Copyright (C) 2010-2011 Red Hat, Inc. * Copyright (C) 2018-2019 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later * Author: Guido Günther * * This program is free software: you can redistribute it and/or modify diff --git a/src/state.rs b/src/state.rs index 4998b29b..b4fea9fc 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,5 +1,5 @@ /* Copyright (C) 2021,2022 Purism SPC - * SPDX-License-Identifier: GPL-3.0+ + * SPDX-License-Identifier: GPL-3.0-or-later */ /*! Application-wide state is stored here. From 96c5b263ad94cd8bd6bc876204c69704c10c17b2 Mon Sep 17 00:00:00 2001 From: MoonlightWave-12 <135532-MoonlightWave-12@users.noreply.gitlab.gnome.org> Date: Sun, 14 Apr 2024 14:36:25 +0200 Subject: [PATCH 4/6] doc/*: Fix typos and add a few small improvements Part-of: --- README.md | 2 +- doc/hacking.md | 50 ++++++++++++++++++++++++------------------------- doc/layouts.md | 5 +++-- doc/tutorial.md | 6 +++--- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 3be35c7a..e19fa1a3 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ $ gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true Alternatively, force panel visibility manually with: ```bash -busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true +$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true ``` ### What the compositor has to support diff --git a/doc/hacking.md b/doc/hacking.md index 0950a164..97a25850 100644 --- a/doc/hacking.md +++ b/doc/hacking.md @@ -27,7 +27,7 @@ To give an idea of what it means in practice, those are some examples of what ha - storing resources and config as editable, standard files, - having complete, up to date documentation of interfaces, - having an easy process of sending contributions, -- adapting to to user's settings and constrains without overriding them, +- adapting to the user's settings and constraints without overriding them, - avoiding compiling whenever possible, - making it easy to build, - having code that is [simple and obvious](https://www.python.org/dev/peps/pep-0020/), @@ -52,8 +52,8 @@ Recent Fedora releases are likely to be tested as well. On a Debian based system run ```sh -sudo apt-get -y install build-essential -sudo apt-get -y build-dep . +$ sudo apt-get -y install build-essential +$ sudo apt-get -y build-dep . ``` For an explicit list of dependencies check the `Build-Depends` entry in the [`debian/control`](debian/control) file. @@ -74,22 +74,22 @@ Most common testing is done in CI. Occasionally, and for each release, do perfor - it changes layouts - it changes views -Testing with an application: +#### Testing with an application ``` -python3 tools/entry.py +$ python3 tools/entry.py ``` -Testing visibility: +#### Testing visibility ``` $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false ``` -Testing layouts: +#### Testing layouts -Layouts can be selected using the GNOME Settings application. +Available Layouts can be selected by using the GNOME Settings application. ``` # define all available layouts. First one is currently selected. @@ -101,7 +101,7 @@ $ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', Squeekboard prints some information on standard output by default. To get deep debugging information, it can also print all changes in (some of) its internal state. Those logs are most useful when reporting hard to catch issues, and can be enabled using the following command: ``` -busctl set-property --user sm.puri.SqueekDebug /sm/puri/SqueekDebug sm.puri.SqueekDebug Enabled b true +$ busctl set-property --user sm.puri.SqueekDebug /sm/puri/SqueekDebug sm.puri.SqueekDebug Enabled b true ``` ### Environment Variables @@ -121,8 +121,8 @@ Coding Reference documentation can be generated using: ``` -cd squeekboard_build/ -../squeekboard_source/cargo.sh doc --no-deps --document-private-items +$ cd squeekboard_build/ +$ .../squeekboard_source/cargo.sh doc --no-deps --document-private-items ``` as well as found [online](https://world.pages.gitlab.gnome.org/Phosh/squeekboard/doc/rs/). @@ -150,7 +150,7 @@ Note that some portions, like the .gitlab-ci.yml file have accummulated enough s To fix your contributions before submitting a change, use: ``` -./tools/style-check_source --apply +$ ./tools/style-check_source --apply ``` * * * @@ -209,8 +209,8 @@ Squeekboard uses Rust & Cargo for some of its dependencies. Use the `cargo.sh` script for maintaining the Cargo part of the build. The script takes the usual Cargo commands, after the first 2 positional arguments: source directory, and output artifact. So, `cargo test` becomes: ``` -cd build_dir -sh /source_path/cargo.sh test +$ cd build_dir +$ sh /source_path/cargo.sh test ``` ### Cargo dependencies @@ -224,15 +224,15 @@ Releases Squeekboard should get a new release every time something interesting comes in. Preferably when there are no known bugs too. People will rely on theose releases, after all. -### 1. Update `Cargo.toml`. +### 1. Update `Cargo.lock`. While the file is not actually used, it's a good idea to save the config in case some rare bug appears in dependencies. ``` -cd squeekboard-build -.../squeekboard-source/cargo.sh update -ninja test -cp ./Cargo.lock .../squeekboard-source +$ cd squeekboard-build +$ .../squeekboard-source/cargo.sh update +$ ninja test +$ cp ./Cargo.lock .../squeekboard-source ``` Then commit the updated `Cargo.lock`. @@ -252,8 +252,8 @@ It's in the `project(version: xxx)` statement. Packaging is in the `debian/` directory, and creates builds that can be quickly tested. ``` -cd squeekboard-source -EMAIL=my_address@example.com gbp dch --multimaint-merge --ignore-branch --git-author --distribution=experimental --new-version=x.y.z +$ cd squeekboard-source +$ EMAIL=my_address@example.com gbp dch --multimaint-merge --ignore-branch --git-author --distribution=experimental --new-version=x.y.z ``` Inspect `debian/changelog`, and make sure the first line contains the correct version number and suite. For example: @@ -264,7 +264,7 @@ squeekboard (1.22.0) experimental; urgency=medium Add the updated `debian/changelog` to the commit. The commit message should contain the release version and a description of changes. -(`gbp` can be installed with `sudo apt install git-buildpackage`) +(`gbp` can be installed on Debian based systems with `sudo apt install git-buildpackage`) ### 5. Update the NEWS file @@ -284,7 +284,7 @@ Changes: Generate a commit message from the NEWS file: ``` -tools/make_message | git commit --file=- ... +$ tools/make_message | git commit --file=- ... ``` If the commit message looks wrong, fix the NEWS file, and do `git commit --amend`. @@ -294,8 +294,8 @@ If the commit message looks wrong, fix the NEWS file, and do `git commit --amend The tag should be the version number with "v" in front of it. The tag message should be "squeekboard" and the tag name. Push it to the upstream repository: ``` -git tag -s -u my_address@example.com v1.22.0 -m "squeekboard v1.22.0" -git push origin v1.22.0 +$ git tag -s -u my_address@example.com v1.22.0 -m "squeekboard v1.22.0" +$ git push origin v1.22.0 ``` ### 8. Rejoice diff --git a/doc/layouts.md b/doc/layouts.md index e002ee26..9675bc99 100644 --- a/doc/layouts.md +++ b/doc/layouts.md @@ -19,7 +19,7 @@ Each hint directory contains multiple layout files. A single language will be co After the language name optionally comes a "+" and an indication of the variant. For example, "it+fur". -Squeekboard will look for those based on the currently selected layout in Gnome Control Center. +Squeekboard will look for those based on the currently selected layout in GNOME Settings. Then, there's an optional part "_wide", which Squeekboard will try to use if the current display is rather wide. Example: "us+colemak_wide" or "us_wide". @@ -40,6 +40,7 @@ The "outlines" dictionary controls the widths and heights of buttons. outlines: default: { width: 32, height: 52 } ``` + The width and height numbers are not in pixels, but rather they are proportionally scaled to fit the panel size. There may be any number of outlines, but there are some special names: @@ -118,4 +119,4 @@ The two switching modes are better described in the [views](views.md) document. Sources ---------- -The sources, where all this is documented and up to date are in "src/data/parsing.rs". The reference documentation for the `rs::data::parsing::Layout` structure is the main place to look at. \ No newline at end of file +The sources, where all this is documented and up to date are in "src/data/parsing.rs". The reference documentation for the `rs::data::parsing::Layout` structure is the main place to look at. diff --git a/doc/tutorial.md b/doc/tutorial.md index d8108644..a1269b57 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -23,7 +23,7 @@ Creating a layout is easy. You don't need to recompile things, just edit and tes * Find the correct name of the .yaml file associated with that input source. This can be found with the command ``` -gsettings get org.gnome.desktop.input-sources sources +$ gsettings get org.gnome.desktop.input-sources sources ``` The output should be something like this: `[('xkb', 'us'), ('xkb', 'de')]` @@ -40,13 +40,13 @@ The yaml file will overwrite the default settings for that layout. If you want t You can also use the `test_layout` tool from the -devel package to check it for errors: ``` -# squeekboard_test_layout ./mylayout.yaml +$ squeekboard_test_layout ./mylayout.yaml Test result: OK ``` ## Contributing your changes -If you want to share your layout with the world, the best way is to submit it to the Squeekboard project. The workflow is similar to any other Gitlab-based project. +If you want to share your layout with the world, the best way is to submit it to the Squeekboard project. The workflow is similar to any other GitLab-based project. Above all, your layout should be working, be tested, not break anything, and make sense. From cff687d77829dc52e21336c7634ba8d8054314a6 Mon Sep 17 00:00:00 2001 From: MoonlightWave-12 <135532-MoonlightWave-12@users.noreply.gitlab.gnome.org> Date: Sun, 14 Apr 2024 13:38:20 +0200 Subject: [PATCH 5/6] Add syntax-highlighting in the documentation Part-of: --- README.md | 8 ++++---- doc/hacking.md | 22 +++++++++++----------- doc/layouts.md | 10 +++++----- doc/tutorial.md | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index e19fa1a3..22126904 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ See `.gitlab-ci.yml` or run `apt-get build-dep .` ### Build from git repo -```bash +```sh $ git clone https://gitlab.gnome.org/World/Phosh/squeekboard.git $ cd squeekboard $ mkdir _build @@ -52,7 +52,7 @@ To run tests use `ninja test`. To install squeekboard run `ninja install`. Running ------- -```bash +```sh $ phoc # if no compatible Wayland compositor is running yet $ cd ../build/ $ src/squeekboard @@ -62,13 +62,13 @@ Squeekboard's panel will appear whenever a compatible application requests an in Squeekboard honors the gnome "screen-keyboard-enabled" setting. Either enable this through gnome-settings under accessibility or run: -```bash +```sh $ gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true ``` Alternatively, force panel visibility manually with: -```bash +```sh $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true ``` diff --git a/doc/hacking.md b/doc/hacking.md index 97a25850..06ad04c4 100644 --- a/doc/hacking.md +++ b/doc/hacking.md @@ -76,13 +76,13 @@ Most common testing is done in CI. Occasionally, and for each release, do perfor #### Testing with an application -``` +```sh $ python3 tools/entry.py ``` #### Testing visibility -``` +```sh $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false ``` @@ -91,7 +91,7 @@ $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false Available Layouts can be selected by using the GNOME Settings application. -``` +```sh # define all available layouts. First one is currently selected. $ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'de')]" ``` @@ -100,7 +100,7 @@ $ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', Squeekboard prints some information on standard output by default. To get deep debugging information, it can also print all changes in (some of) its internal state. Those logs are most useful when reporting hard to catch issues, and can be enabled using the following command: -``` +```sh $ busctl set-property --user sm.puri.SqueekDebug /sm/puri/SqueekDebug sm.puri.SqueekDebug Enabled b true ``` @@ -120,7 +120,7 @@ Coding Reference documentation can be generated using: -``` +```sh $ cd squeekboard_build/ $ .../squeekboard_source/cargo.sh doc --no-deps --document-private-items ``` @@ -149,7 +149,7 @@ Note that some portions, like the .gitlab-ci.yml file have accummulated enough s To fix your contributions before submitting a change, use: -``` +```sh $ ./tools/style-check_source --apply ``` @@ -208,7 +208,7 @@ Squeekboard uses Rust & Cargo for some of its dependencies. Use the `cargo.sh` script for maintaining the Cargo part of the build. The script takes the usual Cargo commands, after the first 2 positional arguments: source directory, and output artifact. So, `cargo test` becomes: -``` +```sh $ cd build_dir $ sh /source_path/cargo.sh test ``` @@ -228,7 +228,7 @@ Squeekboard should get a new release every time something interesting comes in. While the file is not actually used, it's a good idea to save the config in case some rare bug appears in dependencies. -``` +```sh $ cd squeekboard-build $ .../squeekboard-source/cargo.sh update $ ninja test @@ -251,7 +251,7 @@ It's in the `project(version: xxx)` statement. Packaging is in the `debian/` directory, and creates builds that can be quickly tested. -``` +```sh $ cd squeekboard-source $ EMAIL=my_address@example.com gbp dch --multimaint-merge --ignore-branch --git-author --distribution=experimental --new-version=x.y.z ``` @@ -283,7 +283,7 @@ Changes: Generate a commit message from the NEWS file: -``` +```sh $ tools/make_message | git commit --file=- ... ``` @@ -293,7 +293,7 @@ If the commit message looks wrong, fix the NEWS file, and do `git commit --amend The tag should be the version number with "v" in front of it. The tag message should be "squeekboard" and the tag name. Push it to the upstream repository: -``` +```sh $ git tag -s -u my_address@example.com v1.22.0 -m "squeekboard v1.22.0" $ git push origin v1.22.0 ``` diff --git a/doc/layouts.md b/doc/layouts.md index 9675bc99..4d278aeb 100644 --- a/doc/layouts.md +++ b/doc/layouts.md @@ -36,7 +36,7 @@ The layout file follows the YAML syntax, with specific meanings given to section The "outlines" dictionary controls the widths and heights of buttons. -``` +```yaml outlines: default: { width: 32, height: 52 } ``` @@ -52,7 +52,7 @@ There may be any number of outlines, but there are some special names: The "views" dictionary contains the actual views and positions of buttons. -``` +```yaml views: base: - "q w e r t y u i o p å" @@ -64,7 +64,7 @@ There is only one special view "base". Views and view switching are described in Views in Squeekboard are based on rows. The first row comes near the top of the panel, the next one below, and so on. -``` +```yaml - "Q W E R T Y U I O P Å" - "upper z x c v b n m BackSpace" ``` @@ -81,7 +81,7 @@ Similarly, buttons that do not emit characters must have some names. The buttons section describes what the button looks like and what it does. -``` +```yaml BackSpace: outline: altline icon: "edit-clear-symbolic" @@ -102,7 +102,7 @@ The button description can have a number of components, each optional. For detai #### Action -``` +```yaml action: set_view: "numbers" ``` diff --git a/doc/tutorial.md b/doc/tutorial.md index a1269b57..97009ffe 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -22,7 +22,7 @@ Creating a layout is easy. You don't need to recompile things, just edit and tes * Select and enable the input source you would like to change from the Region & Language section of the device settings. Perhaps use "A user-defined custom layout" listed under Other. * Find the correct name of the .yaml file associated with that input source. This can be found with the command -``` +```sh $ gsettings get org.gnome.desktop.input-sources sources ``` @@ -39,7 +39,7 @@ The yaml file will overwrite the default settings for that layout. If you want t You can also use the `test_layout` tool from the -devel package to check it for errors: -``` +```sh $ squeekboard_test_layout ./mylayout.yaml Test result: OK ``` From 5de4a6ad92bd15c4354679afa5b2e15e4e69aa47 Mon Sep 17 00:00:00 2001 From: MoonlightWave-12 <135532-MoonlightWave-12@users.noreply.gitlab.gnome.org> Date: Thu, 11 Apr 2024 15:49:44 +0200 Subject: [PATCH 6/6] Improve Documentation Part-of: --- README.md | 5 +++-- doc/hacking.md | 24 +++++++++++++++++------- doc/index.md | 9 +++++++-- doc/layouts.md | 28 ++++++++++++++++++++-------- doc/tutorial.md | 5 +---- 5 files changed, 48 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 22126904..ca26f4bb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ *squeekboard* - a Wayland on-screen keyboard ======================================== -*Squeekboard* is a keyboard-shaped input method supporting Wayland, built primarily for the *Librem 5* phone. +*Squeekboard* is the on-screen keyboard for Phosh. It is primarily designed for smartphones, tablet-PCs, and other devices with touchscreens. It squeaks because some Rust got inside. @@ -19,7 +19,8 @@ Features ### TODO -- Text prediction/correction +- [Port to GTK4 / GTK4-Layer-Shell](https://gitlab.gnome.org/World/Phosh/squeekboard/-/issues/64) +- [Text prediction/correction](https://gitlab.gnome.org/World/Phosh/squeekboard/-/issues/54) - Use preedit - Submit actions like "next field" using a future Wayland protocol - Pick up DBus interface files from /usr/share diff --git a/doc/hacking.md b/doc/hacking.md index 06ad04c4..895cae96 100644 --- a/doc/hacking.md +++ b/doc/hacking.md @@ -43,9 +43,9 @@ By submitting a change to this project, you agree to license it under the [GPL l Development environment ----------------------- -*Squeekboard* is regularly built and tested on [the development environment](https://developer.puri.sm/Librem5/Development_Environment.html). +*Squeekboard* is regularly built and tested on [Debian Testing](https://www.debian.org/releases/testing/) and [Mobian Testing](https://mobian.org/). -Recent Fedora releases are likely to be tested as well. +For testing Squeekboard on a PC as if it was used on a smartphone, one can use an emulator. Instructions for that can be found in the [documentation for setting up a development-environment for the Librem 5](https://developer.puri.sm/Librem5/Development_Environment/Boards/emulators.html). ### Dependencies @@ -91,6 +91,8 @@ $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false Available Layouts can be selected by using the GNOME Settings application. +Those can also be set with `gsettings`: + ```sh # define all available layouts. First one is currently selected. $ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'de')]" @@ -113,6 +115,12 @@ contain a comma separated list of: - `force-show` : Show squeekboard on startup independent of any gsettings or compositor requests - `gtk-inspector`: Spawn [gtk-inspector](https://wiki.gnome.org/Projects/GTK/Inspector) + +`GTK_THEME=` can be used to choose a theme other than the default theme for Squeekboard: + + - `Adwaita:dark` is used for Squeekboard on Phosh. + - Other values that are not the name of an available theme (for example: `HighContrast`) will use the theme that is used while "High Contrast" is enabled in Phosh. + Coding ------ @@ -215,14 +223,17 @@ $ sh /source_path/cargo.sh test ### Cargo dependencies -All Cargo dependencies must be selected in the version available in PureOS, and added to the file `debian/control`. Please check with https://software.pureos.net/search_pkg?term=librust . +All Cargo dependencies must be selected in the version available in Debian Testing, and added to the file `debian/control`. Please check with the [Debian package search](https://www.debian.org/distrib/packages). Dependencies must be specified in `Cargo.toml` with 2 numbers: "major.minor". Since bugfix version number is meant to not affect the interface, this allows for safe updates. Releases ----------- +-------- -Squeekboard should get a new release every time something interesting comes in. Preferably when there are no known bugs too. People will rely on theose releases, after all. +Feature-releases should me made in time for new [Phosh releases](https://gitlab.gnome.org/World/Phosh/phosh/-/wikis/Releases) (which is currently about once a month), so that the release-notes can contain the news about Squeekboard. +However, it is not necessary to make a new release of Squeekboard for every release of Phosh. + +Bug-fix-releases should be made more often, preferably directly after important bug-fixes have been made. ### 1. Update `Cargo.lock`. @@ -240,8 +251,7 @@ Then commit the updated `Cargo.lock`. ### 2. Choose the version number Squeekboard follows [Phosh's versioning](https://gitlab.gnome.org/World/Phosh/phosh/-/wikis/Releases). -For example: The first Squeekboard-release for Phosh 0.38 should have the version-number 1.38.0. The last part of the version number (1.38.x) may be incremented independently of Phosh's version for bug-fix-releases. -Feature-releases should me made before the release of the new version of Phosh, so that the release-notes can contain the news about Squeekboard. +For example: The first Squeekboard-release for Phosh 0.38 should have the version-number 1.38.0. The last part of the version number (1.38.x) may be incremented independently of Phosh's version for bug-fix-releases. ### 3. Update the number in `meson.build` diff --git a/doc/index.md b/doc/index.md index ddfec6e8..81ef4145 100644 --- a/doc/index.md +++ b/doc/index.md @@ -4,12 +4,17 @@ Welcome to squeekboard's documentation! Introduction ------------ -Squeekboard is the on-screen keyboard for the Librem 5 phone. For information about building, look at the [README](README.md). +*Squeekboard* is the on-screen keyboard for Phosh. It is primarily designed for smartphones, tablet-PCs, and other devices with touchscreens. + +Building +-------- + +For information about building Squeekboard, read the [README](README.md). Layouts ------- -Squeekboard allows user-provided keyboard layouts. They can be created without recompiling the keyboard code. The [tutorial](tutorial.md) explains the process in detail. +Squeekboard can [load user-provided keyboard-layouts](layouts.md#Using-custom-layouts). Those can be created and used without recompiling the keyboard code. The [tutorial](tutorial.md) explains the process in detail. Layouts are created using a [text-based format, based on YAML](layouts.md). diff --git a/doc/layouts.md b/doc/layouts.md index 4d278aeb..91a04672 100644 --- a/doc/layouts.md +++ b/doc/layouts.md @@ -6,14 +6,14 @@ Squeekboard is composed of multiple layouts, several for each language, multipli Layouts live in the "keyboards" directory. Hints -------- +----- The currently supported hints are: default, "email", "emoji", "number', "pin", "terminal", and "url". Each directory in "keyboards" is named after a hint, with the "keyboards" directory itself taking the role of default. Languages/scripts ------------------------ +----------------- Each hint directory contains multiple layout files. A single language will be composed of multiple files, with names starting with the same text. The language names are taken from iso639-3. An example is "gr". @@ -27,8 +27,15 @@ Finally, the file name ends with ".yaml", e.g. "jp+kana_wide.yaml". Together with hint information, this gives a complete path to the layout like this: "keyboards/terminal/fr_wide.yaml" or "keyboards/cz+qwerty.yaml". +Using custom layouts +-------------------- + +Custom layouts will be loaded from `~/.local/share/squeekboard/keyboards/`. +In addition to loading customised layouts for languages (for example: from `~/.local/share/squeekboard/keyboards/de.yaml`, for a custom layout for the German language), Squeekboard will also load layouts for "A user-defined custom layout" from `custom.yaml`, which can be added as a keyboard-layout in the keyboard-settings of GNOME Settings. +The included (and replaceable) layouts are in: `data/keyboards/`. + Layout syntax ------------------- +------------- The layout file follows the YAML syntax, with specific meanings given to sections. @@ -44,9 +51,13 @@ outlines: The width and height numbers are not in pixels, but rather they are proportionally scaled to fit the panel size. There may be any number of outlines, but there are some special names: -- "default" applies to every button unless explicitly changed. It should be used for buttons that emit text -- "altline", "wide" have own color scheme, should be used for buttons which cause view changes -- "special" has own color scheme, to be used for confirmations like enter. + +- `default` applies to every button unless explicitly changed. It should be used for buttons that emit text. +- `change-view` has its own color scheme and a border at the bottom, it should be used for buttons which switch to a different view. +- `altline`, `wide` and `special` have their own color scheme, to be used for buttons with functionality other than entering text (for example: `Return` and `Backspace`). +- `subtle-highlight` has a slightly different colour than the `default`-buttons, to make commonly used buttons easier to find in views that are otherwise full of generally rarely used buttons (for example `ä`, `ö`, `ü`, and `ß`, in the `eschars`-view of the German layout). + +Read `style.css`, `style-Adwaita:dark.css` and `common.css`, which are in the `data`-folder, for a complete list of outline-names with special styling. ### Views @@ -73,7 +84,7 @@ Each row is a single string, and button names are separated by spaces. In left-t #### Button names in rows -Unicode characters are supported in the row string, so it's easy to use the correct name for most of them. However, the layout code is still YAML, which excludes certain characters: the space " ", the backslash "\", the double quote `"`. Those must use a replacement name. +Unicode characters are supported in the row string, so it's easy to use the correct name for most of them. However, the layout code is still YAML, which excludes certain characters: the space " ", the backslash "\", the double quote `"`. Those must either use a replacement name, or be written as `\\`, `\"`, or `"\""`, where required. Similarly, buttons that do not emit characters must have some names. @@ -117,6 +128,7 @@ The "action" property has multiple forms. The two switching modes are better described in the [views](views.md) document. Sources ----------- +------- The sources, where all this is documented and up to date are in "src/data/parsing.rs". The reference documentation for the `rs::data::parsing::Layout` structure is the main place to look at. + diff --git a/doc/tutorial.md b/doc/tutorial.md index 97009ffe..d2140ba1 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -86,7 +86,4 @@ If you want your change to become part of official Squeekboard, or if you want t * Follow these instructions to run squeekboard: [README.md#running](https://gitlab.gnome.org/World/Phosh/squeekboard/-/blob/main/README.md#running) * Additionally take a look at the contribution document for [testing info](https://gitlab.gnome.org/World/Phosh/squeekboard/-/blob/main/doc/hacking.md#testing) * You can either test it locally on your Linux system or use the [QEMU Librem 5 image](https://developer.puri.sm/Librem5/Development_Environment/Boards/emulators.html) -* To test squeekboard locally, you need phoc. Either compile that from the sources as well or use the CI repository ci.puri.sm for Debian based systems: - `deb [arch=amd64] http://ci.puri.sm/ scratch librem5` - -Squeekboard can be installed from there as a Debian package, too (that’s what I often do). But beware - there be dragons! You could bork your system with these packages and you should probably disable this repository again after installing what you need - these packages are not meant for production systems (or so I heard :wink: ) +* To test squeekboard locally, you need [phoc](https://gitlab.gnome.org/World/Phosh/phoc). Either install it from a package for your distribution, for example with `sudo apt install phoc` for Debian based distributions, or compile it from the sources.