import subprocess
command = 'wmctrl -l'
output = system.exec_command(command, getOutput=True)
if " Google Chrome" in output:
window.activate(" Google Chrome",switchDesktop=True)
else:
subprocess.Popen(["/usr/bin/google-chrome-stable"])
--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/188c9974-55e6-4333-a463-fa3fefcf7c94%40googlegroups.com.
Jack,
Thanks for the information I appreciate it.
Which web browser do you use? Maybe you could test it in your web browser. If you get it working then I could install the same web browser you use and test it myself.
Thanks,
Yekutiel
# Start an instance of Chrome running Google Calendar if it is unopen or switch to an instance of Chrome running Google Calendar if it is open
import subprocess
command = 'wmctrl -a agenda'
output = system.exec_command(command, getOutput=True)
if "agenda" in output:
window.activate("agenda",switchDesktop=True)
else:
subprocess.Popen(["/usr/bin/google-chrome-stable"])
google-chrome-stable https://calendar.google.com/calendar/r/day
xdotool windowactivate `xdotool search --onlyvisible --class agenda`
Le mercredi 29 janvier 2020 22:46:00 UTC-8, Yekutiel ben Heshel a écrit :
--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/08b3bcfa-c237-4645-ac42-e38a98fd69dc%40googlegroups.com.
you may want to tweak that a little, but it's a simple process and you could implement it quickly.
jack
We are certainly moving with alacrity to the future
--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/08b3bcfa-c237-4645-ac42-e38a98fd69dc%40googlegroups.com.
i tried the selenium thing briefly....
unless there is something i'm unaware of, this is not going to work. the problem is that the selenium wants to control the whole browser
always have google calendar as the first tab in your browser.
status = subprocess.call(["xdotool", "search", "--onlyvisible",
"--class", "agenda", "windowactivate"], stderr=subprocess.DEVNULL)
if status != 0:
## didn't find and activate window
subprocess.popen(["google-chrome-stable",
"https://calendar.google.com/calendar/r/day"])
--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/a3ec2b3a-a27e-42bc-a55a-27e220f60a56%40googlegroups.com.
change the title of each browser window to match its contents.
so, the title of the google calendar window would be 'google
calendar' or some such. and so on.
or, you could use thunderbird for mail and something like
google-drive-ocamlfuse for google drive...which gives you access
from your normal file manager or command line... and then you
don't need a browser for mail or google drive.
jack
Are you sure it isn't time for a colourful metaphor?
--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/837c48e1-53bd-4f9e-8a00-e65f20b3c2ed%40googlegroups.com.
- have one browser instance for google calendar
- one for google drive
- one for google gmail
--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/24ca759b-792e-4be8-a732-66d2fc802a2e%40googlegroups.com.
perhaps you should put each one in a different workspace and then flip between workspaces.
then have keys to go specifically to the one you want.... which seems to be exactly what you are trying to do.
--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/ed8f2bde-2acb-4274-9e15-beda1d49ce73%40googlegroups.com.
Before I begin, these pages may be of some use for what you'all have already been working on:
https://stackoverflow.com/questions/7537832/list-of-open-browser-tabs-programmatically
https://stackoverflow.com/questions/50628481/opening-chromium-from-script
https://stackoverflow.com/questions/26114930/opening-tabs-using-webbrowser-module-in-python
A possible solution would be to not have them open at all and to use one of the methods below to open them on demand:
1) Create an AutoKey script with these contents, replacing the Google
URL with the URL to Google Calendar or Google Drive or Gmail:
import webbrowser
webbrowser.get("chromium-browser").open("https://google.com")
/opt/google/chrome/google-chrome --profile-directory=Default --app-id=kjbdgfilnfhdoflbpgamdcdgpehopbep
I see this process creates a shortcut on your desktop as well. If your menu opens with keyboard, just delete icon from desktop
Depending on your desktop, the short cut should be in your menu as well.
If you have a start menu that opens a list of ALL apps in the initial
listing and you can search the app name (dare I say like windows start menu - wash out your mouth, Keith) you can open the calendar this way.
I find it easier to set a keyboard shortcut to open the menu.
One key, then start typing the search query. Generally 3 letters at most.
# Start Chrome if it is unopen or switch to Chrome if it is open
import subprocesscommand = 'wmctrl -l'output = system.exec_command(command, getOutput=True)if " Google Chrome" in output:window.activate(" Google Chrome",switchDesktop=True)else:subprocess.Popen(["/usr/bin/google-chrome-stable"])
By the bye, I just tried opening one of my new shortcuts, twice, and it opened 2 instances of the tab. Shouldn't really matter with Calendar, gmail type sites, but it may with more interactive sites. Only did this as you wanted to go to an open instance if possible.
I hate having to go to the desktop as well. I figure something to do with how horrible Win3/3.11 was.
minor point, fwiw. i think you probably mean 1990s. windows 3.1 was when a GUI environment took off and that was released in 1992. in the 80s there was windows 2 and nobody used that.
The problem with the code is that the email client reformatted it - which makes Python very unhappy.
I repaired it and attached it as a file so it won't get altered.
You still need to put it into Python yourself - it's a code fragment, not a complete program.
There is a very promising headset that (of all places) Radio Shack is starting to sell.
It does full 3D images and motion, but it relies on a 5G Cellular signal, so it's not widely available yet. So, if the 5G
doesn't make everybody ill, you shouldn't have to wait much longer for your headset (except for the price to come down.)
It's funny how that worked out. Even geniuses make big mistakes.
He also sold most of his Apple stock when it was very low
and he probably figured the same as you did.
It's hard to predict what comes "Next".
1) Get the Xautomation approach to work: This might do exactly what you want, but I'm not sure when I can get to it.
2) Put the special apps in one or more browser windows on a virtual desktop which is just for them. Then, all you have to do is switch desktops and select the appropriate window (all of which xdotool will do nicely and I have experience with it.)
3) If you use KDE or would consider using it, it has a really cool meta feature called activities. The desktop environment you have now (and all the associated virtual desktops) is equivalent to one KDE activity. When you switch to another activity you get a whole new set of everything - even wallpaper. That way, when you switch from one activity to another, you only see what you need for what you want to do now, but everything else is just a few clicks away in one or more other activities.
The advantage of this is that you can build and use the whole thing without any programming - not even AutoKey, although that might still make it smoother to use.
It's like going from your office to your kitchen. Everything in the
office is still there the way you left it, but it's completely out of
sight and mind while you're in the kitchen and you have all your kitchen stuff ready at hand.
So, you could have these other apps open in one or more other activities and they would be completely out of the way and invisible until you switch to them.
Andy Lavarre <alav...@gmail.com> is our local expert on activities. He gets down into manipulating them at a lower level.
IMO, the simplest approach still looks like (1), but the others are worth considering.
Well, see how far you get on your current course. It may be quite
sufficient. If it's not, then we can look at Xautomation.
So far, I haven't seen anyone actually use it and it would be fun to see if we
could get it to do something useful. I would do the coding. You would
probably have to make the tiny screenshots for the target tabs, etc.
>> Yep, that's Selenium, which seems to be the best way of doing what Yekutiel would like to do.
I use the following to launch Google Chrome if it is unopen or switch to Google Chrome if it is open
import subprocess
command = 'wmctrl -l'
output = system.exec_command(command, getOutput=True)
if " Google Chrome" in output:
window.activate(" Google Chrome",switchDesktop=True)
else:
subprocess.Popen(["/usr/bin/google-chrome-stable"])