LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 11-30-2007, 01:44 PM   #1
kahn
Member
 
Registered: Feb 2004
Location: Seattle
Distribution: FC5
Posts: 109

Rep: Reputation: 15
how to add konsole context menu option


Fedora 8, kde 3.5.... whatever came with f8...

So, I talk a lot in irc(bitchx) so I want to add a right click option to the menu to open up a link in a browser.

NOW... here is the thing, it doesn't have to be context sensitive, meaning, it doesn't have to actully be a link for the option to be there.

so, i'm talking in irc, and i highlight something and just open whatever is highlighted in the browser... simple enough?

let me know if i need to provide more info, thanks.
 
Old 12-01-2007, 10:08 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
I don't think it's possible to add a menu item without editing the source and recompiling the program on your own. But there are other ways to do what you want.

First, and easiest, you can use the 'actions' function of klipper (I'm assuming you're using kde since you're using konsole). These are context-dependent functions that use regular expressions to detect when certain text patterns are copied and perform actions with them. It can be set so that whenever you copy a link starting with 'http://', it will pop up a list of programs you can send it to, including konqueror and firefox. In fact, this one should even already be set up for you as one of the defaults, you just have to enable it. If you also disable the "ignore selection" option then it will pop up automatically as soon as you highlight the text, but I find that rather annoying as that tends to fill up the klipper buffer very quickly, as klipper then remembers everything you highlight, not just copy. Otherwise you'll actually have to copy the text to the clipboard before it will activate.

Second, you might be able to set up an input action in the kde control center>regional & accessibility tab, so that you can open the current selection with a hotkey or mouse gesture. It shouldn't be too hard to write a short script using xclip (a nice little program for accessing the selection buffer) to grab the current selection and send it to your browser via the command line. Then you can set the input action to run that script. You could even use regex matching to make it context sensitive just like with klipper.

Best of all, either of these would allow you to use the action in any program, not just konsole.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gnome-desktop: add to right-click context menu? jhwilliams Linux - Software 1 07-28-2007 07:13 AM
How to add shut down option to kde logout menu sirius57 Suse/Novell 2 07-17-2007 04:52 AM
how do i add context menu item in gnome/nautilus. keratos Ubuntu 7 06-03-2007 11:48 AM
i want to add a new option to right-click menu list of a file in KDE kulkedar Linux - General 2 04-03-2005 09:11 PM
add "open terminal here" to context menu nadroj Linux - Newbie 3 01-14-2005 11:52 PM


All times are GMT -5. The time now is 11:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration