Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Is it possible to do this in linux?

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
emil_21
Posts: 98
Joined: 2017-04-14 06:13

Is it possible to do this in linux?

#1 Post by emil_21 »

I am linux noob and i am wondering if it is possible, with a script or some other way, to make mouse send left click when the mouse cursor hover over the top panel? I have a autohotkey that can do this in Windows and i am wondering if it is possible something like this to be implemented in linux. I am using debian gnome.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Is it possible to do this in linux?

#2 Post by debiman »

one word: xdotool

emil_21
Posts: 98
Joined: 2017-04-14 06:13

Re: Is it possible to do this in linux?

#3 Post by emil_21 »

I read some guides about xdotool, but i've never done any bash scripting so far, and i don't think i can do that on my own. For example, how to make xdotool detect when the mouse is over the top panel?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#4 Post by GarryRicketson »

So , why not ?
how to make xdotool detect when the mouse is over the top panel?
----------
This is pretty straight forward:
http://tuxradar.com/content/xdotool-script-your-mouse
Have a peek at the manual page (

Code: Select all

man xdotool
) to see a full list of available options.
But you need to actually install xdtool ,first , then you will have the manual,

Code: Select all

apt install xdtool
See:
https://packages.debian.org/jessie/x11/xdotool
Then start experimenting with
it,.... try the things in the tutorial.
Nobody can do this for you,



And as far as this goes:
but i've never done any bash scripting so far, and i don't think i can do that on my own
I suppose you expect someone to do it for you, I mean write the script, and that is ok, but it would be better to learn how to do the things you want to do "on your own" so to speak,..
a good place to start :
How to write a bash script for Debian
-----------------------
https://wiki.debian.org/BashScripting

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Is it possible to do this in linux?

#5 Post by Bulkley »

emil_21 wrote:I am linux noob and i am wondering if it is possible, with a script or some other way, to make mouse send left click when the mouse cursor hover over the top panel?
To clarify, as I understand it you want to make windows active when the cursor hovers over the bar on top of said window. In my Openbox wm this is easily set in Obconf. There is probably a similar setting in whichever desktop or wm you are using.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

Re: Is it possible to do this in linux?

#6 Post by emil_21 »

Bulkley wrote:
To clarify, as I understand it you want to make windows active when the cursor hovers over the bar on top of said window. In my Openbox wm this is easily set in Obconf. There is probably a similar setting in whichever desktop or wm you are using.
What i want to do is to bring window in focus just by hovering on the window button on the panel. I have an autohotkey script for Windows that can do this and it saves me lot of clicks.
I installed openbox but i am having problem activating it. If i type 'openbox --replace' my desktop go black and everything stops working. I am using debian 8.6 with Gnome DE.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#7 Post by GarryRicketson »

I am using debian 8.6 with Gnome DE.

Do you have OpenBox installed ?
Open Box is a windows manager, it is not a DE, like gnome,

When you start OpenBox, it will be a black screen, What happens if you , left click the mouse ?
*****IMPORTANT EDIT***
I mean "right click", the other left,..sorry about that,
***********************

Also "obconf" needs to be installed,... You also might want to install a panel, like
'tint2',...
I don't use Gnome, so can't say anything on that.
Last edited by GarryRicketson on 2017-04-17 01:47, edited 2 times in total.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Is it possible to do this in linux?

#8 Post by phenest »

emil_21 wrote:What i want to do is to bring window in focus just by hovering on the window button on the panel.
...
I am using debian 8.6 with Gnome DE.
But Gnome Shell only shows the currently focused window and no others. So you would need a Shell Extension such as gnome-shell-extension-taskbar which will do exactly what you want.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

emil_21
Posts: 98
Joined: 2017-04-14 06:13

Re: Is it possible to do this in linux?

#9 Post by emil_21 »

GarryRicketson wrote:
Do you have OpenBox installed ?
Open Box is a windows manager, it is not a DE, like gnome,

When you start OpenBox, it will be a black screen, What happens if you , left click the mouse ?
Also "obconf" needs to be installed,... You also might want to install a panel, like
'tint2',...
I don't use Gnome, so can't say anything on that.
Yes, openbox is installed. I installed it with 'sudo apt-get install openbox obconf'. I am trying to activate it with the command 'openbox --replace' though i don't know if this is the right way or i have to make some configuration before that. When i run the command my desktop go black and my panels disappear. Also, i can't open the dashboard with the super key, though i can open the home folder from the icon on the desktop.
Is this the right way to activate openbox and how to return to the default window manger?

