Comments (5)
does this mean you want to always search google, no matter what's typed into Spotlight?
from flashlight.
Yes, along with other results (Definition, Documents, Folders, ...) I'd like to have a google result (or some other search engine) as well.
from flashlight.
In Alfred, unmatched keywords default to google. It doesn't work the same way in Spotlight, where Spotlight always defaults to some kind of result.
from flashlight.
I think this can be done by adding !always_invoke to the google
plugin's examples.txt
, and returning dont_force_top_hit
in the results json. terminal
is the only plugin I can think of that does this.
from flashlight.
This seems to work:
import urllib
import json
import i18n
def results(parsed, original_query):
parsed = parsed["~googlequery"] if parsed else original_query
url = "https://www.google.com/search?q="
localizedurl = i18n.localstr(url)
search_url = localizedurl + urllib.quote_plus(parsed.encode('UTF-8'))
title = i18n.localstr(
"Search {0} for '{1}'").format("Google", parsed.encode('UTF-8'))
return {
"title": title,
"run_args": [search_url],
"html": """
<script>
setTimeout(function() {
window.location = %s
}, 500);
</script>
""" % (json.dumps(search_url)),
"dont_force_top_hit": True,
"webview_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
"webview_links_open_in_browser": True
}
def run(url):
import os
os.system('open "{0}"'.format(url))
But whether or not that should be default is questionable.
from flashlight.
Related Issues (20)
- Flashlight does not work in El Captitan HOT 2
- Would like to see it working for EI Capitan HOT 5
- First time install - doesn't work HOT 2
- First time user/install, giving me error HOT 1
- Instranslator returns blank
- "hide hidden files" nonfunctional
- "Remind Me" plugin crashes Flashlight occasionally HOT 1
- it does not workd in OSX sierra HOT 7
- direct-to-PostgreSQL plugin?
- Feature: switch to existing Chrome tab search plugin
- @date doesn't return intended date HOT 1
- Move Flashlight to an org so maintainenance can continue? HOT 2
- Do not work in High Sierra HOT 5
- Google translate plugin doesn't work properly
- no https on http://flashlight.nateparrott.com
- Spotlight is not working on MacOs Mojave HOT 13
- Modifications in examples.txt don't take effect? HOT 1
- Crashes HOT 2
- Stop posing issues here HOT 1
- Turn a flashlight on
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashlight.