refactor(mpvpaper): Rewriting multiple features#13
Conversation
|
Hey, thanks for the PR. I did not have a chance to review the PR manually or test it, so here is an automated review for now.
run_as_systemd defaults to false, so this is the default path. freezeMpvpaper does:
For connector = "DP-1", the pattern is mpvpaper .*DP-1, which also matches the command line of the DP-10 (or DP-11, …) instance (mpvpaper -p 'DP-10' … contains DP-1). Clearing/pausing DP-1 on a multi-monitor setup therefore also tears down DP-10. (For the wildcard case the pattern degrades to mpvpaper .**, an odd regex that happens to match all instances.) Consider matching the exact -p 'connector' token or using the systemd unit consistently.
startMpvpaper builds nice -n N mpvpaper … before the optional systemd wrapping, so nice is fully functional without systemd — yet the slider only appears when "Run as systemd service" is enabled, leaving non-systemd users unable to configure a value that would otherwise work. Either drop the visible_when on nice or move the nice application under the systemd branch. |
…agement to preserve wallpaper state
I've modified the logic so that, instead of killing the process when it's paused (when systemd isn't used), it takes advantage of the This replicates the behavior of |
…erns and refined UI state handling for wildcard assignments.
I've made several changes regarding this point. Previously, it was implemented in such a way that all processes could be terminated, rather than allowing control over each individual monitor. I've now modified the behavior so that these actions can be performed and so that the UI can control which actions are allowed and which are not. The behavior can be summarized roughly in this table:
Video example: output.mp4Note The monitor is the DP-1; the fact that it displays the video even when I select a video from the eDP-1 monitor appears to be a bug in mpvpaper, which I have already reported. |
Summary
I have taken the liberty of making some modifications to the mpvpaper plugin to improve some aspects that I consider useful and to fix minor issues.
The modifications include:
Removed the dependency on the external shell script
supervisor.sh.In my opinion, the mpvpaper process can be managed without needing an additional background process keeping a FIFO open, and I believe it's a cleaner and more efficient solution.
Added the ability to run
mpvpaperinside systemd transient scopes (systemd-run).This allows some advantages, such as being able to set limits to the resources used by the process or the ability to pause/resume a wallpaper in a simple way.
Implemented a function to automatically extract a static frame from the wallpaper using
ffmpegwhen stopping video playback (to allow pausing or stopping a wallpaper without using systemd).This is based on how the dms-mpvpaper repository works, and above all it is intended to fix some issues like the one mentioned in #8 or the issue I mentioned in my previous PR (#12), to set the color palette automatically.
Added external IPC commands to pause/resume playback via the cgroup freezer.
Mainly to allow using commands such as
noctalia msg plugin noctalia/mpvpaper:service all toggleto pause, resume or stop the wallpaper.Applied some changes so that if the user selects "All Outputs", a separate process is not created for each of the wallpapers, and the command
mpvpaper "*" video.mp4is utilized, which should save resources.Updated the panel interface to dynamically change the "Pause" button text to "Resume" when a video is paused, and to disable the button completely if no video is assigned.
Motivation
Many of these changes are suggestions based on how I previously used the mpvpaper wallpaper, which I have always preferred to "limit" in resources to avoid influencing the performance of my system while playing games.
Type of Change
Related Issue
#8
Testing
Manual Coverage
Screenshots / Videos
Overview:
output.mp4
Pause/Resume button:

Checklist
translations/en.json, or this PR adds no new user-facing strings.Additional Notes
This PR makes many changes, and makes my previous PR (#12) unnecessary.
I understand that many of these changes are not really necessary for the normal functioning of the plugin, but I believe they are useful features that would improve the user experience in some aspects.
Feel free to reject this PR if you do not think it fits what is expected or to modify it if you think it is necessary.
Any comments or suggestions will be welcome.