The main barrier for me transitioning to Linux as my main OS is finding a suitable alternative to AutoHotKey (AHK) on windows. I use AHK for all kinds of automation but haven’t found a usable alternative in Wayland.

Thought I’d check here to see if anyone has any suggestions?

  • med@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    3 days ago

    I’m on hyperland, and I’ve configured ydotool to do some of this work. It can move the mouse, enter keyboard shortcuts and do a bunch of things that autohotkey can, however it is by no means a complete solution, or one that comes with sensible defaults. It’s just a daemon and client, and you’ll need to set it up to do what you want.

    As far as I know there’s no record and replay function, though you could likely script one.

    Also, for triggering the scripts, you’ll need to set your Desktop’s keybindings to point to them.

    For me, it filled the requirements that it was launchable by systemd unit, as the user on login.

    I use it for a vairiety of tasks, but the primary one is typing out my clipboard as if I had pasted something. I rebound alt + shift + p to that, so I can paste windows login passwords or whatever in to Teamviewer/other stuff that doesn’t accept a paste command.

  • vjurt6@lemmy.world
    link
    fedilink
    arrow-up
    17
    ·
    5 days ago

    Hello, I had the same need. The best alternative I found is keymapper : https://github.com/houmain/keymapper You have tons of examples on the main page. The syntax is somehow similiar compared to ahk.

    I have yet to master mouseclick (issue with ydotool on KDE/wayland maybe), but everything else is working.

    I think this is the tool you are looking for, let us know what you tried :)

    • xuv@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      2
      ·
      5 days ago

      I was just today looking for an AHK alternative for a new Ubuntu Studio system I recently set up, somehow I didn’t come across this one. It’s exactly what I need, specifically the support for application-aware and input-device-aware mappings. The cross platform support using the same scripts is also intriguing. I will be trying this out soon, thanks for suggesting it!

  • jaxxed@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    5 days ago

    The Unix philosophy is many parts combined, instead of one mega-part. The Linux kernel is an exception, but the concept allows Linux to evolve over time, and to be flexible. I don’t know what AHK does (consider describing behaviour in these kinds of posts), but concepts like uber-key mapping can’t exist the way they did in Windows.

    It seems to me that you have two options:

    1. Move to a launcher style approach: find a utility that let’s you trigger a menu that offers the things that your are trying to do (dmenu, fuzzel have lots of extensions for behaviours), similar to the OSX launchpad or the windows start menu w/typing, but you can create your own options and script them
    2. Look at the key mapping for your DE (kde, gnome, sway, xfce, niri) and see what is there. KDE has excessive key mapping, and the small tiling managers have many launching and scripting options.

    Listen, moving from windows to Linux is not like moving to an apartment across the hall, it is more like moving to an apartment across the border - they have worked out some things differently, and sometimes better. Half of the goal of moving away from windows is moving away from windowisms. Explore and what else is there.

    People ask me why I use emacs (they don’t actually, but they could) and I answer by telling them that there are some very new progressive workflows that are significantly better that most IDEs - look at consult/vertico/marginalia/orderless/corfu , and forget evil/vi, look at meow. File browsing using a tree navigator is a last ditch thing. Watch prot on YouTube to learn build a stone cabin, understand philosophy, and learn how to use emacs; move forward and progress.

    Darnit, I’m rambling again.

  • Fizz@lemmy.nz
    link
    fedilink
    arrow-up
    2
    ·
    4 days ago

    The good thing about linux is a lot of the stuff can be done via bash in the CLI. If you need automation for browser tasks you can use python and selium. Which desktop environment are you using? There is a KDE kdotool and ydotool for general use.

  • PriorityMotif@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    3 days ago

    Ubuntu has built in hotkey functions that let you run terminal commands. You just write a bash script and run it with the hotkey.

    • unbuckled_easily933@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

      This is the very first thing I install after a fresh install of whichever distro I’m on that week. Love, love, LOVE me some keyd!

  • manxu@piefed.social
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    5 days ago

    KDE has a very powerful key binding subsystem. It’s a little complicated, but it allows for great freedom.

  • asciimage@sh.itjust.works
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    5 days ago

    Afaik you won’t find a single alternative, bit you’ll have to find multiple projects for specific features you’re looking for.

    For example: Kanata for key remaps, text expansion, mouse input and a whole bunch of other keyboard stuff.

    Most automation is done with shell scripts and command line utilities. So stuff like batch renaming you can do this way.

    Window automation is DE/WM specific.

    So if you could list your DE/WM and the specific kinds of automation, it will be easier to give suggestions.

  • Zucca@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    3
    ·
    5 days ago

    Interesting…

    I’ve created another xkb layout (of which syntax is cryptic)… Then modified window manager hotkeys. Then there’s completely other configuration for virtual terminals. sigh

    keyd looks promising tool.

    • pathief@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      5 days ago

      If you want to create keyboard layouts, keyd is very good for that. You can create several keyboard layers and use whatever key you want as a modifier.

      I use it to mimic the windows “US International with dead keys” layout that I’ve grown used to but it can do so much more.

  • jokro@feddit.org
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    edit-2
    5 days ago

    In case you use GNOME it has keybinds you can map to console commands built in

  • Sivilian@lemmy.zip
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    11
    ·
    5 days ago

    I would see what you could vibe code or just check if Linux can just do the automation your looking for built in. It depends on the desktop environment but I know KDE is very powerful if you are willing to put in the time.