Autostart option added
This commit is contained in:
57
README.md
57
README.md
@@ -1,5 +1,14 @@
|
||||
# gKeyMapper
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
GTK4 application (C++) for remapping the G keys **G1–G9** of a Logitech **G910**
|
||||
to other keys or commands (Linux Mint / Ubuntu).
|
||||
|
||||
@@ -8,6 +17,12 @@ G-keys from the keyboard and replays the actions is implemented as well; the
|
||||
GUI and the daemon talk over a small D-Bus channel (status, reload, test) — see
|
||||
`docs/daemon-plan.md`.
|
||||
|
||||
**Only the daemon has to run.** It is the part that reads the G keys and replays
|
||||
the action, and it runs as a systemd user service. The window is for editing the
|
||||
mappings and for the status: it may be closed at any time, and starting it with
|
||||
the session (`Options` → `Start with the session`) is a convenience, not a
|
||||
requirement.
|
||||
|
||||
Documentation and source comments are written in English.
|
||||
|
||||
## Requirements
|
||||
@@ -93,6 +108,44 @@ build — and then shows its own window, so a stale window can never stay next t
|
||||
fresh one. Row edits that were not saved are lost with the replaced window,
|
||||
because saving is always explicit (`Save mappings`).
|
||||
|
||||
### Menu, tray icon and minimize to tray
|
||||
|
||||
The menu button in the title bar holds `Export configuration...` / `Import
|
||||
configuration...`, `Options`, `Help` (also `F1`), `About` and `Quit` (`Ctrl+Q`).
|
||||
|
||||
* `Help` opens a one-page explanation of the nine rows, the four types, the
|
||||
capture dialog, the daemon status and the tray.
|
||||
* `Options` opens a small window with the GUI's own switches and the daemon in
|
||||
detail: state, version, keyboard, the config file it reads and the last G key
|
||||
that fired (the footer says the same in one line). The window is not modal, so
|
||||
it keeps updating while it is open. One of its switches is the language
|
||||
(`System language`, or a fixed `de`/`en`/`es`/`fr`): it switches the window, the
|
||||
menus and the tray menu right away — nothing to restart, and rows that were not
|
||||
saved yet are kept.
|
||||
* `Start with the session` opens the window when you log in. It writes the usual
|
||||
autostart entry (`~/.config/autostart/gkeymapper.desktop`, starting the binary
|
||||
that is running) and removes it again when you switch it off; an entry that the
|
||||
desktop's own startup tool has disabled counts as off, too. Like the window
|
||||
itself this is a convenience: the G keys do not need it, only the daemon has to
|
||||
run (see `Running the daemon` below).
|
||||
|
||||
`Minimize to tray` keeps gKeyMapper reachable from the panel: the window is
|
||||
hidden instead of closed when you close or minimize it, and the tray icon's menu
|
||||
shows it again (`Show`) or quits the program (`Close`). Closing still quits when
|
||||
the option is off — or when no panel hosts the tray icon, because then there
|
||||
would be no way back to the window. The option is remembered in
|
||||
`~/.config/gKeyMapper/gui.conf`, a file of its own so `mappings.conf` stays a
|
||||
pure mapping file. The same file holds the chosen language; with `System
|
||||
language` (the default) the desktop's locale decides.
|
||||
|
||||
The tray icon is a StatusNotifierItem plus a `com.canonical.dbusmenu` menu over
|
||||
GIO — the same protocol libxapp and libappindicator wrap, only without their GTK3
|
||||
dependency (a GTK4 process must not load GTK3). It needs no package of its own and
|
||||
works wherever the protocol is hosted: the Cinnamon panel (via `xapp-sn-watcher`),
|
||||
KDE, Unity or GNOME with the AppIndicator extension. The icon travels as a pixmap
|
||||
because the panel is a different process and cannot read the icons compiled into
|
||||
the binary.
|
||||
|
||||
## Running the daemon
|
||||
|
||||
The daemon reads G1–G9 from the keyboard and replays the configured action
|
||||
@@ -288,6 +341,10 @@ src/mappings.{h,cpp} # GUI glue: config file <-> row widgets
|
||||
src/capturedialog.{h,cpp} # key-capture dialog
|
||||
src/daemonclient.{h,cpp} # D-Bus client for the daemon (status/reload)
|
||||
src/singleinstance.{h,cpp} # one GUI only: a new start closes a running instance
|
||||
src/trayicon.{h,cpp} # tray icon: StatusNotifierItem + dbusmenu over GIO
|
||||
src/settings.{h,cpp} # gui.conf (window preferences, e.g. minimize to tray)
|
||||
src/help.{h,cpp} # help window
|
||||
src/optionsdialog.{h,cpp} # options window: switches + detailed daemon status
|
||||
shared/mapping.{h,cpp} # mappings format + shortcut parsing (GUI & daemon)
|
||||
shared/keys.{h,cpp} # canonical key names -> Linux key codes
|
||||
shared/keymap.{h,cpp} # layout-aware key lookups (xkbcommon), GUI + daemon
|
||||
|
||||
Reference in New Issue
Block a user