An ActivityWatch watcher for MPD.

Kristian Vos f116f26201 Small changes for README and to allow building 1 year ago
aw_watcher_mpv f116f26201 Small changes for README and to allow building 1 year ago
.gitignore 80b1f2e645 Initial commit 1 year ago
Makefile 80b1f2e645 Initial commit 1 year ago
README.md f116f26201 Small changes for README and to allow building 1 year ago
aw-watcher-mpv.spec 80b1f2e645 Initial commit 1 year ago
requirements.txt 80b1f2e645 Initial commit 1 year ago

README.md

aw-watcher-mpv

An ActivityWatch watcher for MPV.

Based of off aw-watcher-spotify and aw-watcher-mpv.

Development

  1. Install pip packages from the requirements.txt.
    pip install -r requirements.txt
  2. Start ActivityWatch in testing mode.
    aw-qt --testing
  3. cd aw_watcher_mpv
  4. python main.py --testing

Building

Make sure you have pyinstaller installed before you start.
pip install -U pyinstaller

  1. make clean
  2. make package

dist/aw-watcher-mpv is your outputted folder

Installing (Linux)

To install aw-watcher-mpv, first build it, then follow the below steps to install and automatically start the watcher when ActivityWatch starts.

  1. cp -R dist/aw-watcher-mpv /opt
  2. Create /usr/bin/aw-watcher-mpv
    Contents:
#!/bin/bash

/opt/aw-watcher-mpv/aw-watcher-mpv "$@"
  1. chmod +x /usr/bin/aw-watcher-mpv
  2. Edit ~/.config/activitywatch/aw-qt/aw-qt.toml
    Uncomment the first two lines and add aw-watcher-mpv to autostart.
    Example:
[aw-qt]
autostart_modules = ["aw-server", "aw-watcher-afk", "aw-watcher-window", "aw-watcher-mpv"]

Configuring

To configure settings for aw-watcher-mpv such as the socket file location and ActivityWatch poll time, first run the application once, and then edit ~/.config/activitywatch/aw-watcher-mpv/aw-watcher-mpv.toml.

MPV (Linux)

This watcher works by connecting to an MPV socket file. By default, MPV does not use a socket file, so to use this you need to use a special argument when running MPV. You can do this manually by adding --input-ipc-server=/tmp/mpv-socket, or you can also add this in MPV's config file(s), for example by adding input-ipc-server=/tmp/mpv-socket to ~/.config/mpv/mpv.conf.