Fandom

The Sysadmin Wiki

Ubiquity/Linux man pages

< Ubiquity

157pages on
this wiki
Add New Page
Talk0 Share

This page should present you the Ubiquity command, if you have the extension installed and you don't have the command already.

Source code Edit

The code is saved in a .js file on this wiki. For security reasons, the .js files on the wiki are only editable by users with sysop access.

CmdUtils.CreateCommand({
	names: ["man"],
	locale: "en-US",
	arguments: [ {role: "object", nountype: noun_arb_text, label: "search term"}],
	license: "MPL, GPLv2+, GFDL and/or (at your option) LGPLv2+",
	icon: "http://kernel.org/favicon.ico",
	preview: function(pblock, directObject) {
		var searchText = jQuery.trim(directObject.text);
		var searchDesc = "Searches Linux man pages";
		if(searchText.length < 1) {
			pblock.innerHTML = searchDesc;
			return;
		}
		var previewTemplate = searchDesc+" for ${query}";
		var previewData = {query: searchText};
		pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
	},
	execute: function(args) {
		var url = "http://www.linuxmanpages.com/search.php?term="+encodeURIComponent(args.object.text)+"&section=-1&submitted=1"
		Utils.openUrlInBrowser(url);
	}
});


TODO: Preview the results (See: Todo list)

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.