Giter VIP home page Giter VIP logo

autokey-python2's Introduction

AutoKey

Join the chat at https://gitter.im/autokey/autokey Ask and answer questions on StackOverflow

AutoKey, a desktop automation utility for Linux and X11, formerly hosted on Google, has been updated to run on Python 3.

Important: This is an X11 application and, as such, will not function correctly when Wayland is in use instead of Xorg.

Important: Please remove previous installations of AutoKey fully before installing!

For detailed installation instructions, please visit the Installing page in our wiki.

AutoKey documentation is available here and, for versions prior to 0.96.0, here. Example code and explanations for how AutoKey works can be found in our wiki and, in particular, on the Features and Example Scripts pages. Additional information can be found by searching Stack Overflow and GitHub.

Please do not request support on the issue tracker. Instead, head over to the autokey-users Google Groups forum, Gitter web-based chat, on IRC (#autokey on Libera.Chat), or Stack Overflow.

We'd appreciate it if you take a look at our Troubleshooting wiki page before posting. You'll be more likely to get a good answer quickly by providing as much information as you can.

Bug reports are welcome. Please use the GitHub Issue Tracker to report bugs. When reporting a suspected bug, please make sure to include as much information as possible to expedite troubleshooting and resolution.

Here are some possible examples of the types of information you might need to provide:

  • Details on how to reproduce the issue you are experiencing are always helpful.
  • An AutoKey error message is helpful when something is wrong with your AutoKey script.
  • An AutoKey traceback is helpful when AutoKey runs without crashing, a trigger was used, and the expected event either didn't occur or something other than the expected result occurred.
  • A Python traceback is helpful when something is wrong with your AutoKey script, causing an exception to be shown in your AutoKey error message.

If you're not sure your issue is a bug or you'd like help with reporting it, you can post about it first on one of the platforms used by our community and we'll assist you.

Pull requests are welcome from anyone who would like to modify or contribute to the source code. Useful tips for working with and testing the code can be found in the CONTRIBUTORS.rst file. AutoKey also participates in CodeTriage, where members can sign up to receive a periodic email with a link to an open AutoKey issue that needs help.

Our changelog is the best source of information for what's new and fixed in each release.

AutoKey uses the GNU GPL v3. See the LICENSE file for a plain text copy of the license.

autokey-python2's People

Contributors

darenschwenke avatar halpo avatar jmetzmeier avatar josephj11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autokey-python2's Issues

Fatal error starting AutoKey

I fired up my Linux Mint 17.3 (64-bit) laptop today and received this error message:

Fatal error starting AutoKey.
'ascii' codec can't encode character u'\xed' in position 20: ordinal not in range(128)
Uploading Screenshot from 2017-04-03 11:28:24.png…

I haven't used the system in about 5 days, because I've been away. There were some updates this morning, but this error message appeared right after log-in, before I updated anything. I couldn't discover any similar issues that were resolved.

Thanks in advance for any help.

Left clicking on AutoKey icon in taskbar does nothing

Left clicking on the icon should open the main window (or at least do something else useful.)

Currently, it does nothing. (Right clicking on it works fine.)

This occurs in autokey-gtk 0.90.4-1 running under KDE 4.14.2 on Kubuntu 12.04, but I believe it is not a new issue.

Persistent Values

AutoKey has a mechanism for creating persistent values. It appears to work, but AFAIK, the values can only be retrieved by a subsequent invocation of the macro which defined them - so they're analogous to local variables.

While this makes sense - to avoid unintended side efffects between macros, it would be cool if there were a way to set parameters in one macro to be used in another one - maybe with some special qualifier so that the user would be assured of getting the desired parameter if more than one macro used the same identifier for different purposes.

I know that this can be achieved by creating a standalone parameter file and directly accessing it from macro code, but maybe there's something a bit more elegant that could be done.

A possible use case might be: one macro to set a user language parameter that other macros could read and use to select text to emit based on the current language selection. This could be a natural or a formal language.

In general, setting something that tells other macros how to behave or where to look for a particular resource.

Add a Readme.md

This is good to have since it's basically the "homepage" of the project.

Autokey writes intensively to log file, how to disable it?

Thanks for sharing this nice addition, it's appreciated! I have the following Autokey script:

 # Enter script code
 keyboard.send_key("<right>")

It's bounded to the key Alt+ l (that's a lowercase L there). I use it regular. But I see tenthousands of these logs in autokey.log:

 2016-06-03 22:11:58,291 INFO - service - Matched hotkey phrase/script with prompt=False

