autohotkeyautokey

autoKey gtk 0.95.10 Icon get red an autoKey freezing


autoKey often stops working if i press my script shortcut F12

about every 70%. And about every 50% of them the icon gets red and autoKey is freezing. CPU load grows a little bit.

Its difficult to say what may the reason it.

The script (gist is a bit large.
About 500 lines and offered on github.

I debug by sending while i recording my desktop to video file (youtub LKl4Ufhh3P8 ).

it open via wine a menu (autoHotKey script called lintalist) and catches the changed clipboard and writes it out.

When I restart the autoKey script it runs a couple of times (maybe three or five times). I inserted 100 milliseconds as a pause at various points. Since then, I don't have to restart the operating system, only kill the script when it freezes.

any idea what to try?

for debugging i use such little helpers:

import subprocess
doPopupNotify_howItWorks_counter = 0
doPopupNotify_howItWorks_firstNr = 15
doPopupNotify_howItWorks = True

def popupNotify(text):
    subprocess.Popen(['notify-send', text])  # will be showed right top

def popupNotify_howItWorks(text):
    global doPopupNotify_howItWorks, doPopupNotify_howItWorks_counter
    if not doPopupNotify_howItWorks:
        return
    doPopupNotify_howItWorks_counter = doPopupNotify_howItWorks_counter + 1
    if doPopupNotify_howItWorks_counter < doPopupNotify_howItWorks_firstNr:
        return
    subprocess.Popen(['notify-send', str(doPopupNotify_howItWorks_counter) + ") " + text])  # will be showed right top
    time.sleep(.2)

System

Operating System: Kubuntu 20.04
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.4.0-52-generic
OS Type: 64-bit
autoKey gtk 0.95.10

Solution

  • These problems have not disappeared for a few days as a result of the following changes:

    The solution described above uses the clipboard and keyboard together with Linux and Windows (Wine) conveyed via two scripting languages.

    Apps:
    clipboard ⇄ AutKey ⇄ AutoHotKey ⇄ Lintalist

    operating systems:
    clipboard ⇄ KubuntuWineHQ 1

    Errors are more common in non-closed systems. Therefore, for example, such errors are typical (still open problem at 2020:11:12 in autokey):

    "Hotkeys get lost when triggered frequently"

    1. change from autokey-gtk to autokey-qt for systems using a Qt-based desktop environment such as KDE Plasma, Lumina, etc. For that there are different possibilities (github: install using pip3). I've used i used:
    sudo apt-get remove --auto-remove autokey-gtk
    sudo apt -y install autokey-qt
    
    1. changed in AHK-Souce
    ClipboardFirst := RTrim(LTrim(Clipboard, " `n`t:")," `n`t")
    to
    ClipboardFirst := RTrim(LTrim(Clipboard, " `n`t`r:")," `n`t`r")

    The autokey icon still sometimes turns red, but the CPU load does not grow much and the system no longer freezes.


    1: Wine is a free implementation of Windows on Linux.
    Kubuntu Version 20.04
    AutoKey Version 0.95.10
    Python Version 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
    wine-5.0.1