This mpv plugin prevents screen blanking in GNOME while playing media.
This is needed because neither mpv supports GNOME's inhibition protocol, nor GNOME supports the standard inhibition protocol (yet).
You can find the latest release here.
Download mpv_inhibit_gnome.so
and put it in your mpv
scripts directory
(by default it's ~/.config/mpv/scripts
).
To build, the libdbus-1
library is needed
(Arch: dbus
, Fedora: dbus-devel
, Ubuntu: libdbus-1-dev
),
as well as the header files for mpv
(Arch: mpv
, Fedora: mpv-libs-devel
, Ubuntu: libmpv-dev
).
To build run:
make
This will generate the plugin in lib/mpv_inhibit_gnome.so
.
To install in the default per-user location ~/.config/mpv/scripts
either copy it there or run:
make install
To install in the default system-wide location /usr/share/mpv/scripts
run:
sudo make sys-install
Configure meson build and install to ~/.config/mpv/scripts
:
meson --prefix=${XDG_CONFIG_HOME:-${HOME}/.config} build
ninja -C build install
Or just run:
./install.sh
TL;DR:
make flatpak-install flatpakoverride
and you're good to go.
This will install the plugin in ~/.var/app/io.mpv.Mpv/config/mpv/scripts
,
and will punch a hole in the Flatpak sandbox to allow mpv
to talk
to the D-Bus address that GNOME uses for inhibiting screen blanking.
You can manually allow mpv
to talk to the D-Bus address by running:
flatpak override --user --talk-name=org.gnome.SessionManager io.mpv.Mpv
It's also possible to use Flatseal to do that.