Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
hour=$(date +%H)
ms=$(date +%M)
sec=$(date +%S)
rms=$((($ms / 5) * 5))
st=$((($ms - $rms) * 60 + $sec))
printf "http://176.9.156.38/clock/big_%s-%.2d?start=%d" $hour $rms $st#!/usr/bin/python
import os, time, signal
from datetime import datetime
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
def show_clocks(video_file, offset):
print "File: %s, offset: %d" % (video_file, offset)
pid = os.fork()
if (pid == 0):
os.execl(
"/usr/bin/mplayer",
"/usr/bin/mplayer",
"-ss", str(offset),
"-fs",
video_file
)
current_video_file = ''
while True:
t = datetime.time(datetime.today())
tenminute = int(t.minute / 10) * 10
video_file = "big_%02d-%02d.mp4" % (t.hour, tenminute)
if video_file != current_video_file:
current_video_file = video_file
offset = (t.minute % 10 * 60 + t.second)
show_clocks(video_file, offset)
time.sleep(1)
f=$(ls big_*);mencoder -ovc copy -oac copy $f -o big.mp4а затем просто вызывать наш скринсаэвер совсем простенькой командой, не забыв зациклить воспроизведение:mplayer -loop 0 -ss $(date +%H:%M:%S) -nosound -nolirc -wid $XSCREENSAVER_WINDOW -nostop-xscreensaver -fs -really-quiet big.mp4Как мне кажется, так гораздо проще.
Xscreensaver из часов на Esquire.ru