Subscribe to How-To Geek Mag-subscribe sa Paano-Upang Geek

Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Enable Google Search From Shortcut Key in KDE on (k)Ubuntu Paganahin ang Google Search Mula sa Shortcut sa Key kde sa (k) Ubuntu

KDE has an extremely powerful scripted user interface through the use of the dcop utility. Kde ay may isang lubhang makapangyarihang script na user interface sa pamamagitan ng paggamit ng mga utility dcop. You can control virtually any KDE application by entering dcop commands through shell scripts or from the shell itself. Maaari mong kontrolin ang kahit anong kde aplikasyon sa pamamagitan ng pagpasok dcop mga utos sa pamamagitan ng mga script ng shell o mula sa shell mismo. These actions can then be tied to menu items, and even hot keys. Mga kilos na ito ay maaaring pagkatapos ay nakatali sa mga bagay na menu, at kahit na hot key. KDE can also be installed on Ubuntu Kde ay maaari ding naka-install sa Ubuntu through the kubuntu-desktop package. sa pamamagitan ng kubuntu-desktop pakete.

I had asked my friend Ako ay nagtanong sa aking kaibigan Caveman Maninira sa lungga a while back if it was possible to select text in any application and do a Google search via a hotkey. isang habang bumalik kung ito ay posible na piliin ang teksto sa anumang aplikasyon at gumawa ng isang paghahanap sa Google sa pamamagitan ng isang hotkey. He came back 30 minutes later with a solution, which I'm posting for you here. Siya ay dumating sa likod ng 30 minuto mamaya may solusyon, kung saan ako para sa pag-post mo dito.

First, make sure you have the xsel package installed by running the following command: Una, siguraduhin na ang xsel pakete na naka-install sa pamamagitan ng pagpapatakbo sa mga sumusunod na command:

sudo apt-get install xsel sudo APT-i-install ang makakuha ng xsel

Now we'll create a shell script named gsrch.sh and put it in your home folder. Ngayon kami ay lumikha ng isang shell script pinangalanan gsrch.sh at ilagay ito sa iyong tahanan na folder.

kwrite ~/gsrch.sh kwrite ~ / gsrch.sh

Enter in the following text. Ipasok sa mga sumusunod na text. Make sure that there isn'ta line break on the second line (and pardon the funky formatting) Siguraduhin na may ay hindi isang line break sa ikalawang linya (at pagpasensiyahan ang funky-format)

#!/bin/bash #! / bin / Bash

dcop `dcopfind -a 'konqueror-*'` konqueror-mainwindow#1 newTab “ dcop `dcopfind-isang 'konqueror-*'` konqueror-mainwindow # 1 newTab " http://www.google.com/search?q=`xsel http://www.google.com/search?q = `xsel -p -o`&ie=UTF-8&oe=UTF-8″ -p-o `& ie = UTF-8 & oe = UTF-8"

Now enable execute permissions on the shell script: Ngayon paganahin execute permissions sa script shell:

chmod u+x ~/gsrch.sh u chmod + x ~ / gsrch.sh

Now we are ready to add this to an item to the KDE menu. Ngayon kami ay handa na upang idagdag ito sa isang item sa menu ng kde. Run kmenuedit to get to the KDE menu editor, and add a new item wherever you feel like: Patakbuhin ang kmenuedit sa kumuha sa editor ng kde na menu, at idagdag ang isang bagong bagay na kung saan gusto mong:

You can name the item whatever you want, but you will need to browse to the correct path for the command script on your system. Maaari mong pangalan sa item kahit anong gusto mo, ngunit kailangan mong i-browse sa tamang landas para sa mga utos ng script sa iyong system. Change the work path to be your home directory, and make sure that the “Enable launch feedback” checkbox is Not checked. Baguhin ang trabaho landas na iyong tahanan na direktoryo, at siguraduhin na ang mga "Paganahin ilunsad feedback" na checkbox ay Hindi nasuri.

Click on the hotkey button in the bottom right hand corner of this window, and set an appropriate hot key. I-click ang pindutan ng hotkey sa ilalim ng sulok kanan ng window na ito, at itakda ang angkop na hot key. I used Win+G, but you can set it to anything you'd like: Ginamit ko Umakit + G, ngunit maaari mong itakda ito sa anumang bagay na gusto mo:

Now we can test it out by selecting text in any window. Ngayon ay maaari naming pagsubok ito sa pamamagitan ng pagpili ng teksto sa anumang window. For instance, I wanted to figure out what this error message means, so I selected the text, and then hit the Win+G hotkey: Halimbawa, nais ko na malaman kung ano ang error na ito ay nangangahulugan na ang mensahe, kaya ko pinili ang text, at pagkatapos ay pindutin ang Umakit + G hotkey:

And easy as pie, I've got a google search window all ready to go: At madaling bilang pie, Mayroon akong isang google search window ng lahat ng handa na upang pumunta:

KDE is just amazing! Kde lang amazing!

This article was originally written on 11/25/06 Tagged with: Ang artikulong ito ay orihinal na isinulat sa 11/25/06 Tagged with: KDE Kde , , Kubuntu Kubuntu , , Ubuntu Ubuntu , , Ubuntu Tips & Tweaks Ubuntu Tips at Tweaks

Daily Email Updates Araw-araw na Updates Email

You can get our how-to articles in your inbox each day for free. Maaari kang makakuha ng aming kung-paano na mga artikulo sa iyong inbox sa bawat araw para sa libre. Just enter your name and email below: Ilagay lamang ang inyong pangalan at email sa ibaba:


Name: Pangalan:
Email: Email:

Comments (6) Comments (6)

  1. adam adam

    is this possible for ginme as well? ito ay posible para sa ginme pati na rin? with firefox -search? sa firefox-search?

  2. adam adam

    i ment ginme = “Gnome” i ment ginme = "lamang-lupa"

  3. Matt Matt

    Yes there is a gnome like one that I wrote, look it up here. Oo may lamang-lupa tulad ng isa na ako wrote, tumingin ito up dito.

    http://ubuntuforums.org/showthread.php?t=844780 http://ubuntuforums.org/showthread.php?t=844780

  4. AdamD AdamD

    That tip is really awesome. Tip na iyon ay talagang awesome. Thanks for sharing. Salamat sa pagbabahagi.
    At first I didn't know it was working, because Konqueror did not raise to the front automatically. Sa una hindi ko alam kung ito ay gumagana, dahil Konqueror ay hindi taasan sa harap awtomatikong.
    When I pulled up Konqueror later — there were all my previous searches. Kapag ako hinila up Konqueror mamaya - doon ay lahat ng aking mga nakaraang paghahanap.

    I was not able to use the 'win+g' sequence as you did. Ako ay hindi magagamit ang 'manalo + g' pagkakasunod-sunod bilang mo. It just mapped the 'g' key. Ito lamang ang nakamapang 'key g'. oops. Oops.
    Instead I used Ctl-Shift-G. Sa halip na ginamit ko Ctl-Shift-G.

    I also add %22 before and after the search term so it searches as a literal string. Ko ring magdagdag ng 22% bago at matapos na ang mga kataga sa paghahanap kaya paghahanap bilang isang literal na string.
    – AdamD - AdamD

  5. Matt Matt

    I am glad you like it, I have found it useful. Ako ay nagagalak na gusto mo ito, ako ang nakatuklas na ito kapaki-pakinabang. Please share it with others. Mangyari lamang na ibahagi ito sa iba. But I am confused about the %22. Subalit ako ay naguguluhan tungkol sa% 22. Can you submit your code so I can take a look. Maaari mong isumite ang iyong code kaya ang maaari kong tingnan.

    Thanks Salamat

  6. Tamás Tamás

    I tried to apply this great trick in KDE4, but it does not work since DCOP has been replaced with D-Bus. Ako tried na mag-aplay na ito malaking lansihin sa KDE4, ngunit hindi ito gumagana dahil DCOP ay papalitan ng D-Bus. Do you know the D-Bus solution for the same? Alam mo ba ang D-Bus solusyon para sa pareho?

    thanks! salamat!


Leave a Comment Iwanan ng isang Puna




Leave your Iwanan ang iyong mga friendly friendly comment here. puna dito.

If you have a computer help question, Kung ikaw ay may isang computer ng tulong tanong, click here to leave it on the forums i-click dito upang mag-iwan ito sa forums instead. sa halip ng.

Note: Your comment may not show up immediately on the site. Tandaan: Ang iyong puna ay maaaring hindi magpapakita agad sa site.

Our Friends Ang aming mga Friends
Getting Started Pagsisimula


About How-To Geek Tungkol sa Paano-Upang Geek
What Is That Process? Ano ba ang Proseso Iyon?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.