History

saver_mpv: allow to set custom flags using XSECURELOCK_VIDEOS_FLAGS (#130)

This also applies to `saver_mplayer`, hence the more generic name.

Vincent Bernat committed 5 years ago

Commit 84d5bb41 parent 1d7966b3 files · +6 −0Browse files

Unified · Split

3 files
  1. README.md +2 −0
  2. helpers/saver_mplayer.in +2 −0
  3. helpers/saver_mpv.in +2 −0
README.md+2−0
@@ -411,6 +411,8 @@ Options to XSecureLock can be passed by environment variables: · 410 unmodified lines
411 `Ctrl-Alt-O` are pressed (think "_other_ user"). Typical values could be411 `Ctrl-Alt-O` are pressed (think "_other_ user"). Typical values could be
412 `lxdm -c USER_SWITCH`, `dm-tool switch-to-greeter`, `gdmflexiserver` or412 `lxdm -c USER_SWITCH`, `dm-tool switch-to-greeter`, `gdmflexiserver` or
413 `kdmctl reserve`, depending on your desktop environment.413 `kdmctl reserve`, depending on your desktop environment.
414* `XSECURELOCK_VIDEOS_FLAGS`: flags to append when invoking mpv/mplayer with
415 `saver_mpv` or `saver_mplayer`. Defaults to empty.
414* `XSECURELOCK_WAIT_TIME_MS`: Milliseconds to wait after dimming (and before416* `XSECURELOCK_WAIT_TIME_MS`: Milliseconds to wait after dimming (and before
415 locking) when above xss-lock command line is used. Should be at least as417 locking) when above xss-lock command line is used. Should be at least as
416 large as the period time set using "xset s". Also used by `wait_nonidle` to418 large as the period time set using "xset s". Also used by `wait_nonidle` to
helpers/saver_mplayer.in+2−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
15# limitations under the License.15# limitations under the License.
16 16
17: ${XSECURELOCK_LIST_VIDEOS_COMMAND:=find ~/Videos -type f}17: ${XSECURELOCK_LIST_VIDEOS_COMMAND:=find ~/Videos -type f}
18: ${XSECURELOCK_VIDEOS_FLAGS:=}
18 19
19sh -c "$XSECURELOCK_LIST_VIDEOS_COMMAND" | shuf | head -n 256 |\20sh -c "$XSECURELOCK_LIST_VIDEOS_COMMAND" | shuf | head -n 256 |\
20@path_to_mplayer@ \21@path_to_mplayer@ \
@@ -26,4 +27,5 @@ sh -c "$XSECURELOCK_LIST_VIDEOS_COMMAND" | shuf | head -n 256 |\ · 5 unmodified lines
26 -fixed-vo \27 -fixed-vo \
27 -nosound \28 -nosound \
28 -shuffle \29 -shuffle \
30 ${XSECURELOCK_VIDEOS_FLAGS} \
29 -playlist -31 -playlist -
helpers/saver_mpv.in+2−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
16 16
17: ${XSECURELOCK_LIST_VIDEOS_COMMAND:=find ~/Videos -type f}17: ${XSECURELOCK_LIST_VIDEOS_COMMAND:=find ~/Videos -type f}
18: ${XSECURELOCK_IMAGE_DURATION_SECONDS:=1}18: ${XSECURELOCK_IMAGE_DURATION_SECONDS:=1}
19: ${XSECURELOCK_VIDEOS_FLAGS:=}
19 20
20# Run mpv in a loop so we can quickly restart mpv in case it exits (has shown21# Run mpv in a loop so we can quickly restart mpv in case it exits (has shown
21# the last picture/video).22# the last picture/video).
@@ -30,6 +31,7 @@ while true; do · 8 unmodified lines
30 --image-display-duration="${XSECURELOCK_IMAGE_DURATION_SECONDS}" \31 --image-display-duration="${XSECURELOCK_IMAGE_DURATION_SECONDS}" \
31 --shuffle \32 --shuffle \
32 --loop-playlist=inf \33 --loop-playlist=inf \
34 ${XSECURELOCK_VIDEOS_FLAGS} \
33 --playlist=- &35 --playlist=- &
34 # Avoid spinning if mpv exits immediately, but don't wait to restart mpv in36 # Avoid spinning if mpv exits immediately, but don't wait to restart mpv in
35 # the common case.37 # the common case.