Results 1 to 6 of 6

Thread: Close Firefox automatically after idling for 10 minutes.

  1. #1
    Join Date
    Dec 2013
    Beans
    2

    Close Firefox automatically after idling for 10 minutes.

    Hi All,

    I have searched extensively for an answer to this but nothing I have found has quite worked how I want it to.

    Basically i'm currently setting up a public access machine using Ubuntu 12.04 LTS and want to set Firefox to close automatically if it is left idling for 10 minutes, I have found various Kiosk add-ons for Firefox but none of them actaully close down Firefox they only revert back to the set homepage and close any open tabs but I want the user to be able to see the desktop icons I have setup.

    I did read into scripts that could be set to do something like this but I wouldn't know where to start.

    Thanks

  2. #2
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    3,262
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: Close Firefox automatically after idling for 10 minutes.

    One suggestion (and maybe not the best): use a script to listen to the screen saver (xsceensaver-command -watch) and use kill to send firefox the SIGTERM whenever xscreensaver-command outputs BLANK.

  3. #3
    Join Date
    Dec 2007
    Beans
    8,960
    Distro
    Lubuntu 16.04 Xenial Xerus

    Re: Close Firefox automatically after idling for 10 minutes.

    I think a solution may be difficult. Who knows what browsers do when we think they're idling.
    Shortened urls: See point #11 here. And clicking on them could be risky.
    Use ubuntu-support-status with caution.

  4. #4
    Join Date
    Dec 2013
    Beans
    2

    Re: Close Firefox automatically after idling for 10 minutes.

    Quote Originally Posted by Impavidus View Post
    One suggestion (and maybe not the best): use a script to listen to the screen saver (xsceensaver-command -watch) and use kill to send firefox the SIGTERM whenever xscreensaver-command outputs BLANK.
    I was thinking along the lines of this too but i'm a total scripting n00b, could someone give me pointers on how I could do this please?

  5. #5
    Join Date
    Feb 2011
    Beans
    102
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Close Firefox automatically after idling for 10 minutes.

    watch this link http://forums.gentoo.org/viewtopic-t...2-start-0.html
    you can switch the shutdown to kill firefox if idle time is true

  6. #6
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Close Firefox automatically after idling for 10 minutes.

    Install xautolock....
    Code:
    sudo apt-get install xautolock
    xautolock - fire up programs in case of user inactivity under X

    -time
    Specifies the primary timeout interval. The default is 10 minutes, the minimum is 1 minute, and the maximum is 1 hour.

    -locker
    Specifies the locker to be used. The default is xlock. Notice that if locker contains multiple words, it must be specified between quotes. In order to use your PATH to locate the program, xautolock feeds the locker command to /bin/sh, so it should be understandable for whatever shell your /bin/sh is. Because this typically is a Bourne shell, ~ expansion most likely will not work.
    Code:
    #!/bin/bash
    
    xautolock -notify 10 -notifier 'notify-send -i firefox "Firefox will close in 10 seconds"' -time 10 -locker "pkill firefox"
    For a quick 1 minute idle time test use -time 1
    Last edited by stinkeye; December 6th, 2013 at 12:25 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •