xclip: Ukuphatha ibhodi yokunameka kulayini womyalo

El ibhodi yokunameka o ibhodi lokunamathisela iyithuluzi esinikezwa yiseva ye-X yesistimu yethu yokusebenza ukuze sabelane ngolwazi phakathi kwezinhlelo zokusebenza.

Unesibopho semisebenzi ephindaphindwayo efana ne- Imi, ikhophi y pegar. Iqukethe uhlobo lwendawo yokugcina impahla noma i-buffer lapho izinhlelo zokusebenza zingagcina khona idatha ukuze lezi zisetshenziswe kamuva ngokufanayo noma ngezinye izinhlelo zokusebenza.

Ngokuvamile, sonke siyazi ukuthi singayisebenzisa kanjani ngokubuka komsebenzisi, kungaba ngamamenyu wohlelo lokusebenza, noma ngezinqamuleli zekhibhodi, imvamisa:

  • Ctrl+X Sika
  • Ctrl+C Kopisha
  • Ctrl+V Namathisela

Kodwa-ke, kwenzekani lapho sifuna ukusebenzisa ibhodi yokunameka kusuka kufayela le- iskripthi?

xclip

xclip uhlelo lokusebenza olusivumela ukuthi sifake umbhalo ebhodini lokunameka futhi sibuyise umbhalo kuwo kulayini womyalo. Umbhalo obuyisiwe kungenzeka ufakwe nganoma yisiphi esinye isicelo.

Ngokufanayo, umbhalo ofakwe ebhodini lokunameka udlulile xclip ingasetshenziswa nganoma yiluphi olunye uhlelo lokusebenza.

Iphakheji xclip ingatholakala ezinqolobaneni zokusabalalisa okuningi. Isibonelo, ku-Ubuntu awudingi okungaphezu kokuthola okukufanele ukuyifaka:

$ sudo apt-get install xclip

Ukusetshenziswa kwayo okuyisisekelo kulula kakhulu. Ukufaka umbhalo wokufaka ojwayelekile ebhodini lokunameka, inketho kufanele icaciswe -i:

$ echo "Hola mundo" | xclip -i

Umbhalo othi "Sawubona mhlaba" uzotholakalela ezinye izinhlelo zokusebenza. Ngokufanayo, ukuthola umbhalo kusuka kubhodi yokunameka bese uwuthumela kokukhipha okujwayelekile, inketho -o:

$ xclip -o Sawubona mhlaba

Ukukhetha

Ibhodi lokunamathisela lisinikeza ama-buffers amathathu noma ukukhetha kwehlukile:

  • OKUQALA: Yisidlulisi esizenzakalelayo. Igcina umbhalo ngokumane uwumaka ngesikhombisi, ngaphandle kwesidingo sokucindezela inhlanganisela yokhiye noma enye inketho kwimenyu.
  • IBHODI LOKUQUMBELA: Le buffer isetshenziswa kakhulu izinhlelo zokusebenza. Igcina umbhalo okhethwe isikhombisi kuphela ngemuva kokucindezela inhlanganisela yokhiye noma inketho yemenyu ukusika noma ukukopisha.
  • EYESIBILI: Kuyisidididi esisizayo nesizimele. Itholakala ngokugcwele kepha akuvamile ukuthi isetshenziswe izinhlelo zokusebenza njengokujwayelekile. Isetshenziselwa izinhloso ezithile kuphela.

xclip ingalawula womathathu amabhafa. Kubalulekile kuphela ukucacisa ukuthi iyiphi esifuna ukuyisebenzisa, ngokusebenzisa inketho -ukhetho kanye nohlamvu lokuqala lwegama le-buffer. Ngokuzenzakalelayo, i-buffer iyasetshenziswa OKUQALA.

Isibonelo, ukuthola umbhalo osikiwe kolunye uhlelo lokusebenza, kufanele sisho ukuthi sifuna okuqukethwe okukhipha ibhafa IBHODI LOKUQUMBELA, ngezinketho -o y -ukhetho c

$ xclip -o -selection c
Texto cortado en gedit

Isicelo esisebenzayo