emil_21
Posts: 98
Joined: 2017-04-14 06:13

Re: Is it possible to do this in linux?

#10 Post by emil_21 »

phenest wrote: But Gnome Shell only shows the currently focused window and no others. So you would need a Shell Extension such as gnome-shell-extension-taskbar which will do exactly what you want.
I have taskbar extension installed recently but didn't know it has this option. Thanks, for pointing it out. This is exactly what i was looking for.

I am still trying to make a script with xdotool that can do this though. It might be useful to learn some scripting.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#11 Post by GarryRicketson »

Is this the right way to activate openbox and how to return to the default window manger?
I am not sure about starting it from the Gnome shell, or Gnome,...but that is not
how I start it.
When your Debian first boots, and you have the login screen, there is options
to select the DE or window manage you want to use,
]Image

Sometimes it is below the window where you type in the username and password,
as well, so you may have to look for it a little.
Yours probably has Gnome, selected as default,..if OpenBox has been installed
it will show where, if you select OpenBox, it stays as the default, until you select another one, and change it.
You can have as many DE's (Desktop Enirinment) or Window Managers as you want, on a Debian system, this is only limited by how much disk space you have,
if you do not have much disk space, you shouldn't install very many.
With Open Box, like I said, it will be just a black screen, you need to use the "right click" on your mouse, that will show the menu,
***** edited*** I said "left" but I meant the other left, which is the "right" side,..
maybe this varies as well, depending on how ones mouse is configured, so it can't hurt to try both.
********************end edit************
There is a huge difference between a DE, like Gnome, and a WM (WindowManager),... you might enjoy trying one called TWM, as well.
https://en.wikipedia.org/wiki/Twm
twm was the first window manager I ever used.
Last edited by GarryRicketson on 2017-04-17 01:50, edited 1 time in total.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

Re: Is it possible to do this in linux?

#12 Post by emil_21 »

GarryRicketson wrote:
I am not sure about starting it from the Gnome shell, or Gnome,...but that is not
how I start it.
When your Debian first boots, and you have the login screen, there is options
to select the DE or window manage you want to use,
I don't see any option about openbox on my login screen. Do i have to install some additional login screen manager?

I come up with simple one line xdotool script which doesn't work by detecting when the mouse cursor is over the panel but it suppose to send left mouse click with delay when the mouse touch the top screen:

Code: Select all

xdotool behave_screen_edge --delay 500 top click 1
But for some reason it doesn't send the left mouse click. Am i on the right direction or this is completely wrong?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#13 Post by GarryRicketson »

I don't see any option about openbox on my login screen
Are you sure ? it is the little "wrench tool" thing, up in the upper right corner, you have to click it.
I think on some it is a "cog wheel" thing. Look close at the screen shot, I posted
and if you click it , it gives a full screen view.
Even if Open Box is not installed, there should be 2 or 3 Gnome options,

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#14 Post by GarryRicketson »

I have never used xdotool myself , so I had to install it,..I can see there
would be a learning curve involved, but:
I come up with simple one line xdotool script which doesn't work by detecting when the mouse cursor is over the panel but it suppose to send left mouse click with delay when the mouse touch the top screen:

Code: Select all

 by emil_21 »xdotool behave_screen_edge --delay 500 top click 1 
But for some reason it doesn't send the left mouse click. Am i on the right direction or this is completely wrong?
No you are not completely wrong, It does work,..I just now tried it.
First I copied / pasted into a terminal, then I moved the mouse to the top center
of the screen, since the screen is full with the browser. as well, and the terminal
I opened was in a smaller window at the bottom.
When I move the mouse curser to the top center of the screen, the termianl window "disappeared", actually it just shrank and went to the panel,... this is what would have happened if I clicked the mouse when it was at the top of the
screen,...or actually any where, but I did not click it.
You can try some variations, like :

Code: Select all

 xdotool behave_screen_edge --delay 500 top-left click 1 
Or for example, if the command you try is invalid, :

Code: Select all

 xdotool behave_screen_edge  click 1                     
Invalid edge or corner, 'click'
Usage: behave_screen_edge [options] edge-or-corner action [args...]
--delay MILLISECONDS     - delay before activating. During this time,
        your mouse must stay in the area selected (corner or edge)
        otherwise this timer will reset. Default is no delay (0).
