This is a simple activitywatch watcher for last.fm scrobble data. It uses the last.fm API to fetch scrobbles and sends them to the activitywatch server.
Download the binary for your OS from releases, or use one the the options below
cargo install --git https://github.com/0xbrayo/aw-watcher-lastfm.gitYou can then add aw-watcher-lastfm to autostart_modules in your aw-qt.toml
i.e:
[aw-qt]
autostart_modules = ["aw-server-rust","aw-awatcher", "aw-watcher-lastfm"]Clone the repository
git clone https://github.com/0xbrayo/aw-watcher-lastfm.gitcd into the directory
cd aw-watcher-lastfmOn first run, you will be prompted to configure last.fm API key and your last.fm username. You can get the apikey from the Last.fm API page.
cargo runThis should take a few seconds then the events should be visible in localhost:5600. If aw-server or aw-server-rust is running.
If everything works as expected, you can build the binary, add it to aw-qt or set up a systemd service to run it in the background(if running linux).
cargo build --releaseThis watcher follows ActivityWatch logging conventions and writes logs to platform-appropriate directories:
- macOS:
~/Library/Logs/activitywatch/aw-watcher-lastfm/ - Linux:
~/.cache/activitywatch/log/aw-watcher-lastfm/ - Windows:
%LOCALAPPDATA%\activitywatch\activitywatch\aw-watcher-lastfm\
# Run with debug logging on console
./aw-watcher-lastfm --verbose
# Run in testing mode (debug logs + testing port)
./aw-watcher-lastfm --testing
# Override console log level via environment variable
LOG_LEVEL=trace ./aw-watcher-lastfmLog files capture all logs from our module only (TRACE level), while console output respects the log level settings and may include dependency logs.
Log files use a simple rotation system:
- Production:
aw-watcher-lastfm.log(rotates toaw-watcher-lastfm-old.logat 32MB) - Testing:
aw-watcher-lastfm-testing.log(rotates toaw-watcher-lastfm-testing-old.logat 32MB)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