Is there any way to turn off logging in Autokey? It's not available in the preferences menu.

Abreviations not working

I'm having exactly the same problem as described here: https://code.google.com/p/autokey/issues/detail?id=241

Only blank lines are inserted when using the example abbreviation adr for example, and in the log it prints:

2015-04-17 20:40:28,184 ERROR - interface - Error in X event loop thread
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/autokey/interface.py", line 116, in __eventLoop
    method(*args)
  File "/usr/local/lib/python2.7/dist-packages/autokey/interface.py", line 622, in __sendString
    self.__checkWorkaroundNeeded()
  File "/usr/local/lib/python2.7/dist-packages/autokey/interface.py", line 926, in __checkWorkaroundNeeded
    w = self.app.configManager.workAroundApps
AttributeError: ConfigManager instance has no attribute 'workAroundApps'

I'm using the latest qt-version from github.

CAPSLOCK as a modifier

Hello everyone!

Im trying to extend the lib to include CAPSLOCK as a modifier. I have gotten all the UI to work and script to register and run when I use the modifier. I have a problem though where modifier + key also prints out the key. So <capslock>+k that run script send_key("<up>") result in k then <up>. Anyone who has an idea where in the code this could happen? If you need my code I will provide a fork but I wanted to ask here first and see if anyone perhaps knew.

AutoKey Icon Error Status

When a macro error occurs, AutoKey changes the panel icon to flashing red. There doesn't appear to be a way to reset this other than by quitting AutoKey and restarting it.

One possible solution would be to "manually" reset it when the user accesses Tools->View Script Error.

Another possibility would be that something already clears the error and its text - possibly the next macro/phrase which completes successfully. This should also reset the panel icon. This will also take the burden off the user who will then only have to view the script error when that would aid in the debugging process.

Can not stop a long running script.

Scripts with timing information take longer to run.
Need to be able to terminate them for engine shutdown, and perhaps for cancelling them mid-run.

TXT file: line break instead of paragraph break

Sorry for this simple question but I just don't find a solution:

I have a very simple greets.txt template:

Yours sincerely,
Anonymus

The difficulty: I want to use a line break instead of paragraph break (for office or mail apps, wherever it really makes a difference). But I just don't know how to use a linebreak-charakter in the autokey window or text editor.
Is there any solution or do I have to use a script?

Thanks!

Duplicated initial character of a expanded phrase

The abbreviation for the phrase is g123
The phrase is g12345
Trigger setting is: remove abbraviation and immediatly.
The result is not consistent, sometimes the initial g is duplicated.
I am using autokey-gtk 0.90.4

Request - Would like to have option for a custom default folder

Dear Autokey,

Absolutely wonderful application.

Is anyone maintaining it ?

Request - Would like to have option for a custom default folder. In my Linux Mint KDE (17.3) system, all my Autokey configurations are store in a hidden folder. It would be great if users could specify their own default folder which makes backing it up easier. Thanks.

Exception in Thread Phrase-thread

I can reproduce an exception if i do execute a specific phrase.
The exception output is as follows:

Exception in thread Phrase-thread:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 813, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 766, in run
self.__target(_self.__args, *_self.__kwargs)
File "/usr/lib/python2.7/site-packages/autokey/service.py", line 383, in execute
self.macroManager.process_expansion(expansion)
File "/usr/lib/python2.7/site-packages/autokey/macro.py", line 55, in process_expansion
macro.process(parts)
File "/usr/lib/python2.7/site-packages/autokey/macro.py", line 100, in process
self.do_process(parts, i)
File "/usr/lib/python2.7/site-packages/autokey/macro.py", line 129, in do_process
args = self._get_args(parts[i])
File "/usr/lib/python2.7/site-packages/autokey/macro.py", line 93, in _get_args
raise Exception("Missing mandatory argument '%s' for macro '%s'" % (k, self.ID))
Exception: Missing mandatory argument 'name' for macro 'script'

To be honest - i dont know where i would need to define a name for the macro script.

I am using 0.90.4

Can not start autokey

I've installed autokey along with the dependencies and this is what I get when I execute autokey-gtk in a terminal

Fatal error starting AutoKey.
'recordHotkey'

Abbreviations not really saved

Hello!

