General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Can I Web Search in a single click using default search engine
Posted by: anontemp123
Date: April 14, 2016 01:46AM

Currently, after highlighting text, I right-click, hover over Web Search, then click a search engine on the second context menu. Is there any way I don't have to open the second menu? I want to just click on "Web Search" and have it use my default search engine.



Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: siria
Date: April 14, 2016 03:45AM

Highlight text, do NOT right-click, instead just left-click the search button.
Or right-click the search button for more options.

By the way if the text is a web adress, clicking the Go-button opens it directly too.

Tip: it's a little-known specialty of KM that buttons holding additional menus are not marked with an arrow, but instead just can be right-clicked. Saves a lot of precious toolbar space.
And if users wish they can easily add any menu of their own to most buttons: accessible mostly via Edit>Configuration>Toolbars. By adding |menuname after a buttons command line, example the home-button or those in the Privacy toolbar. The menuname must just be the english version and underlined characters must be replaced by "&" before that character.
There are some exceptions though, some buttons are not created in toolbars.cfg but by macros or plugins. Or are first created in that cfg but then altered by macros, IIRC the search button.



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: anontemp123
Date: April 14, 2016 03:52PM

That works. Not to complain too much, but I have to mouse the cursor all the way up to the search button. Any way to modify the right-click menu?

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: siria
Date: April 14, 2016 07:04PM

Only about 4 possible ways, depending on user likes... :cool:

Perhaps try this first:
Edit > Configuration > Menus
Add this:

!Selection{
Search Web Default=macros(Search)
}


The left name can be freely invented
The menu name ("Selection") can be figured out in settings/menus.cfg
The command name can be figured out in toolbars.cfg or in commands.html (or in kmm-files)

(Update: had forgotten the ! before the menu name. It means "modify" this menu. Without it, a menu is created all new, and if already existing it's deleted first)

============
Other ways:
2) create it directly in the default file (menus.cfg in settings folder) That one is easier to understand for most of us, because it already contains a hundred entries, and it's easier to determine the line position. Difference: that file creates the DEFAULT menus, so it applies to ALL profiles automatically.

============
or 3) create it in the search macro directly (search.kmm)
Find this line:
setmenu(Selection,popup,"&Web Search");
Insert above:
setmenu(Selection,macro,"Search Web Default","Search");
This way is best to locate the new line directly above the Web Search popup menu.

============
or 4) create your own little user macro (MyMenus.kmm), to collect all your menu modifications together.
"Setmenu" lines in macros allow to determine the line position by a number, or instead cite an existing menu entry above which the new one shall appear:

_MyMenus_BuildMenu{
setmenu(Selection,macro,"Search Web Default","Search",0);
}
$OnInit=$OnInit."_MyMenus_BuildMenu;";
$macroModules=$macroModules."MyMenus;";

============
By the way there are also keyboard shortcuts for "macros(Search)" defined in search.kmm:
CTRL+G or SHIFT+Return



Edited 1 time(s). Last edit at 04/16/2016 09:19PM by siria.

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: anontemp123
Date: April 16, 2016 07:41PM

Great tutorial! It was a lot of fun. Reminds me of installing a new Linux distro. I came to K-Meleon because it was a native app, but I'll stay for the customizability. Honestly, I could have lived with just the keyboard shortcut if there was no way to customize the menu.

I tried all the methods you listed. Modifying the profile menu.cfg has the side effect of overriding the menu entries built by search.kmm. I.e., the profile menu.cfg completely redefines the Selection menu instead of appending to it.

Would you know which method incurs the least performance penalty?

Also, where is kmm-files.html?

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: siria
Date: April 16, 2016 09:11PM

Glad you like it! smiling smiley

You tried ALL? Wow... chapeau grinning smiley

Oops - the profile menus.cfg deleting an existing menu was only due to a wrong syntax, sorry! Try again with this, putting a "!" before the menu name, to indicate a "modification":

!Selection{
Search Web Default=macros(Search)
}

I wasn't aware of this, using always the cfg in settings folder.

But the wiki badly needs an update too, it doesn't mention this either:
http://kmeleonbrowser.org/wiki/ConfigFiles#menus
(and is full of spam - another VERY important thing you need to know: the website is NOT edited by it's admin, not even by a group of experienced users, but instead inviting every passing idiot to write whatever bad stuff and links he wants into it!! And it's not even watched! Sorry, can't bear this insane play with the fire anymore, so must try to look away since some time. Anyway: be cautious!)

back on topic:
More updated info about menus.cfg can be found on kko's site:
http://home.arcor.de/cool.mckluus/software/kmeleon/project/reference/cfgfiles/menus.html

Quote

Also, where is kmm-files.html?

Lol! That's not a file, just meant macro files: the *.kmm files in the macros folder. Lots of tinkering possibilities there too for users who like that :cool:

About performance, am no guru on that, but can't imagine this teeny tiny change takes more than a 1/100 second in either ways ;-)

@Dorian:
Please include a hint in the user menus.cfg, to put a ! before the menu name if it shall be modified, not built completely new.
And perhaps a link to kko's site?

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: rodocop
Date: April 17, 2016 12:09AM

Great, siria!

Now I also know what ! sign means there!!! Love our forum! Love K-Meleon and love to know it better day by day!

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: JohnHell
Date: April 17, 2016 12:38AM

I didn't know that either.

I ever used to append another menu to a menu.

Let's say:

menu{
!menu2
}
menu2{
whatever
}


I didn't thought that could be possible the other way:

menu{
}
!menu{
whatever
}

I will have to test it.

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: siria
Date: April 17, 2016 05:42PM

Quote
rodocop
Great, siria! Now I also know what ! sign means there!!! Love our forum! Love K-Meleon and love to know it better day by day!

Hehe, YES, love them too grinning smiley Especially when everything works :cool: and when the forum is as lively and nice as yesterday smiling smiley

Meanwhile got around to actually test this menu thing in 75.1 now, and relieved to say, OUF, yes it works grinning smiley Here's an update, this includes the line position: right above the native popup menu:

!Selection{
Search Web Default=macros(Search)|&Web Search
}


This "!" is a bit tricky though, it only means "modification" in a starting line containing "{".
If it's before one of the middle lines, it means "inline submenu", as opposed to ":" which means "this submenu shall pop up"". But those cases are already described inside the file.



Edited 1 time(s). Last edit at 04/17/2016 05:45PM by siria.

Options: ReplyQuote
Re: Can I Web Search in a single click using default search engine
Posted by: anontemp123
Date: April 17, 2016 09:58PM

The |&Web Search means to go above the native pop-up menu?

Options: ReplyQuote


K-Meleon forum is powered by Phorum.