Você pode usar a funcionalidade incorporada na maioria dos players de mídia para gerenciar isso; funciona de forma eficaz com xautolock
e seus armários.
mpv e mplayer ambos têm opções de proteção de tela:
--stop-screensaver, --no-stop-screensaver Turns off the screensaver (or screen blanker and similar mechanisms) at startup and turns it on again on exit (default: yes). The screensaver is always re-enabled when the player is paused. This is not supported on all video outputs or platforms. Sometimes it is implemented, but does not work (happens often on GNOME). You might be able to to work this around using --heartbeat-cmd instead.
Você pode ativar essa funcionalidade incluindo a linha no seu ~/.mpv/config
:
stop-screensaver=yes
e desfrute da reprodução ininterrupta dos seus vídeos.
Se você estiver usando um media player que não tenha essa funcionalidade básica, poderá usar um invólucro simples para obter o mesmo efeito:
#!/usr/bin/env bash
# wrapper to prevent screen blanking when files are played from ~/Videos
usage() {
printf "%s\n" "Usage: ${0##*/} /path/to/file"
exit 1
}
case $# in
1) if [[ $1 =~ Videos ]]; then
xset dpms 0 0 0
xautolock -disable
vlc "$1"
xautolock -enable
xset dpms 900 900 900
else
usage
fi
;;
*) usage
;;
esac