I have my system (Linux 13 Maya, Cinnamon) newly installed because of problems with Autokey. Now Autokey runs with one small problem: I can't define anymore abbreviations.

  • the old imported abbreviations work!
  • newly created abbr. are first shown but they are shown equally for all other items (until I reopen AK)
  • when I open the respective .json file I see that there is no abbr. stored
  • when I insert the abbr. manually in the .json file it does not work also

Enclosed the report, apparently a problem of the "dbus". But how to resolve? Why does it not work when I manually define the abbr. in the .json file?

2016-04-10 12:52:47,563 DEBUG - root - AutoKey is already running as pid 3035 2016-04-10 12:52:47,575 ERROR - root - Error communicating with Dbus service Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/autokey/gtkapp.py", line 106, in __verifyNotRunning dbusService = bus.get_object("org.autokey.Service", "/AppService") File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object follow_name_owner_changes=follow_name_owner_changes) File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__ self._named_service = conn.activate_name_owner(bus_name) File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner self.start_service_by_name(bus_name) File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name 'su', (bus_name, flags))) File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking message, timeout) DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.autokey.Service was not provided by any .service files

PayPal Donations link does not work

Wneh I click "PayPal" button here or on Google code, PayPal shows this message:

PayPal cannot process this transaction because of a problem with the seller's website. Please contact the seller directly to resolve this problem.

respect XDG standard

What steps will reproduce the problem?

  1. Set the environment variable XDG_CONFIG_HOME.
  2. Autokey does not look in ${XDG_CONFIG_HOME}/autokey for its configuration.

I am using version 0.90.4-5 on Arch Linux, built from the Arch User Repository.

Reference: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

I would like for Autokey to use ${XDG_CONFIG_HOME}/autokey for its configuration, if that variable is set by the user. If not set, fallback to ~/.config/autokey.

Migrated from: https://code.google.com/p/autokey/issues/detail?id=266

Patch included there.

Script recorder crashes on input.

Thread locking was not implemented for the Recorder class within the handle_keystroke and handle_mouseclick handlers, allowing them to write to the interface causing Gtk to complain and then crash.

Abbreviations should not be empty

What steps will reproduce the problem?

  1. Run 'autokey -l' in terminal.
  2. Change focus to any text window (e.g., Mousepad).
  3. Type any letter/number.

What is the expected output? What do you see instead?

Autokey should replace configured abbreviations. Instead, no replacements are made, and even a single letter triggers an exception:

Exception in thread KeypressHandler-thread:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/dist-packages/autokey/iomediator.py", line 204, in run
target.handle_keypress(rawKey, modifiers, key, windowName, windowClass)
File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 179, in handle_keypress
currentInput, windowInfo, True)
File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 304, in __checkTextMatches
if item.check_input(buffer, windowInfo):
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 735, in check_input
abbr = self._should_trigger_abbreviation(buffer)
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 134, in _should_trigger_abbreviation
if self.__checkInput(buffer, abbr):
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 147, in __checkInput
stringBefore, typedAbbr, stringAfter = self._partition_input(buffer, abbr)
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 189, in _partition_input
stringBefore, typedAbbr, stringAfter = matchString.rpartition(abbr)
ValueError: empty separator

What version of the product are you using? On what operating system?

Autokey 0.90.4, KDE 4.8.5, Xubuntu 12.04

Please provide any additional information below.

Full command-line log attached. To obtain this, I ran 'autokey -l', clicked on an open Mousepad window, and typed the letter 'a', then exited Autokey normally.

Sep 26, 2012 #1 [email protected]
OK, found the problem. I had accidentally entered a blank abbreviation for a given phrase. Since it was blank, I didn't see it in the abbreviations window, and the only way I noticed (besides knowing how rpartition() can throw a ValueError) was that the list of abbreviations was '[question,question,]': there was an extra comma at the end.

It might be a good idea to notify the user if he/she has entered an empty abbreviation, or disallow it altogether.

Migrated from: https://code.google.com/p/autokey/issues/detail?id=219

How to bind a hot key to send its self in script

Hello everyone,
I want emacs keybinding for some programs. The window filter works, but I am trying a simpler way: if the program window class is in the black list, send the hot key unmodified. How can I do that?
Thank you!

my script:

import scripting as scrt
black_list = ['emacs', 'Iceweasel']
def emacs_key(key_sym):
    """key_sym : string : symboly for the key
    eg. '<up>' """
    win_class = scrt.window.get_active_class()
    if not any(win_class.find(s) for s in black_list):
        scrt.keyboard.send_keys(key_sym)
    else: # send the hot key

phrase hotkeys not saving correctly due to Gtk deprecation issues with Attributes

Traceback (most recent call last):
File "/home/daren/git/autokey/build/lib.linux-x86_64-2.7/autokey/gtkui/dialogs.py", line 82, in on_response
self.closure(responseId)
File "/home/daren/git/autokey/build/lib.linux-x86_64-2.7/autokey/gtkui/configwindow.py", line 258, in on_hotkey_response
self.hotkeyLabel.set_text(self.currentItem.get_hotkey_string(key, modifiers))
File "/home/daren/git/autokey/build/lib.linux-x86_64-2.7/autokey/gtkui/configwindow.py", line 302, in getattr
return getattr(self.ui, attr)
AttributeError: 'Alignment' object has no attribute 'currentItem'

Plus sign (+) causes carriage returns to be spelled out (<enter>)

What steps will reproduce the problem?

  1. create a new phrase, add a new line, then start the next line with a "+" symbol and save
  2. call the phrase from some other app

What is the expected output? What do you see instead?
a blank line then a plus sign on the line after it is expected
instead one gets "+ " all on one line

What version of the product are you using? On what operating system?
Version 0.90.1
Using KDE Development Platform 4.11.5
Linux Mit 16 Petra x64

Migrated from: https://code.google.com/p/autokey/issues/detail?id=275

Czech characters

Hi,
I installed Autokey python version, work great, but no paste czech character ex. 'ščřž'?

Any solution?

autokey vs autokey-py3

Hi,

how does autokey compare to autokey-py3

If a developer wants to add new features, which project should be used to provide pull requests?

Feature request: TextExpander Compatibility

It would be great to be able to import, or even sync settings with TextExpander.com.
I love AutoKey. Unfortunately the rest of my team uses TextExpander (mac-only).

Thanks for awesome piece of software :-)

Abbreviations are not saved in the Abbreviation dialog when leaving the field

This was old system issue #294.

After adding an abbreviation to the Abbreviation field of the Abbreviation dialog, the natural thing to do would be to do something else like filling in the rest of the dialog. If you do this, the abbreviation is deleted which is very frustrating.

To make it work, you have to press Enter after typing the abbreviation, but there is nothing to make you suspect that this is the case.

The dialog needs to be improved. It should automatically save the only (or last) abbreviation. If that's difficult, then it should provide a Save button. Maybe that field should be open for entry to start with and the Add button should save the abbreviation rather than open a new empty one for entry.

AutoKey Stops Running Macros And Phrases

Sometimes (I don't know how to recreate it), AutoKey stops running macros. It seems like part of it has crashed. The main Window is still accessible and I can quit AutoKey, but nothing seems to fix the problem until I kill (pkill autokey) the remaining AutoKey process and restart it.

At this point I'm just registering the existence of the problem. I don't know how to document it further.

This is autokey 0.09.4.1 (gtk) running under Kubuntu Precise (12.04) with KDE 4.14.2.

NP_ENTER key missing & "<enter>" converted XK_KP_Enter

Hello,

Currently, all "enter" type keys are being mapped to XK_KP_Enter. This is bad since certain applications distinguish between the main enter key and the keypad's enter key. For instance graphical terminals (e.g. gnome-terminal) do and so do certain terminal programs such as vim (in certain cases) and man. As a result, these programs will not behave properly when they receive KP_Enter.

This can be fixed easily by simply adding a new entry to Key class in iomediator.py:

NP_ENTER = "<np_enter>"

and changing all XK_KP_Enter entries to map to Key.NP_ENTER instead of Key.ENTER in interface.py.

I'm not submitting a pull request directly since I don't have the proper dependencies to run the git version of autokey on my debian jessie system and this is a very simple fix.

'utf8' codec can't decode byte 0xac in position 0: invalid start byte"

just oppening autokey, appear this:

"Error starting interface. Keyboard monitoring will be disabled.
Check your system/configuration.

'utf8' codec can't decode byte 0xac in position 0: invalid start byte"

i try to delete my configuration on my home but is not working, it seems that autokey is reading some file that have a byte 0xac in position 0, but i dont know what file is, or how to repair it.

could be great if someone can help me because autokey is my right hand, a very apreciated piece of software.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.