this post was submitted on 13 Apr 2024
460 points (97.3% liked)

Technology

34387 readers
239 users here now

This is the official technology community of Lemmy.ml for all news related to creation and use of technology, and to facilitate civil, meaningful discussion around it.


Ask in DM before posting product reviews or ads. All such posts otherwise are subject to removal.


Rules:

1: All Lemmy rules apply

2: Do not post low effort posts

3: NEVER post naziped*gore stuff

4: Always post article URLs or their archived version URLs as sources, NOT screenshots. Help the blind users.

5: personal rants of Big Tech CEOs like Elon Musk are unwelcome (does not include posts about their companies affecting wide range of people)

6: no advertisement posts unless verified as legitimate and non-exploitative/non-consumerist

7: crypto related posts, unless essential, are disallowed

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] MajorHavoc@programming.dev 10 points 5 months ago* (last edited 5 months ago) (1 children)

I had the same issue holding me back from giving up Windows, until I discovered the Python keyboard module.

How to bind key presses to it varies, but here's a recipe for Ubuntu, as an example:

https://askubuntu.com/questions/525482/how-can-i-assign-a-keyboard-shortcut-for-the-script-that-i-have-created#525495

Overall, it's not quite as elegant, as AutoHotKey, but it's ultimately a more powerful, since there's so much else I can also do from the same Python script.

Edit: Most notably, I don't recall AutoHotKey having any nice way to tell which apps are open, and Python can quickly call out to ps. It's been on my to-do list to leverage this to let me map keybindings according to what is open (i.e. a favorite game, or a move player.)

[โ€“] theonyltruemupf@feddit.de 4 points 5 months ago

KDE can do that without third party software I believe.