开发者

Is it possible to make something like OSX Services for linux, by leveraging pipes?

开发者 https://www.devze.com 2023-01-04 15:29 出处:网络
I was reading the concept of OSX Services and it seemed very cool to me to have utilities like Dictionary, highlight-text-and-open-in-browser and a million other services that provide functionality ba

I was reading the concept of OSX Services and it seemed very cool to me to have utilities like Dictionary, highlight-text-and-open-in-browser and a million other services that provide functionality based on what the user is currently doing.

I have heard it mention that this mechanism is more similar to how pipes work in *nix, rather than background services/daemons. For e.g. , when you highlight text on OSX and select spell-check, it is effectively piping the text (using maybe the Pasteboard) to the dictionary program and returning output.

Let us assume that I have a very resource constrained machine, which means I cant have a zillion background services running - would this (Services/Pasteboard) based approach be more efficient ?

Is there anything similar in Linux ? More precisely, a mechanism to allow me to register my pip services and allow several program 开发者_如何学编程to call them. Also, shell pipes may not have strong secuirty built in (conceivably a key-management Service would be affected by this.)

For example, how would you implement a spell-check Service (using a pipe, not a daemon) that constantly checks for spelling mistakes.

Edit: another good read about how OSX Services are not ideal and about their NextStep origins.


Saying that this is "similar to pipes" is an oversimplification written for consumption by non-technical people. It is, in fact, very little like pipes other than the fact that data is being passed around.

Deskbar-Applet has a mechanism for getting the current selection, if you want to replicate that functionality.

0

精彩评论

暂无评论...
验证码 换一张
取 消