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
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.

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

Re: Is it possible to do this in linux?

#21 Post by emil_21 »

I am using virtualbox in full screen mode.

I also run 'gnome-panel' in openbox but i get 'bash: gnome-panel: command not found'. I think i have to install the gnome panel inside openbox.

Anyway, i will search more info about this.

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

Re: Is it possible to do this in linux?

#22 Post by GarryRicketson »

I think i have to install the gnome panel inside openbox.
Maybe that will work.

I need to take this back ,
y GarryRicketson » but it could be,... I tried it on both, my HD (bare metal), Debian 7,
I had not tried the command you showed on the Debian installation,
I just tried a simple command :

Code: Select all

xdotool  click 3
, but when I try the command you showed
I get a error, as well, there seems to be something wrong with the way
Debian handles the command,.. or the command needs to written different
for Debian,.. maybe some one that know more on this will share.
======== additional note====
Apparently the version of xdotool that is in the Debian repositories is different
The command is valid, looking at the manual that came with the version I installed
on OpenBsd,
from:

Code: Select all

man xdotool
behave_screen_edge [options] where command ...
Bind an action to events when the mouse hits the screen edge or
corner.

Options are:

Code: Select all

xdotool version: xdotool-3.20150503.1v0
=========================
When I looked at the manual on Debian, it does not show the command.
But ok , now that makes sense, since I am using Debian 7 (wheexy)
it is a different version:
https://packages.debian.org/wheezy/xdotool

Code: Select all

