mpd_oled icon indicating copy to clipboard operation
mpd_oled copied to clipboard

Feature Request: Turn off display or screensaver after idle period

Open shamasis opened this issue 3 years ago • 3 comments

First off, I am a huge fan of the work done for Volumio and now the mpd_oled project. I understand the effort and love that goes into building something like this.

I would love to see a setting that allows the display to be turned off after a period of mid/volumio inactivity.

If I can figure it put, I will myself try and send a PR (but it seems too far off from my ability to get there.)

shamasis avatar Jul 30 '21 13:07 shamasis

Hi

Thank you for your suggestion to add a screensaver. This has been previously been requested and I do intend to add it in (in my own case continually displaying the stop screen has led to screen burn).

I will be adding this to the development code

https://github.com/antiprism/mpd_oled_dev

I'll leave the issue open until the feature is available (but I cannot give a time frame for this).

Adrian.

antiprism avatar Jul 30 '21 16:07 antiprism

I needed a quick and dirty solution for this until I have some time to get familiar with your code (I only added the display today), so I wrote a loop in bash that starts/stops the service depending if mpd is playing:

/usr/local/bin/mpd_oled_cron


#!/bin/bash

cntr=0

while /bin/true; do
  if mpc | grep -q playing; then
    cntr=0
    if [[ $(pgrep -c mpd_oled) -eq 0 ]] ; then
      systemctl start mpd_oled
    fi
  else
    if [[ $(pgrep -c mpd_oled) -gt 0 ]] ; then
      cntr=$((cntr+1))
    fi

    if [[ $cntr -gt 30 ]]; then
      systemctl stop mpd_oled
    fi
  fi
  sleep 2
done

/lib/systemd/system/mpd_oled_cron.service

[Unit]
Description=Starts/stops mpd_oled

[Service]
Type=simple
ExecStart=/bin/bash /usr/local/bin/mpd_oled_cron
Restart=always

[Install]
WantedBy=multi-user.target

Kind of a nuclear and rather ineffective solution, but if someone else really needs it, it works.

petermolnar avatar Aug 10 '23 20:08 petermolnar

I would love to have a ping-pong animation going on after say 10 minutes of inactivity. This would use all pixels and make the time readout undisturbed (which is pretty much the main function if not playing anything). This could work in conjunction with the screen invert timer.

zsoltmar avatar Sep 01 '23 23:09 zsoltmar