News for hackers. Stuff that matters.
Re:Espanso Cross-Platform Text Expander by albertzeyer on Friday August 26, 2022 @07:19AM (#32605898)
I was wondering how this was done technically, i.e. how it gets the current text content, and how it would do the text replacement.

From a quick glance, it looks like for getting the text, it listens to all the keyboard events globally. I can imagine many potential problems and shortcomings with this approach, but on the other side, this is probably the most simple and most generic solution, working for almost every application.

For sending the text, it does sth similar, i.e. it just injects global key events. Probably first some key backspace events to delete the old text, and then the keys for the replacement text.

https://github.com/espanso/espanso/blob/dev/espanso-inject/s...

But maybe I understand the code wrong. I did not delve too deep into it.

Re:Espanso Cross-Platform Text Expander by federicoterzi on Friday August 26, 2022 @09:18AM (#32607101)
Author here :) You're pretty close! Espanso currently uses a combination of key injection + clipboard to get the best results. There are still some edge cases, but we are trying to solve them with other approaches, such as using custom Input Methods (the same mechanism used for some languages like Chinese)
Re:Espanso Cross-Platform Text Expander by SaulJLH on Friday August 26, 2022 @01:00PM (#32610042)
Any plans for AHK support? v1, but esp. v2: https://www.autohotkey.com/
Re:Espanso Cross-Platform Text Expander by veidr on Friday August 26, 2022 @07:54AM (#32606160)
I think there is literally no other way to do this well.

Maybe for some subset of applications and OS, it could work, but Espanso works with virtually everything on Mac and Linux. (Windows too I think but I don’t use it there.)

It does require a high degree of trust, but otoh it is extremely useful.

It is one of the most useful pieces of software I have ever used, so I’m willing to extend it a level of trust similar to my OS or password manager.

Re:Espanso Cross-Platform Text Expander by kamban on Friday August 26, 2022 @10:50AM (#32608271)
I have seen its codebase, and even took some inspiration for my Elephas app. The founder is an expert I can say.
Re:Espanso Cross-Platform Text Expander by kretaceous on Friday August 26, 2022 @08:55AM (#32606807)
Long time Espanso user (1+ year). It is one of those things I will lose my mind because my muscle memory is tuned to its shortcuts.

I often type the same shortcuts in my Android device out of habit. So you can tell that I'm waiting for an Android version! I'm working around it by adding words to custom dictionary in Google Keyboard. But I'd love to be able to use the same .yaml file for my phone. I'm not necessarily talking about sync as I don't change the file often.

One more thing about is the GUI search bar they have added. It has rough edges (doesn't react to my shortcut, etc.) but I'm sure it will get better.

Love Espanso! Thanks and all the best to Federico, the creator and maintainer.

Re:Espanso Cross-Platform Text Expander by federicoterzi on Friday August 26, 2022 @09:13AM (#32607032)
Thanks for the kind words! We are working hard to improve the experience, hopefully on Android as well in the future :)
Re:Espanso Cross-Platform Text Expander by sciuromorpha_ on Friday August 26, 2022 @06:07AM (#32605380)
I'm forever surprised how much this has improved my day to day working life. Simple things like having to input test email addresses and passwords on our dev environment repeatedly, or typing out addresses, or scaffolding basic scripts and code, or massively speeding up note taking. Genuinely worth digging in to.
Re:Espanso Cross-Platform Text Expander by koevet on Friday August 26, 2022 @07:46AM (#32606090)
Do you mind expanding (!) on how you use expanso for note taking? Thanks!
Re:Espanso Cross-Platform Text Expander by sciuromorpha_ on Monday August 29, 2022 @05:20AM (#32636196)
Sure! I have some snippets for common note taking formats and templates I use in Obsidian, like if I want to put a little "read later" section, or I want to specify next week/month/whatever without looking at a calendar. Basically, if I find myself writing something with any regularity or if it's anything that can be very easily computed, I think about making an Espanso shortcut for it!
Re:Espanso Cross-Platform Text Expander by jdoss on Friday August 26, 2022 @09:59AM (#32607624)
Long time Espanso user and supporter of Federico's work. It is fantastic FOSS and it helps me get stuff done everyday. His project was the first one that I sponsored on GitHub which he recently discontinued using for donations. I have to figure out how to buy him a monthly coffee now.

Also, here is a gist of my non-work specific Espanso snippets. I share (overshare??) what I am listening to on Spotify many times a day with my friends and coworkers, so the Spotify specific one gets used a lot!

https://gist.github.com/jdoss/64c663e24cca2052842701e13db77d...

Re:Espanso Cross-Platform Text Expander by noSyncCloud on Saturday August 27, 2022 @02:11PM (#32621575)
Didn't occur to me that I could use this to turbocharge my gif game, thanks lol
Re:Espanso Cross-Platform Text Expander by federicoterzi on Friday August 26, 2022 @10:41AM (#32608138)
Thanks Joe, I really appreciate the kind words :)
Re:Espanso Cross-Platform Text Expander by anyfactor on Friday August 26, 2022 @02:53PM (#32611332)
I have been a long time user of Espanso. It is an absolute godsend.

I used to work in social media management, I used to have bunch of `insert_generic_response` for birthdays to weddings to inquiries. I would have a random response generated with an Espanso hotkey for each purpose.

Now, I store my token, curl commands, documentation, code snippets well.... being a DevRel I still use `insert_generic_response` but with more technical content!

Re:Espanso Cross-Platform Text Expander by elesbao on Friday August 26, 2022 @08:25AM (#32606469)
Looks like a neat idea but having any kind of keylogger installed in my machine gives me second thoughts(a keylogger has the same principle of intercepting typed words and tags but instead of replacing them according to a backend system it sends the text away or store so some other party can read)
Re:Espanso Cross-Platform Text Expander by federicoterzi on Friday August 26, 2022 @09:21AM (#32607139)
Author here :) This is definitely a good concern to have, though Espanso was built with security in mind, so the keys you press are not logged anywere. We keep the last N in memory (with N being usually between 5 to 30 chars) to do the matching, and discard them as soon as possible
Re:Espanso Cross-Platform Text Expander by s__s on Friday August 26, 2022 @09:29PM (#32614660)
If I recall correctly Espanso also detects and auto-disables itself for password inputs correct?
Re:Espanso Cross-Platform Text Expander by n8henrie on Friday August 26, 2022 @08:23AM (#32606440)
I'm a big fan of espanso! I use it on my MacBook, my Linux desktop, and on Windows at work. Works very well on all three. I use many plain / dumb snippets, a few forms and date-based ones, and a few shell and Powershell scripts.

I also would feel bad if I didn't mention that the main developer seems incredibly nice. I looked at this as a rust project to which I might be able to make minor contributions as a newb (which I still haven't done unfortunately). Federico goes out of his way to respond (quickly) to GH issues or posts on the subreddit in the kindest way imaginable.

Re:Espanso Cross-Platform Text Expander by federicoterzi on Friday August 26, 2022 @09:22AM (#32607153)
Thanks for the kind words! Glad you found it useful :) Lately I've been less responsive due to some life circumstances, but I'm slowly getting up to speed again :)
Re:Espanso Cross-Platform Text Expander by majkinetor on Friday August 26, 2022 @09:11AM (#32607010)
Autohotkey has this, called hotstrings, and you can even bind functions and much more. Not cross platform tho.
Re:Espanso Cross-Platform Text Expander by flarg on Friday August 26, 2022 @06:08PM (#32613301)
AHK is probably the big boy in this field and it has saved me 100s of hours of typing.
Re:Espanso Cross-Platform Text Expander by sanketpatrikar on Friday August 26, 2022 @07:24AM (#32605940)
I love Espanso! I've been using it for inserting everything from email addresses to site:reddit.com

I wish it was available for Android. For now, I use the text expansion feature built into Gboard, but it has a short text limit, which limits its usefulness.

Re:Espanso Cross-Platform Text Expander by adhesive_wombat on Friday August 26, 2022 @01:38PM (#32610501)
This is a way better configuration system than AutoKey's (not AutoHotKey[1]) clunky GUI.

[1]: also this is not easily confused with another similar program when searching like AK/AHK.

Re:Espanso Cross-Platform Text Expander by smcn on Friday August 26, 2022 @08:16AM (#32606377)
Ha, I wrote something like this previously which I called Rabbit. It was in scheme, and would essentially watch for text between two carets (hence Rabbit, because it ate carets) and then the first word would be the function to run, with each subsequent word its argument.

It was cool to use and show off to colleagues but it was such a hacky piece of work as I used xev to grabs a windows input and worked off of that.

This looks _much_ better!

Re:Espanso Cross-Platform Text Expander by yewenjie on Friday August 26, 2022 @08:19AM (#32606403)
What do people use Espanso for? I like the idea of the project but never really found a good use case for? The only thing I expand so far (using custom QMK setup on the keyboard itself) is my email.

Also, is there any package that lets you cycle between your clipboard as you type anywhere?

Re:Espanso Cross-Platform Text Expander by federicoterzi on Friday August 26, 2022 @09:28AM (#32607242)
The Hub [1] is a good source of inspiration if you're curious :)

[1]: https://hub.espanso.org/search

Re:Espanso Cross-Platform Text Expander by kretaceous on Friday August 26, 2022 @09:11AM (#32607014)
> cycle between your clipboard

I'm not sure what you mean but if you want really nice clipboard management, with great UX, CLI and scripting capabilities, check out CopyQ[1]. Have been using it for a year and love it.

1: https://hluk.github.io/CopyQ/

Re:Espanso Cross-Platform Text Expander by yewenjie on Friday August 26, 2022 @09:23AM (#32607166)
I have previously enjoyed CopyQ. However, now I use a more minimal setup that uses rofi. By cycling through I meant this - I paste something from clipboard using a keybind, and then trigger keybind that erases the pasted thing and inserts the previous element from the clipboard and so on.
Re:Espanso Cross-Platform Text Expander by Rebelgecko on Friday August 26, 2022 @11:17AM (#32608629)
I have a lot of long strings I type at work (like paths I cd to often, urls, etc). I've abbreviated most of them to 3-4 letters with Espanso. I've tried using some of the fancy form building stuff but it seemed a bit rough still (although I'm still on 0.7.3)
Re:Espanso Cross-Platform Text Expander by st0le on Friday August 26, 2022 @01:46PM (#32610609)
One of my most common workflow is I copy the name of a "resource" and have to type out some diagnostic queries.

So I have espanso trigger on a shortcut and autofill queries with the clipboard being used as a placeholder.

Re:Espanso Cross-Platform Text Expander by rabbitofdeath on Friday August 26, 2022 @01:15PM (#32610245)
I absolutely ADORE Espanso - I use it for stupid stuff, but for note taking and formatting dates I love it. I just have simple expansions `:gp` does `git pull` `:dcd` does `docker-compose down` and for common tasks, you can do alot!
Re:Espanso Cross-Platform Text Expander by blacksmith_tb on Friday August 26, 2022 @02:25PM (#32611009)
That's interesting, I haven't been using it for things like that (which I usually just alias in my .zshrc), but I do go the other way and run shell commands in text input anywhere that isn't a terminal, it's super cool to be able to type ;extip (I like semicolon better than colon, since it doesn't trigger emojis in Slack etc.) and have Espanso curl ipinfo.io and pipe the return through jq to drop my current IP into anything, anywhere.
Re:Espanso Cross-Platform Text Expander by desireco42 on Friday August 26, 2022 @09:48AM (#32607486)
I don't mind listening to my typing, I do get concerns... what I can't think of, is how I would use it, can you please share more examples of your day to day usage, as current day... I really don't need that as much.

Thanks

Re:Espanso Cross-Platform Text Expander by arabello on Friday August 26, 2022 @01:25PM (#32610356)
My simple uses cases:

  - Write repetitive stuff across any application, eg. my email is pretty long, so I expand it with a short ':e' trigger)
  - Expand boring code, eg. functional programming functions to snap into pipelines
  - Drop emojis here and there (https://hub.espanso.org/all-emojis)
  - Write accented letters not available on the keyboard (I use a US keyboard, but I need to write Italian on a daily basis)
  - Drop lorem ipsum paragraphs
With some setup, the config is synced between my personal and work Macbooks. I think I will also use it for email templating soon.
Re:Espanso Cross-Platform Text Expander by kiike on Friday August 26, 2022 @03:27PM (#32611702)
Re: accented letters

I have been using the US international keyboard both at home and at work. It is a blessing so that I don't have to change keyboard layouts when changing languages, since it provides grave and acute accents (e.g. for French), the double s German letter and umlauts, euro symbol, etc. and also plays nice with programming languages and UNIX shell: for instance, quick access to slash, curly and square brackets with the same modifier key, backticks without modifier keys. Another advantage is that the layout is the same as the US keyboard you are already used to, just that some keys have new effects.

Re:Espanso Cross-Platform Text Expander by federicoterzi on Friday August 26, 2022 @10:42AM (#32608149)
The Espanso Hub is great if you need some inspiration :) https://hub.espanso.org/
Re:Espanso Cross-Platform Text Expander by fire on Friday August 26, 2022 @08:17PM (#32614267)
Really hoping for an android version some day, even if it has to use a kind of janky spell checker service to do so
Re:Espanso Cross-Platform Text Expander by subpixel on Friday August 26, 2022 @08:06AM (#32606278)
I share an Espanso package with my team of juniors and it is awesome.
Re:Espanso Cross-Platform Text Expander by throwaway888abc on Friday August 26, 2022 @12:33PM (#32609582)
Syncing across devices and Android, please. With love
Re:Espanso Cross-Platform Text Expander by memorable on Friday August 26, 2022 @10:02AM (#32607685)
Just tried this! Really awesome and cool!
Re:Espanso Cross-Platform Text Expander by riffic on Friday August 26, 2022 @03:54PM (#32612005)
espanso is a lovely tool.