You are not logged in.

#1 2011-05-12 23:27:11

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Funny script for xscreensaver

Hi all.

Recently I've found screenshot of a pretty funny screensaver. Screensaver just states, that for the time it's running, you've done nothing. I've found nothing on the web and decided to do similar for xscreensaver by myself.

At first create executable script whenever you want with the following content
Note, originally screensaver was in Russian and used some dirty words, and that made it funny smile You are free to change message to any you want, but here to make this appropriate for official forum, I've changed message to something more neutral.

#!/bin/bash

MESSAGE="You've been doing absolutely nothing for"

CURRENT_SS=$(date +%s)

SCREENSAVER_TIME=$(xscreensaver-command -time | sed -r 's/.*since (.*) \(.*\)/\1/')
SCREENSAVER_TIME_SS=$(date -d "$SCREENSAVER_TIME" +%s)
DIFF_SS=$(expr $CURRENT_SS - $SCREENSAVER_TIME_SS )

SS=$(expr $DIFF_SS % 60)

REMAINDER_SS=$(expr $DIFF_SS - $SS)
DIFF_MM=$(expr $REMAINDER_SS / 60)
MM=$(expr $DIFF_MM % 60)

REMAINDER_MM=$(expr $DIFF_MM - $MM)
DIFF_HH=$(expr $REMAINDER_MM / 60)
HH=$DIFF_HH

echo "$MESSAGE $HH:$MM:$SS"

then, change couple of lines in ~/.xscreensaver to the following values

textMode:    program
textProgram:    <path to the script>

Select some screensaver with text (phosphor or fliptext) and motivate yourself to work while watching wink

Cheers smile

Offline

Board footer

Powered by FluxBB