Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-25-2012, 09:37 AM
|
#1
|
|
LQ Newbie
Registered: Jun 2012
Location: New Mexico
Distribution: openSuse 12.1
Posts: 18
Rep:
|
Trying to kill a Firefox window through remote ssh session
Hello,
I am lost as to what command I can use to kill a Firefox window through a remote ssh session. I have a Linux machine running openSuse 12.1 that I use here at work for our lobby t.v. I have crontab set to open Firefox first thing in the morning and when it does that Firefox, due to the web address that it is pointed too, opens a total of three windows, only two of which i actually need displayed. So my question is what terminal command can I use to kill the one window I do not need? I would like to be able to eventually add the command to the .sh script I wrote to open Firefox.
Thanks in advance for the help
Jimi
|
|
|
|
06-25-2012, 10:41 AM
|
#2
|
|
Moderator
Registered: May 2001
Posts: 24,827
|
Quote:
Originally Posted by JimiSc
Firefox, due to the web address that it is pointed too, opens a total of three windows
|
So what's wrong with the address? Does it use something like "target="blank"" to open several windows?
|
|
|
|
06-25-2012, 11:31 AM
|
#3
|
|
LQ Newbie
Registered: Jun 2012
Location: New Mexico
Distribution: openSuse 12.1
Posts: 18
Original Poster
Rep:
|
unSpawn,
No it does not return anything like that. After reading my post I realized I did not explain that very clearly. Firefox's home page is set to an internal web address http://xxx.xxxxx.xxx/xxx/luanch.php (sorry for security reasons cant give the whole address), from there it opens two additional windows that have the actual info that I want displayed, conference schedules, contact info and so on. The original window just stays a blank grey screen that to be honest is doing nothing and for cleanliness I would like to be able to close it and just have the two windows open that are needed. I remote into this box using PuTTY so I would like to be able to do this through the terminal.
|
|
|
|
06-25-2012, 12:10 PM
|
#4
|
|
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 2,806
|
I think the way is to identify the window (by title) and send a close command. You can try wmctrl to implement it.
Last edited by pan64; 06-26-2012 at 01:07 AM.
Reason: mistyped
|
|
|
2 members found this post helpful.
|
06-25-2012, 12:49 PM
|
#5
|
|
LQ Newbie
Registered: Jun 2012
Location: New Mexico
Distribution: openSuse 12.1
Posts: 18
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
I think the way is to identify the window (by title) and send a close command. You can try wmctrl so implement it.
|
I have installed this program and when I try to use it all I get is 'Cannot open display' I have tried using wmctrl -F -c <window name> as well as /usr/bin/wmctrl -F -c <window name>, both give me the same message Cannot open display.
|
|
|
|
06-25-2012, 12:54 PM
|
#6
|
|
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 2,806
|
that means you do not have access right to that DISPLAY. In this case there is no way to identify the window, there is no way to send events to that window manager, you can only kill the process (firefox) itself. You need to give access right to that user...
|
|
|
|
06-25-2012, 01:02 PM
|
#7
|
|
LQ Newbie
Registered: Jun 2012
Location: New Mexico
Distribution: openSuse 12.1
Posts: 18
Original Poster
Rep:
|
I see.....that would make sense. Ok so then how would I go about giving access to it through an ssh session? Still pretty new to Linux.
|
|
|
|
06-25-2012, 01:59 PM
|
#8
|
|
LQ Newbie
Registered: Jun 2012
Location: New Mexico
Distribution: openSuse 12.1
Posts: 18
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
I think the way is to identify the window (by title) and send a close command. You can try wmctrl so implement it.
|
Thank you for letting me know about this command. I was finally able to get it to work and close out the window I wanted it to close. I forgot that since I was running this command remotely that I had to first tell it what display it was, Adding DISPLAY=:0 to the beginning of the command made it work with no further issues. Thanks again
|
|
|
|
06-26-2012, 01:12 AM
|
#9
|
|
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 2,806
|
Quote:
Originally Posted by JimiSc
Ok so then how would I go about giving access to it through an ssh session? Still pretty new to Linux.
|
This is not possible in general. You cannot give yourself access rights to another display, the owner of that display can give you access with the command xhost. In your case the user was the same and therefore you did not need to set additional rights but the DISPLAY variable. ssh does not know about that session.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:13 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|