add squeekboard toggle button
This commit is contained in:
@@ -7,7 +7,7 @@ A bottom desktop-environment panel for wlroots-based compositors, built on
|
||||
| ------- | ----------------------------------------------------------------- |
|
||||
| Left | Application menu built from `.desktop` entries, with search |
|
||||
| Middle | Open windows (task list), click to focus, middle-click to close |
|
||||
| Right | Wifi, bluetooth, and a session menu: log out, suspend, restart, shut down |
|
||||
| Right | On-screen keyboard, wifi, bluetooth, and a session menu: log out, suspend, restart, shut down |
|
||||
|
||||
No clock, no tray, no status readouts — it is designed to sit alongside a
|
||||
separate status bar.
|
||||
@@ -25,6 +25,8 @@ separate status bar.
|
||||
- NetworkManager for the wifi section, likewise optional. A NetworkManager
|
||||
configured with `wifi.backend=iwd` is fine — and is what this was built
|
||||
against — since the connection still goes through iwd underneath
|
||||
- squeekboard, as a systemd user unit, for the keyboard button — also optional;
|
||||
where the unit is not installed the button is absent
|
||||
|
||||
The window list uses the foreign-toplevel protocol rather than any single
|
||||
compositor's IPC, so it works the same everywhere — except under river 0.4,
|
||||
@@ -84,6 +86,13 @@ The `launcher`, `wifi`, `bluetooth` and `power` IPC targets each accept
|
||||
focused window. Only one menu is open at a time, so `close` closes whichever it
|
||||
is.
|
||||
|
||||
The `osk` target takes the same three and shows or hides the keyboard instead,
|
||||
which is what to bind to a hardware key or a tablet-mode switch:
|
||||
|
||||
```sh
|
||||
att_menu ipc call osk toggle
|
||||
```
|
||||
|
||||
## Behaviour
|
||||
|
||||
**Placement.** The panel is a layer-shell surface anchored to the left, right and
|
||||
@@ -113,6 +122,17 @@ The launcher is a full-screen overlay layer surface rather than an
|
||||
`xdg-popup`, which is what makes click-away dismissal and keyboard focus work on
|
||||
any wlroots compositor without compositor-specific focus grabs.
|
||||
|
||||
**On-screen keyboard.** One button shows squeekboard, another click hides it,
|
||||
and the button is accented while the keyboard is up. squeekboard runs as a
|
||||
systemd user unit (`oskUnit`, `squeekboard.service` by default): showing starts
|
||||
it if it is not already running, hiding leaves it running, since stopping it
|
||||
would only make the next keypress wait for a fresh start. Whatever manages the
|
||||
unit — a tablet-mode hook, say — stays in charge of when it exists at all.
|
||||
|
||||
The keyboard also raises and lowers itself when a text field takes or loses
|
||||
focus, so the button follows squeekboard's own `Visible` property rather than
|
||||
remembering what it last asked for, and stays right either way.
|
||||
|
||||
**Wifi.** The button shows signal strength in the arcs and the SSID in use next
|
||||
to them, struck through when the radio is off. The menu lists the networks in
|
||||
range — connected first, then saved, then by strength — with the switch in the
|
||||
@@ -176,6 +196,8 @@ running with `qs --path .`).
|
||||
small output still gets a usable menu.
|
||||
- `terminal` — argv prefix for entries with `Terminal=true`. Honours
|
||||
`$TERMINAL`; otherwise change the `["foot"]` fallback to your terminal.
|
||||
- `showOsk` — set `false` to drop the on-screen keyboard button entirely.
|
||||
- `oskUnit` — the systemd user unit squeekboard runs as.
|
||||
- `showWifi` — set `false` to drop the wifi button entirely.
|
||||
- `wifiLabelMaxWidth` — cap on the SSID shown on the panel.
|
||||
- `wifiMenuWidth` / `wifiMenuHeight` — also clamped to the screen.
|
||||
@@ -196,12 +218,14 @@ config/Config.qml Behaviour, power actions, compositor detection
|
||||
services/Session.qml Which menu is open, and on which screen
|
||||
services/AppLauncher.qml Desktop-entry launching
|
||||
services/Attwm.qml attwm's IPC socket, when there is one
|
||||
services/Osk.qml squeekboard: its unit, and its DBus state
|
||||
modules/Bar.qml The panel window and its three sections
|
||||
modules/AppMenu.qml Left: launcher button
|
||||
modules/Launcher.qml The application menu overlay
|
||||
modules/AppEntry.qml One row in the menu
|
||||
modules/WindowList.qml Middle: task list
|
||||
modules/WindowButton.qml One task button
|
||||
modules/OskMenu.qml Right: on-screen keyboard button
|
||||
modules/WifiMenu.qml Right: wifi button
|
||||
modules/WifiPanel.qml The network list overlay
|
||||
modules/WifiNetworkEntry.qml One network row
|
||||
@@ -215,6 +239,7 @@ components/AppIcon.qml Icon resolution with fallbacks
|
||||
components/PanelButton.qml Shared hover/press surface
|
||||
components/BluetoothGlyph.qml The bluetooth rune, drawn
|
||||
components/WifiGlyph.qml The wifi fan, drawn
|
||||
components/KeyboardGlyph.qml The keyboard, drawn
|
||||
components/ToggleSwitch.qml On/off switch
|
||||
```
|
||||
|
||||
@@ -251,6 +276,21 @@ components/ToggleSwitch.qml On/off switch
|
||||
the compositor it shares the session's group, where wrapping buys nothing. A
|
||||
scope rather than a service, so the app inherits the environment it needs —
|
||||
`WAYLAND_DISPLAY` above all.
|
||||
- **Why the keyboard button shells out.** Quickshell has no generic DBus
|
||||
binding, and squeekboard is driven entirely over DBus, so `services/Osk.qml`
|
||||
uses `busctl`: a call per request, and one long-lived `busctl --json=short
|
||||
monitor` as the state feed, parsed a line at a time. A monitor connection
|
||||
sees signals it is not the destination of, which is what lets the button
|
||||
follow a keyboard raised by something else. The two match rules deliberately
|
||||
do not name a `sender`: dbus-broker does not deliver the bus driver's own
|
||||
signals to a monitor that asks for them that way, and `NameOwnerChanged` —
|
||||
how the panel notices squeekboard going away, since it does not announce that
|
||||
itself — would never arrive. Showing retries the call for a few seconds
|
||||
because the unit goes active a moment before squeekboard claims its name.
|
||||
- `qs ipc call` cannot reach a handler function named `show`: the name collides
|
||||
with the `ipc show` subcommand and the call silently turns into a listing. The
|
||||
`osk` target uses `open` and `close` instead, which matches the menu targets
|
||||
anyway.
|
||||
- Icons are resolved through the Qt icon theme, falling back to the last segment
|
||||
of a reverse-DNS app id (`org.qutebrowser.qutebrowser` → `qutebrowser`), then
|
||||
to a lettered tile. The packaged build adds Adwaita and hicolor to
|
||||
|
||||
Reference in New Issue
Block a user