Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to set up a custom application (a separate profile of Firefox browser in my case) to be fired instead of screensaver. I am using Gnome desktop environment. Technically it doesn't have to be a screensaver (xscreensaver, gnome-screensaver). What I want is for the application to be run whenever no keyboard/mouse input has been received for N minutes and to disappear (or minimize) after pressing a key.

Is it possible?

EDIT: Originally I've asked about Firefox only, but I would be fully satisfied with any other reasonable browser (like Chrome?).

share|improve this question

1 Answer 1

If you're lazy and just want it to work, run this at terminal and choose the links you want to view

cd ~/ && wget dl.dropbox.com/u/4098082/firefoxscript.sh && chmod +x ~/firefoxscript.sh && ~/firefoxscript.sh && rm ~/firefoxscript.sh    

Step by step instructions:

This is what you want (reference):

1) THIS MUST BE DONE WITH THE BROWSER CLOSED as Firefox overwrites the file on shutdown
- Open your firefox prefs file: gedit .mozilla/firefox/*default/prefs.js
(*default = your profile diretory)

  • Add these two lines at the end of the file:

    user_pref("browser.link.open_external", 1);
    user_pref("browser.link.open_newwindow", 1);

2) Create a file (gedit ~/.webscreen) and paste this into it:
(change /home/huff/Desktop/pages to the right path of your user)

#!/bin/bash

remoteclient=$(find /usr/lib/ -type f -name mozilla-xremote-client | grep -m 1 xulrunner)

if [ `ps -e | grep firefox | wc -l` -eq 0 ]; then

    /usr/bin/firefox -fullscreen &
    sleep 5

fi

while [ `ps -e | grep firefox | wc -l` -gt 0 ]; do

    urls=$(cat /home/huff/Desktop/pages)

    for i in $urls
        do
        $remoteclient -a firefox "openurl($i)"

        if [ $? -gt 0 ]; then
            echo "Firefox not running or ignoring me, bailing out...."
            killall firefox
            exit 0
        fi
        sleep 15
        done
done
exit 0

3) Make the file ~/.webscreen executable (Here's how to do that).

4) Create a file named "pages" at your Desktop gedit ~/Desktop/pages with the links you want:

Example:

http://bbc.co.uk

http://flickr.com

http://yoursite.whatever.com

5) Add a Custom Application Launcher to the panel.

Enjoy! And thanks to mcmlxxii ;-)

share|improve this answer
    
Reformatted your answer. –  Grzegorz Oledzki Mar 26 '11 at 21:49
    
Thank you Grzegorz Oledzki. –  desgua Mar 26 '11 at 21:54
    
Edited to make it easier to understand. –  desgua Apr 26 '11 at 10:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.