xdotool (1:2.20100701.2961-3 
So that explains why it did not work for me, and is not in the manual.
============ edite ===note:
I did install xdotool to a Debian Jessie VM, it is the newer version xdotool-3.2
and it works, including the command the OP gave, but it does need to be using
"switch to scale mode" <host-c> That is <right ctrl-c> , at least it seemed that way,
now it is working either way,..

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

Re: Is it possible to do this in linux?

#23 Post by debiman »

emil_21, sorry i don't log in here that often.
this thread has grown a lot meanwhile, and i can see we are now mixing up all sorts of different things, trying to swat a fly with 3 hammers...

go back to the beginning (i hope you haven't messed up your install completely by now)

and ask yourself, what do you want to achieve?

because what you did instead is this:
- i want to achieve something
- i think i should use X
- X doesn't work
- please, help!

so i am asking, what is this thing that led you to believe that you need linux' equivalent of autohotkey?

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

Re: Is it possible to do this in linux?

#24 Post by emil_21 »

debiman wrote:
so i am asking, what is this thing that led you to believe that you need linux' equivalent of autohotkey?
Because autohotkey scripts are increasing my productivity.

By the way, is it possible for xdotool to detect active window? For example, something like this:

Code: Select all

if (firefox window is the active window and the mouse touch the bottom screen)
send action (keyboard key press)

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Is it possible to do this in linux?

#25 Post by dasein »

emil_21 wrote:By the way, is it possible for xdotool to detect active window?
What does the manual say?

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

Re: Is it possible to do this in linux?

#26 Post by GarryRicketson »

by emil_21 » By the way, is it possible for xdotool to detect active window?
Yes it is possible maybe something like this:

Code: Select all

focused_window_id=$(xdotool getwindowfocus)
active_window_id=$(xdotool getactivewindow)
active_window_pid=$(xdotool getwindowpid "$active_window_id") 
Or

Code: Select all

xdotool getactivewindow getwindowname 

--------------

Code: Select all

 xdotool search --name  firefox 
Some of the tutorials as well as the manual go into details on this.
========== edit ============
by emil_21 » Did you look at this tutorial ?
Me : 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.
The first command it demonstrates,

Code: Select all

 xdotool click 1

I s very simple, which is where one should start when learning how to use a
new cli program.
They don't mention in the tutorial, but if you open 2 windows, the first being the terminal, keep it small so it does not take up the entire screen.
The second window, let's use firefox as the example, also keep it small, so you can have both windows on your screen.
Now, in the terminal, type or copy/paste:

Code: Select all

xdotool click 1
BUT DO NOT hit enter just yet.
Now, move the mouse cursor to the top right corner of the Firefox window,...
or any option that requires a "click" to activate it. Just move the cursor to the area,.DO NOT click it.
Then , hit enter, but for your terminal, it will run the command, watch what happens, ...Just with that command, and the fact that after it is run once, it is in the command history,..one can keep their right hand on the mouse, and with the left hand , use the arrow keys, to repeat the command, any time they want to use the "left" click button.
According to the manual, that command can be assigned to a "hotkey", as you call it,... I still have not really looked into exactly how, but it can be done,
In the same tutorial, they do go into the windowactivate options,...
------------------

Code: Select all

 xdotool Parole “Firefox” windowactivate 
=============================

Code: Select all

xdotool search “Parole” windowactivate --sync mousemove
--window %1 0 0
-------------
How ever, I suggest not imediately jumping into more advanced scripts and options, until after you have some understanding of the first steps, and basic
commands,..
at the bottom of the tutorial it says:
To wrap up, in this tutorial we’ve explored various different ways to interact with the GUI: moving the mouse, sending virtual clicks and drags, and finding specific windows. Putting these actions together, and exploring more possibilities with the xdotool manual page, you can automate pretty much everything on your desktop, leaving you with more time to spend on important things.
I do find the parts in the manual about assigning the commands to a "hotkey"
confusing myself, so that is why I don't give you a example,..maybe if some one
knows how, and they just give a example, of assigning the

Code: Select all

xdotool click 1
to a specific keyboard key, it would help,...it seems
to me like that is what the OP needs, after that they could use the example to
apply to other xdotool commands and keys,..

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

Re: Is it possible to do this in linux?

#27 Post by emil_21 »

@GarryRicketson Thanks, will try it.

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

Re: Is it possible to do this in linux?

#28 Post by debiman »

@garry one more time steals the show by elaborating on man pages.
and i really mean elaborating...
emil_21 wrote:Because autohotkey scripts are increasing my productivity.
By the way, is it possible for xdotool to detect active window?
very nice, but you still haven't told us what you want to achieve. but one step closer

anyhow, you've been given plenty of hints now, it's your turn now.

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

Re: Is it possible to do this in linux?

#29 Post by GarryRicketson »

Post by debiman » 2017-04-18 11:52
@garry one more time steals the show by elaborating on man pages.
and i really mean elaborating...
I am sorry, I am not trying to "steal the show",..or anything like that,
About 95 % of the time though, for me, using the search engine and
reading the manual works,...
But also, thank you for sharing about xdotool, I am finding it usefull, and
it was even available for OpenBsd, works really well.

phenest wrote:
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.
I wonder if the OP ever tried this,..he says it does exactly what the OP wants ?

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

Re: Is it possible to do this in linux?

#30 Post by GarryRicketson »

There does seem to be a packaged program that the OP might find useful,
I have never liked this sort of GUI , program, but often many other people
do. A example, many or most people like and prefer Gimp, but I prefer ImageMagick, ..but any way that is another topic,...

https://packages.debian.org/jessie/autokey-common
desktop automation utility - common data

AutoKey is a desktop automation utility for Linux and X11. It allows the automation of virtually any task by responding to typed abbreviations and hotkeys. It offers a full-featured GUI that makes it highly accessible for novices, as well as a scripting interface offering the full flexibility and power of the Python language.

This package contains the common data shared between the various frontends
Just like everything else, the only way I know of to learn to use the program will be to read the manual and documentation. There are also some tutorials
on it , if one does a search for them.

I have not tried it, and don't plan on it, 'xdotool' combined with 'xkbset' ,
'setxkbmap', and 'xkbind' is sufficient, for me.

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

Re: Is it possible to do this in linux?

#31 Post by emil_21 »

debiman wrote: very nice, but you still haven't told us what you want to achieve. but one step closer

anyhow, you've been given plenty of hints now, it's your turn now.
I need a script that can do this: when the mouse touch the bottom of the screen, and the firefox is the active window, the script to send ctrl+shift+e key press to the firefox window. This will open the tab groups panel in firefox. This way i can switch between tabs by clicking on the tab thumbnail in the tab group panel, since i like my tabbar to be hidden.
When the mouse touch the bottom of the screen and firefox is not the active window the script should not be activated.

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

Re: Is it possible to do this in linux?

#32 Post by debiman »

yes this is scriptable with the above mentioned tools.
i'll just add wmctrl to the pool of available utilities.
you know, in linux there's almost always more than 1 way to skin a cat.

if you've never done anything like this on linux, there will be a learning curve, and i think it is clear that this is a highly personal setup so you'll have to make it yourself.

i suggest this workflow:
1) see if you can trigger a command on touching certain hot corners (screen edge). sometimes the window manager already has the ability, sometimes you can install a separate app for that, e.g. http://linux.softpedia.com/get/Desktop- ... 3672.shtml or https://github.com/mstraube/x-corners (but already packaged versions may exist in your repos, search "hot corner")

2) write a shell script (most probably bash) that checks if the right window is in focus, and if so, performs the necessary actions. i think xdotool can do most, if not all, of what you require. be prepared to use wmctrl also. maybe also xprop, xwininfo etc.

Post Reply