--quiesce MILLISECONDS   - quiet time period after activating that no
        new activation will occur. This helps prevent accidental
        re-activation immediately after an event. Default is 2000 (2
        seconds).
edge-or-corner can be any of:
  Edges: left, top, right, bottom
  Corners: top-left, top-right, bottom-left, bottom-right
The action is any valid xdotool command (chains OK here)
 
It will tell you it was invalid, and suggest other options. You just need to experiment with it , ....I don't completely understand exactly what you are trying
to accomplish with it, but also, since this is the first time I have tried it, I wouldn't be able to say exactly how,..but it does look like you are on the right track.
Maybe :


Post by debiman » 2017-04-16 08:16
one word: xdotool

Maybe Debian can say more ? Since he seemed to all ready know something about "xdotool", and suggested it. ?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#15 Post by GarryRicketson »

I made 2 edits, on the OpenBox,... it is the "right click" , not Left click,..I have a tendency to get the right and left mixed up,
sorry

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#16 Post by GarryRicketson »

Using the OP's example, but without the delay:

Code: Select all

  xdotool behave_screen_edge  top  click 3  
Works good on OpenBox, it opens the menu when the mouse cursor is at
the top of the screen, and no need to click the mouse at all.
So again, yes you are on the right track.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

Re: Is it possible to do this in linux?

#17 Post by emil_21 »

GarryRicketson wrote: Are you sure ? it is the little "wrench tool" thing, up in the upper right corner, you have to click it.
I think on some it is a "cog wheel" thing. Look close at the screen shot, I posted
and if you click it , it gives a full screen view.
Even if Open Box is not installed, there should be 2 or 3 Gnome options,
Yes, i finally saw it. A small gear icon near to 'sign in' button. Damn it!. I select openbox an logged in to a black screen but i think it is working because i see the openbox context menu when i click with the right mouse button. How can i access my gnome dashboard and make my panels visible now that i am logged in to openbox?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#18 Post by GarryRicketson »

A lot of your questions can be answered using a search engine.
Not trying to be rude or anything, it is to your advantage, if you start learning about that you don't need to wait and wait for somebody to give you a answer.
However something else to keep in mind , some times, in fact often the results of a search yield various answers or solutions.
When you find a solution, that seems like it might work, but it involves a script or something , and you are not sure, it is a good idea to double check, and ask here
first, for example :
I found this here, : some url,... and it says use this :

Code: Select all

 some script code
This is especially important if you do not fully understand what the script does.
Also see: https://wiki.debian.org/DontBreakDebian/
Don't download and install random packages from random websites..
====
Back to your question:

How can i access my gnome dashboard and make my panels visible now that i am logged in to openbox?

You shoud be able to just open a terminal, and type :

Code: Select all

$ gnome-panel
 
Do not include the $ , the $ indicates this can be done as a normal user,

I am not sure about the Gnome Dashboard part, since I do not use Gnome at all.
I don't use the "gnome-panel" either as far as that goes, I use "tint2",
tint2 needs to be installed, it is not installed by default with Open Box
See this: https://wiki.debian.org/Openbox
Last edited by GarryRicketson on 2017-04-17 07:08, edited 3 times in total.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

Re: Is it possible to do this in linux?

#19 Post by emil_21 »

GarryRicketson wrote:

Code: Select all

 by emil_21 »xdotool behave_screen_edge --delay 500 top click 1 
No you are not completely wrong, It does work,..I just now tried it.
I am using debian on virtual machine and maybe that is the reason it doesn't work for me. But if it is working for you that mean the script is right. I haven't decided yet to move completely to linux so i am testing different distros on virtual machine and it seems debian with gnome is what i like the most. But i want to see if i can make equivalent to the autohotkey scripts that i have on Windows because they make my work a lot more productive.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Is it possible to do this in linux?

#20 Post by GarryRicketson »

Anyway the command is fine, and I don't think it is because it was on a VM, but it could be,... I tried it on both, my HD (bare metal), Debian 7,
---edited-- the command worked on xdotool running on the VM, which is OpenBsd,
however, it does not seem to work on Debian 7,...----end edit----
I also installed it to my Open Bsd, which is on a VM, powered by the Debian as the host. and it worked fine.
Are using the "scaleing mode", and fullscreen ? that is what I use. Also it could depend on the virtual machine , mine is VirtualBox. There are many that I have not tried.
Last edited by GarryRicketson on 2017-04-17 07:42, edited 1 time in total.

Post Reply