FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-09-2011, 07:06 PM
Tyler Smith
 
Default Tell firefox to quit from a shell script

Hi,

I want firefox to quit every time I hibernate my laptop. I've tried doing
this using the following bash alias:

alias shib='pkill firefox ; sudo hibernate'

However, firefox doesn't close cleanly, and I often have problems when I
open it again, with ff complaining that it can't recover my tabs, or
failing to launch the first time and then needing to be called a second
time.

Is there a way I can politely ask firefox to quit, less traumatically
than pkill?

Thanks,

Tyler

ps. My motivation is that I store a lot of passwords in Firefox, and use
the master password to protect them. However, if firefox doesn't close
when I hibernate the computer, and someone steals my laptop, they can
then access many of my online accounts. If FF closes, they can't get to
my passwords without knowing the master password.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87aafz2qje.fsf@guruji.demimonde">http://lists.debian.org/87aafz2qje.fsf@guruji.demimonde
 
Old 04-09-2011, 08:06 PM
Tyler Smith
 
Default Tell firefox to quit from a shell script

Tyler Smith <tyler.smith@eku.edu> writes:

>
> Is there a way I can politely ask firefox to quit, less traumatically
> than pkill?

Hi again,

I think I answered my own question:

wmctrl -c firefox

appears to do what I need.

Sorry for the noise,

Tyler


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 8762qn2nre.fsf@guruji.demimonde">http://lists.debian.org/8762qn2nre.fsf@guruji.demimonde
 
Old 04-09-2011, 08:10 PM
Camaleón
 
Default Tell firefox to quit from a shell script

On Sat, 09 Apr 2011 15:06:13 -0400, Tyler Smith wrote:

> I want firefox to quit every time I hibernate my laptop. I've tried
> doing this using the following bash alias:
>
> alias shib='pkill firefox ; sudo hibernate'
>
> However, firefox doesn't close cleanly, and I often have problems when I
> open it again, with ff complaining that it can't recover my tabs, or
> failing to launch the first time and then needing to be called a second
> time.
>
> Is there a way I can politely ask firefox to quit, less traumatically
> than pkill?

Hum... I think it could be this "bugture" (feature bug):

RFE: A way to shutdown Mozilla from the command line (x-remote or signal).
https://bugzilla.mozilla.org/show_bug.cgi?id=134909

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2011.04.09.20.10.41@gmail.com">http://lists.debian.org/pan.2011.04.09.20.10.41@gmail.com
 
Old 04-09-2011, 08:12 PM
Mike Viau
 
Default Tell firefox to quit from a shell script

> On Sat, 9 Apr 2011 16:06:13 -0400 <tyler.smith@eku.edu> wrote:
>
> Tyler Smith writes:
>
> >
> > Is there a way I can politely ask firefox to quit, less traumatically
> > than pkill?
>
> Hi again,
>
> I think I answered my own question:
>
> wmctrl -c firefox
>
> appears to do what I need.
>
> Sorry for the noise,
>
> Tyler
>

Does that work (to exit gracefully) if Firefox/Iceweasel is running on Gnome or KDE as well?


-M


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: bay148-w1272C48BD354DE824C7AC5EFA60@phx.gbl">http://lists.debian.org/bay148-w1272C48BD354DE824C7AC5EFA60@phx.gbl
 
Old 04-09-2011, 08:45 PM
Tyler Smith
 
Default Tell firefox to quit from a shell script

Mike Viau <viaum@sheridanc.on.ca> writes:

>> On Sat, 9 Apr 2011 16:06:13 -0400 <tyler.smith@eku.edu> wrote:
>>
>> >
>> > Is there a way I can politely ask firefox to quit, less traumatically
>> > than pkill?
>>
>> I think I answered my own question:
>>
>> wmctrl -c firefox
>>
>> appears to do what I need.
>>
>
> Does that work (to exit gracefully) if Firefox/Iceweasel is running on
> Gnome or KDE as well?
>
>

I don't know, I don't have either of those DE installed. wmctrl appears
to handle a lot of window-manager things that aren't baked into Fluxbox,
but it might not be necessary/compatible with Gnome or KDE.

Tyler


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 871v1b2lyh.fsf@guruji.demimonde">http://lists.debian.org/871v1b2lyh.fsf@guruji.demimonde
 
Old 04-10-2011, 12:14 AM
"Todd A. Jacobs"
 
Default Tell firefox to quit from a shell script

On Sat, Apr 9, 2011 at 12:06 PM, Tyler Smith <tyler.smith@eku.edu> wrote:

*alias shib='pkill firefox ; sudo hibernate'

The executable you need to kill is "firefox-bin" and not just "firefox." Give that a try instead.
 
Old 04-10-2011, 06:43 PM
Tyler Smith
 
Default Tell firefox to quit from a shell script

"Todd A. Jacobs" <codegnome.consulting+debian@gmail.com> writes:

> On Sat, Apr 9, 2011 at 12:06 PM, Tyler Smith <tyler.smith@eku.edu> wrote:
>
> *alias shib='pkill firefox ; sudo hibernate'
>
>
> The executable you need to kill is "firefox-bin" and not just
> "firefox." Give that a try instead.

I don't think that's the problem -

pkill firefox

and

pkill firefox-bin

both succeed in killing the firefox process, but both do it 'uncleanly',
i.e., firefox doesn't save the tab info and other data it needs to start
up properly the next time. The consequence it the "This is embarrassing,
Firefox can't recover your tabs" notice once every two or three times
pkill is used.

So far, the wmcntrl command I posted earlier:
wmctrl -c firefox
doesn't seem to have this problem: firefox is not killed, but rather
asked to quit.

Thanks,

Tyler


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87wrj20wxh.fsf@guruji.demimonde">http://lists.debian.org/87wrj20wxh.fsf@guruji.demimonde
 

Thread Tools




All times are GMT. The time now is 07:56 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org