This watcher sends information the media which is playing now to ActivityWatch. It supports any player which can report its status to the system and be controllable by tray or standard multimedia keys, such as Spotify, Foobar, browser-based players, and others. Most media players are supported.
Environment | Support |
---|---|
Linux | :heavy_check_mark: Yes (MPRIS) |
Windows | :heavy_check_mark: Yes |
MacOS | :hourglass: Not yet supported |
Linux:
sudo unzip -j aw-watcher-media-player-linux.zip aw-watcher-media-player-linux -d /usr/local/bin
in the console to allow ActivityWatch to detect its presence.sudo unzip -d /usr/local/share/aw-watcher-media-player/visualization aw-watcher-media-player-linux.zip 'visualization/*'
.Windows:
aw-watcher-media-player-windows.zip
into any new folder,
right-click on "Start" -> "System" -> "Advanced system settings" - "Advanced" tab -> "Environment Variables..." -> upper "Edit...", add the new folder path.aw-watcher-media-player
to autostart at aw-qt/aw-qt.toml
in config directory.Configuration file aw-watcher-media-player.toml
is located in user's local configuration directory.
It's created on the first run, or it may be created manually before running the binary.
CLI arguments override the file configuration.
Example:
port = 5600
host = "localhost"
poll_time = 5
include_players = ["Spotify", "firefox", "chrom"]
exclude_players = ["chromium"]
Filter options for including and excluding players for reporting look for a case-insensitive substring.
Use -vv
to see what's reported.
Note that normally browsers report the currently playing media to the system even in a private mode/tab/window.
This watcher has a visualization which attempts to do its best to display the sorted list of artists with the overall play time for each artist. Note that ActiveWatch UI gives no abilities for the widget to control its sizing, so it may appear smaller than builtin visualizations.
aw-server/aw-server.toml
or aw-server-rust/config.toml
file in config directory:
[server.custom_static]
aw-watcher-media-player = "/path/to/aw-watcher-media-player/visualization"
# aw-watcher-media-player = "/usr/share/aw-watcher-media-player/visualization" # .deb installation
# aw-watcher-media-player = "/usr/local/share/aw-watcher-media-player/visualization" # Linux installation from archive
# aw-watcher-media-player = 'C:\Users\<USER>\AppData\Local\aw-watcher-media-player\visualization' # Windows installer
Activity > Edit View > Add Visualization > Custom Visualization
aw-watcher-media-player
for the watcher name.The visualization is not customizable from ActivityWatch UI. In order to change, the output, open index.html
:
getAggregation
function and change event.data.artist
to event.data.player
to aggregate by players.MAX_AGGREGATIONS
to determine the maximum number of entries (default is 50).cargo build --release
on any platform. See release.yml for details.