Skip to content
Edit this page

Getting started

Dependencies

  • GTK 4 and libadwaita 1.6 or newer, with their GObject introspection data
  • Python 3 with PyGObject, pycairo and requests (on Debian and Ubuntu: python3-gi, python3-gi-cairo, python3-requests)
  • meson 0.61 or newer, gettext and the GLib tools (glib-compile-resources, glib-compile-schemas)
  • gtk-update-icon-cache and desktop-file-utils, which the install step uses

Build, install, run

rm -rf builddir
meson setup -Dprefix=$HOME/.local builddir
meson compile -C builddir
meson install -C builddir
mousam

Run the installed app, not python3 src/app.py

Meson fills in config.py (@VERSION@) and ui/icons.py (@icon_location@). The GSettings schema must be installed, and src/ is imported as the mousam package. After changing any source, run meson install -C builddir again.

The launcher (src/mousam.in) sets up gettext, loads the GResource bundle, then calls mousam.app.main().

Flatpak build

This is what Flathub ships and what CI checks:

flatpak-builder --user --install --force-clean .flatpak-builder/app io.github.amit9838.mousam.json
flatpak run io.github.amit9838.mousam

Checks

Run these before declaring a change done. CI runs the same.

ruff check src tests
python3 -m compileall -q src
for t in tests/test_*.py; do python3 "$t"; done
meson test -C builddir --print-errorlogs      # tests + gschema, appdata, desktop validation

If you changed the gschema, appdata or desktop file, also run:

glib-compile-schemas --strict --dry-run data/
appstreamcli validate data/io.github.amit9838.mousam.appdata.xml.in
desktop-file-validate data/io.github.amit9838.mousam.desktop.in

Finally, run the installed app and check your change in light and dark, metric and imperial.

Debugging

gsettings set io.github.amit9838.mousam debug-mode true

Debug mode logs to the console and to ~/.cache/mousam/mousam.log (Flatpak: ~/.var/app/io.github.amit9838.mousam/cache/mousam/). It can also be switched on in Preferences β†’ Advanced. Always log through get_logger("<area>") from core/log.py, never print.

To watch memory across auto-refreshes, use the local, git-ignored src/test_memory_leak.py:

python3 src/test_memory_leak.py --duration 60

Keyboard shortcuts

Keys Action
Ctrl + R Refresh
Ctrl + Shift + R Hard refresh (forgets the city's cached responses first)
Ctrl + L Locations
Ctrl + M Compact mode
Esc Leave compact mode
Ctrl + , Preferences
Ctrl + ? Keyboard shortcuts
Ctrl + Q Quit
Alt + ↑ / ↓ Move a saved location up or down

They are listed in src/ui/templates/shortcuts.ui. Add a new main shortcut there too.