Ithuluzi xclip inikeza amathuba amaningi. Kusetshenziswa ikakhulu ku- izikripthi, lapho singenakho ukusebenzisa izinqamuleli zekhibhodi, ngoba izinqubo zenziwa ngokuzimela.

Masithathe isibonelo: ake sicabange ukuthi sifuna ukwazi ukusesha noma yiliphi igama elivela kunoma yiluphi uhlelo lokusebenza noma ikhasi lewebhu ku- ireferensi ukulihumushela esiNgisini noma kusuka esiNgisini nge-keystroke eyodwa nje.

Okokuqala, kufanele sithole ifomethi ye-URL ngamapharamitha adluliselwa kuwebhusayithi okuyiwa kuyo. Kulokhu okulandelayo:

http://www.wordreference.com/es/translation.asp?tranword=IZWI

Lapho sesikwazi lokho, kuzofanele senze ifayela le- iskripthi uvula le url ngokwesibonelo Firefox, ukufaka esikhundleni IZWI ngekhodi elilinganayo elibuyisa umbhalo otholwe kubhodi yokunameka.

Sizoyibiza, ngokwesibonelo, i-wordreference.sh, futhi izoqukatha okulandelayo:
#!/bin/bash
firefox http://www.wordreference.com/es/translation.asp?tranword=$(xclip -o)

Ekugcineni, uma sesisindise eyethu iskripthi futhi sinikele izimvume zokubulawa, kufanele siyihlobanise nesinqamuleli sekhibhodi kumphathi wethu wedeskithophu. Isibonelo, sabela inhlanganisela Ctrl+G. Futhi sikulungele.

Manje kufanele siyisebenzise kuphela. Simaka ngesikhombisi noma yiliphi igama esifuna ukulihumusha bese silicindezela Ctrl+G. Sizobona ukuthi, ngaphandle kokuchitha isikhathi, isiphequluli sivula kanjani ngekhasi elihambisana nokuhunyushwa kwegama elimakiwe.

Kuyindlela esebenzayo yokuba nomhumushi ngaso sonke isikhathi ngaphandle kokufaka izinhlelo zokusebenza zesichazamazwi.

Ngaphezu kwalokho, le ndlela efanayo ingasetshenziselwa ukunxenxa noma yiliphi elinye ikhasi lewebhu, njenge -Google, Wikipedia noma elinye isayithi elisivumela ukuthi senze usesho, noma ukuvula izinhlelo zokusebenza ezidinga amapharamitha ocingweni lwakho.

Izicelo eziningi? Okusikiselwa umcabango.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-6, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   KZKG ^ Gaara kusho

    I-athikili enhle, okufana nalokhu kuyadingeka enetheni.

    Njengoba ngenze mfushane [1] (ikakhulukazi ngenzela inzuzo yami) ngisebenzisa i-xclip, ikakhulukazi ngoba ideskithophu eningi, okungukuthi, akunandaba ukuthi yi-Gnome noma i-KDE noma njll, ngizokwazi ukukhohlisa idatha yokunameka ngaphandle kwezinkinga

    Phendula ngokucaphuna

    [1] - »blog.desdelinux.net/tag/acorta/

    1.    khanyisile kusho

      admin umbuzo kuthi ilogo yakho ye-arch iphuma kanjani futhi ngithola kuphela i-penguin ye-fucking XD engifuna leyo logo encane

  2.   wikimx kusho

    Exclente, xclip inginikeza umbono wesikripthi esine-axel, uma ngiwuthola kahle umbhalo ngiwabelana nawe kule ndawo 😀

  3.   masisebenzise i-linux kusho

    Okukhazimulayo!

  4.   neysonv kusho

    I-athikili enhle kakhulu ivula iminyango yemibono eminingi. Ngingabaza kuphela okusalayo; kufanele kube eye-x server, ngakho-ke umbuzo uthi: izosebenzela i-wayland noma i-mir ??? nge-xmir kuyabonakala ukuthi yebo kepha hhayi kwamanye amacala amabili.
    imikhonzo

  5.   taku ndini kusho

    Kupholile, umyalo owodwa we-arsenal