4

I work on a laptop with a small screen and I do not have access to multiple monitors on this machine like I do at work. I have set my terminal up with transparency so I can see through to whatever I am developing on the browser behind the terminal but I would love to be able to click through the terminal and interact with the browser directly.

I have not tried anything outside of google searching because I don't have any experience with this type of thing.

EDIT: The "possible duplicate" question doesn't answer my question because it basically just makes a script for doing a quicker alt+tab window switch. I have no problem using alt+tab to switch windows, I would just prefer to not have to switch windows at all. I want my mouse to interact with the browser while my keyboard interacts with the terminal.

Jacob Vlijm
  • 83,767
CaldwellYSR
  • 2,207
  • 2
  • When I was alerted of the possible duplicate it told me to make an edit if I felt the answers on that question were not sufficient to answer my question. I agree our questions are the same but the answer on that question does not answer my question. It only offers an unnecessary alternative. – CaldwellYSR Aug 24 '16 at 20:49
  • An (in your opinion unnecessary) alternative is the best option we can offer I am afraid, that is answering the question. A completely valid answer can also be "What you ask for is impossible". We can never guarantee you like what is (not) possible. – Jacob Vlijm Aug 24 '16 at 20:53
  • 1
    CLOSE VOTERS I second Cadwel, the linked post is not a solution to what is asked. That said , what you ask Cadwel is impossible to achieve due to how GUI is built to operate and has been so for ages. If you want i can post an answer explaining why it is so, but the basic answer is "it is not possible" – Sergiy Kolodyazhnyy Aug 24 '16 at 22:06
  • @Serg it still is a dupe. The question defines the dupe, not the answer. I can't help OP obviously took it personal, but IT IS AN EXACT DUPE, and your answer should have been posted there. – Jacob Vlijm Aug 25 '16 at 22:44
  • @JacobVlijm I didn't take anything personal. When you flagged it as a possible duplicate askubuntu sent me a notification saying if the answers on the possible duplicate didn't answer my question (they don't) then I should edit my question to explain why. That is what I have done. We have all followed the guidelines of the site and if they want to close the question they're welcome. – CaldwellYSR Aug 26 '16 at 03:12
  • It did answer your question, since it is exactly the same question. You even mentioned: "this is a much better answer than the one in the duplicate question". The fact that you don' t like the answer doesn't change that. We have tools like bounties to stimulate the creation of possible other approach(es). What if someone doesn't like mine and Serg's answer. Ask the exact same qustion for the third time, over and over again? No, that is not how it works. – Jacob Vlijm Aug 26 '16 at 06:58
  • @JacobVlijm It doesn't... it offers an alternative to alt+tab. alt+tab has nothing to do with the question since the question about about keeping the terminal on top of what you're interacting with. That answer does exactly the opposite. Again, you were right to flag it as a duplicate and I was right to edit my question. If a mod wants to take this down then they can do that but I'm not closing it myself. The answer here is much better as it actually answers the question. – CaldwellYSR Aug 26 '16 at 12:20
  • The answer offers a workaround/alternative, and so does the answer here. The fact that you like this one better is irrelevant to the fact that it is a dupe. An exact dupe. I am afraid we're in a loop however. – Jacob Vlijm Aug 26 '16 at 12:23
  • @JacobVlijm I've already admitted it was a dupe... That's what you're not understanding. It is a completely duplicate question. I didn't see the first one originally. I don't know if you've ever had one of your questions flagged as duplicate but it literally says "if the answers on the possible duplicate do not answer your question then you should edit your question to explain why."

    I'm just doing what askubuntu.com told me to do when you flagged it.

    – CaldwellYSR Aug 26 '16 at 15:51
  • 1
    That is good information, I will post a q on meta, since this creates confusion. – Jacob Vlijm Aug 26 '16 at 15:53

2 Answers2

9

Why this is not possible

What you ask, is essentially impossible. To make the explanation simple, there are two types of graphical desktops: stacking and tiling. Unity is an example of stacking desktop, where you have a stack of windows ( kind of like cafeteria tray stack ) , where the currently active window is the top one.

The mouse behavior has been defined in X11 such that clicking on a window brings it to the top of the stack. While there are ways to keep window below others (most notably with wmctrl), there is no way to click through a window without raising it into focus. This is not up to tweaking unfortunately - unless you are willing to create some form of new layer for GUI yourself, and so far I've not heard of any such project.

If you request so, I can even place bounty on this question, but I can bet there will be no answer which satisfies your exact requirements.

Somewhat of a workaround

One can do this: set transparent terminal window to minimum size, set it as "always on top" and click on *anything around the window itself.

enter image description here In this screenshot you can see two approaches to this : one via default right click on window border and via wmctrl command. The last one can allow for scripting approach to this , but the basic premise is the same - you have to click on anything around teminal itself.

Possible alternatives

  • There are drop down terminals such as Guake. You can have a drop down terminal linked to F12 key, with window that retains position on top, and you can click on anything around it
  • Use split screen with terminal and the desired other window linked together

Guake example

enter image description here

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • Thank you, this is a much better answer than the one in the duplicate question. The "always on top" trick is clever and will be a decent workaround. – CaldwellYSR Aug 25 '16 at 01:18
  • Of course there's a way! Raise on click is not hard-coded, it's an option. There's also "focus follows mouse". I always configure my systems so that clicking doesn't raise the window and so the window under the mouse has focus. – terdon Aug 27 '16 at 11:01
  • @terdon 'raise on click' occurs only when you click on any area outside of currently focused window. OP wants to have transparent one above everything and have mouse interact with one below. Those are not the same behavior as what you describe – Sergiy Kolodyazhnyy Aug 27 '16 at 11:24
  • Yes, you're right. I was referring to this sentence from your answer: "The mouse behavior has been defined in X11 such that clicking on a window brings it to the top of the stack". That's what isn't quite true. I agree that there's probably no way to click through a window, but focus follows mouse might be a decent alternative. – terdon Aug 27 '16 at 15:34
  • @terdon ah . . .yes indeed. I'll correct my post. – Sergiy Kolodyazhnyy Aug 27 '16 at 15:58
1

Counter question:

Do you want a "ready" solution for this or do you plan to write an own C program?

If you want a "ready-to-use" solution I think you won't find any: There are only few people who need something like this so I don't think anyone has implemented such a program up to now.

If you want to write such a program yourself I would try to do the following:

Write a program with a large window (covering (nearly) the entire screen) that has 100% transperancy. (Unfortunately I never worked with transperancy so I do not know if this really works.)

Use the low-level X11 library (libX11) and no higher-level API (Gnome etc.) for this.

Because this window is in the foreground it will receive all keyboard and mouse information.

Use the XSendEvent() API to emulate keyboard and mouse events in the console and the browser...

Unfortunately this will not be as easy as it sounds. Especially emulating the mouse events in the browser will not be easy!

  • Yeah, I was looking for something already done as I don't have knowledge or interest in such low level dev at this time. – CaldwellYSR Aug 30 '16 at 20:24