Find the answer to your Linux question:
Results 1 to 5 of 5
I want to change the File>Quit to shut down the computer instead of quit from fire fox where the code I need to change and how? Thanks...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    23

    configre firefox


    I want to change the File>Quit to shut down the computer instead of quit from fire fox
    where the code I need to change and how?
    Thanks

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    it isn't possible to make firefox shut down your computer as it is just a web browser, what is the point of this functionality?

  3. #3
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    This is one of the most satanic things I've ever heard. :P Why don't you just bind a keystroke in your wm or something similar? Or to a button in your taskbar or something.

    You can still use xbindkeys if you are running without a window manager.

    If you still want to do this. I suppose it could be done by modifying the sources for firefox, it shouldn't be too difficult. If it's embedded into the C source then I suppose that a system() call should work, as long as the user running firefox has permissions to run halt or shutdown -h.

    EDIT: Try to describe *why* do you want to do this. Maybe there's a better solution. If what you want is to start without a window manager, run only firefox, and shut down the machine when closing it, you can just do it with a bit of tweaking in your .xinitrc, and it would be much easier and less time consuming than compiling and recompiling firefox with each new security release.

    You can use something in the lines of this in your .xinitrc:

    Code:
    firefox&
    pid=$!
    wait $pid
    shutdown -h # or even "sudo halt" or something, you get the idea
    This way X with start with only firefox, and, when closing firefox, X will also be closed and the script will continue running the shutdown command.

  4. #4
    Just Joined!
    Join Date
    Mar 2008
    Posts
    23

    configration firefox

    I was configured gdm to start with failesafe terminal by default and just firefox appear no other thing and I want to shutdown from firefox when quit from it.
    I'm running under ubuntu , I configured /etc/X11/xinit/xinitrc file by the code posted by you:

    firefox&
    pid=$!
    wait $pid
    shutdown -h# or even "sudo halt" or something, you get the idea

    and it doesn't work !
    any idea?
    Thanks.

  5. #5
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by marwa.gabbani View Post
    I was configured gdm to start with failesafe terminal by default and just firefox appear no other thing and I want to shutdown from firefox when quit from it.
    I'm running under ubuntu , I configured /etc/X11/xinit/xinitrc file by the code posted by you:

    firefox&
    pid=$!
    wait $pid
    shutdown -h# or even "sudo halt" or something, you get the idea

    and it doesn't work !
    any idea?
    Thanks.
    So, when you change the default xinitrc by this, do you get any errors in the X logs?

    In any case, I am not sure how gdm do the things. ButI don't think it uses xinitrc by default, maybe you should be looking into /etc/X11/Sessions/

    Note also that there's the possibility that the config files into the user $HOME are overriding the global ones, that might be only parsed if there's no per-user config. It's possible and some distros do it.

    But I am no specialist in all this k/gdm stuff, I just use startx.

    Note also that, in the script I posted, the shutdown part will only work if you have the rights to use that command as the current user.

Posting Permissions

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