Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

AHK in Linux?


  • Please log in to reply
86 replies to this topic
Innomen
  • Members
  • 63 posts
  • Last active: Apr 30 2014 06:35 PM
  • Joined: 11 Nov 2008
I don't need to move the mouse I just need to be able to simulate clicking, and replace text.

I use AHK primarily for the Auto correction of spelling errors.

It is really quite shocking to me that there isn't a port of this for *nix, or something similar enough to support ahk files.

Tuncay
  • Members
  • 1945 posts
  • Last active: Feb 08 2015 03:49 PM
  • Joined: 07 Nov 2006
It cant be ported to other than a Windows system. Never it was thought before and never it will be. AutoHotkey works very close with Windows. Practically, it is not possible to convert it to a native Linux application. (Hope I did not say something false.)

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Yes, AutoHotkey works very closely with Windows, but that only means that it would be difficult to port AutoHotkey to another OS. If the OS has a window manager, odds are it is possible. There are even *nix alternatives to some of AutoHotkey's capabilities (proving it would be possible), probably already mentioned in this thread.

tinku99
  • Members
  • 560 posts
  • Last active: Feb 08 2015 12:54 AM
  • Joined: 03 Aug 2007
I am working on a port to linux: ahklinux.

I am experimenting with different approaches, but modifying a window manager as Lexikos' mentioned is one of them. I am looking at fluxbox.

Erik de Bruijn
  • Guests
  • Last active:
  • Joined: --
> See also http://autokey.sourceforge.net/ - supports hotstrings

This works well for me and is available on Ubuntu 9.4

What's more, I'm actually already saving time with it! (by automated bbcode)

Innomen
  • Members
  • 63 posts
  • Last active: Apr 30 2014 06:35 PM
  • Joined: 11 Nov 2008
*smacks Erik de Bruijn up side the head*

Dude. Seriously.

Try actually reading he thread.

I sincerely hope you are a spam bot or being sarcastic or something and I'm the moron for not noticing it.

cerewa notloggedin
  • Guests
  • Last active:
  • Joined: --
xdotool...

It's not autohotkey for linux. But it's a script tool that lets you simulate keystrokes /mouse activity; it will also allow you to move or resize a window using a script.

http://www.semicompl...ojects/xdotool/

OceanMachine
  • Members
  • 790 posts
  • Last active: Aug 23 2013 02:10 PM
  • Joined: 15 Oct 2007

I am working on a port to linux: ahklinux.

I am experimenting with different approaches, but modifying a window manager as Lexikos' mentioned is one of them. I am looking at fluxbox.


Reposting the link as it was deleted from its original location:

http://www.autohotke...pic.php?t=50534

AdilAA
  • Guests
  • Last active:
  • Joined: --
hmm, i have dual-boot so i was experimenting, and i double clicked an AHK, and i browsed for the AutoHotKey.exe whilst in my Linux, and i opened it, it works that way

OceanMachine
  • Members
  • 790 posts
  • Last active: Aug 23 2013 02:10 PM
  • Joined: 15 Oct 2007
There is of course IronAHK which is looking very good.

AdilAA
  • Guests
  • Last active:
  • Joined: --
i would just recommend AHK and take the Wine Package for your Ubuntu, then run the AutoHotKey.exe and your fine from there, a 100% trusted program, Now on Ubuntu

knet
  • Members
  • 1 posts
  • Last active: Jan 06 2014 09:10 PM
  • Joined: 05 Jan 2014

after looking for a usable alternative for ages i realized i could have done it all the time. I utilize bash script and xdotool. Since i am using fluxbox i am able to bind my shell script to a key in /home/xxxx/.fluxbox/keys. making a working script takes a bit much effort then doing it in autohotkey because there are no functions like the $active var or what its called, you have to do workarounds for that in your script, f.e. $(xprop -id $(xdotool getwindowfocus) WM_NAME | awk '{print $3 $4}' | tail -c +2 | head -c -2 ) gives the active window name. knowledge in bash is recommended, but a few hours of google should solve this... did it for me. i know i have too much time :) but finally, it works great.

 

my example script, this presses the w key to run forward and mouse1 to mine meanwhile, when the script is executed again it stops. bound this to caps key with fluxbox:

 

#!/bin/sh
#
#keycodes 25=w
windowname=$(xprop -id $(xdotool getwindowfocus) WM_NAME | awk '{print $3 $4}' | tail -c +2 | head -c -2 ) #define window name var

if [ $windowname = "Minecraft1.7.4" ]; then        # if $active substitution

if [ -f /home/knet/makros/minec1.lock ]; then       # lockfile for on-off switch mechanism

wmctrl -a "Minecraft 1.7.4"                                  # wmctrl can activate and control windows
xdotool mouseup 1                                              #send input with xdotool
xdotool keyup 25
xdotool key 25
rm /home/knet/makros/minec1.lock -f                  #remove lockfile for on-off switch mechanism

else

wmctrl -a "Minecraft 1.7.4"
xdotool keydown 25
sleep 1
xdotool mousedown 1
echo 1 >/home/knet/makros/minec1.lock                  #create lockfile for on-off switch mechanism

fi

else

xdotool keypress 25
rm /home/knet/makros/minec1.lock -f
echo "minecraft not running"

fi
 

 

p.s.: dont know if this really is the right forum for that :> im sorryyy

greets, knet