News for hackers. Stuff that matters.
Re:Claude 3 model family by arendtio on Tuesday March 05, 2024 @01:29PM (#39607394)
Does someone know a similar tool like Automator on Linux for this particular use case?
Re:Claude 3 model family by c6401 on Wednesday March 06, 2024 @04:40AM (#39614096)
So one of the ways how it can be done is: In linux (at least in gnome) it's possible to bind any app or script to a custom global hotkey, plus xclip has access to the currently selected text and zenity can be used to display the result. So it's possible to do it just using bash script bound to a global hotkey.
Re:Claude 3 model family by arendtio on Friday March 08, 2024 @11:59AM (#39643043)
Thanks, xclip was the tool I was looking for. Sadly I switched to Plasma 6 two days ago and Wayland doesn't seem to have a similar tool (wl-paste just reads from the clipboard and not from the selected text).

After so many years, Wayland is still such a mess...

Re:Claude 3 model family by c6401 on Saturday March 09, 2024 @09:39AM (#39651844)
You might want to try to send ctrl+c (using something like xdotool or ydotool) to the app to copy the current selection to the clipboard and then to extract clipboard contents to use it in a script.
Re:Claude 3 model family by arendtio on Sunday March 10, 2024 @09:05AM (#39658718)
Thanks again. I changed my Klipper configuration (the KDE clipboard application) to synchronize selection and clipboard. In addition, I added a global shortcut (F1) to execute this little script:

https://bpa.st/WORA

It reads the clipboard (equal to the current selection) via wl-paste and sends a request to the Claude API via curl. Finally, it filters the response with jq (very crude) and displays it with notify-send. I have a second version of the script that sends the result via XMPP to Gajim because the answers can be quite long.

I think the experience should be similar to the one on MacOS.