Internet search based on selected text
Project description
SelSearch - Internet search based on selected text
SelSearch grabs text selected in any application and opens a web browser to search for.
By default, it will search on Google, but you can custimize your search to, for example, look for a DeepL translation of your text (as in the demo below).
Installation
SelSearch can be installed using pip
:
pip install selsearch
For more infomations about installation guidelines and known issues, see INSTALL.md.
Live Demo
The demo hereunder shows how you can select text, Linux, in a terminal, search for it in Google. Then, search for an English to French translation of some text on DeepL.
Usage
While SeaSearch can be used in command line, it is recommended to use its background mode via:
selsearch run &
The &
at the end will allow SelSearch to run in background.
SelSearch will continuously listen for (customizable) keyboard shortcuts and trigger various internet researches in response. For example, in the demo, Google search is mapped to <ctrl>+<m>
and DeepL translation to <ctrl>+<n>
.
It is also recommended to set up selsearch run
to launch at startup. How to do that depends on your platform and is currently not handled by this project.
Customize
SelSearch can be configured via a config file. You can generate a default one with:
selsearch init
The path will be displayed and modifications to this file will be taken into account everytime you run selsearch
or any of its subcommands. The file will look something like this:
xsel = true # Whether to use or not XSel
exit_shortcut = "<ctrl>+<alt>+e" # Exit shortcut (optional)
[urls]
# List of urls
# You can add / remove / edit any number of lines
google = "https://www.google.com/search?q="
wordreference = "https://www.wordreference.com/enfr/"
deepl = "https://www.deepl.com/translator#en/fr/"
googlescholar = "https://scholar.google.com/scholar?q="
[shortcuts]
# List of shotcuts
# You can add / remove / edit any number of lines
"<ctrl>+0" = "google"
"<ctrl>+1" = "deepl"
"<ctrl>+2" = "wordreference"
You can validate your keyboard shortcuts with:
selsearch keys
Other functionnalities can be listed with:
selsearch --help
Future Features
Here are a list of future features that I would like to add to SelSearch:
- App Icon
- Installation that defaults to launch on startup
- Ability to customize keyboard shortcuts
- GUI so customize app
- Use of a config folder (instead of environ variable?)
- Fix keyboard shortcuts on Windows (bugs...)
- Document how to use config file
Contributing
Feel free to contribute or propose ideas using the Issues and Pull requests tabs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file selsearch-0.4.2.tar.gz
.
File metadata
- Download URL: selsearch-0.4.2.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 227948327260a4f2d5e0d2e675b97136bdcbcf9bf3eab30860604b931a7b3857 |
|
MD5 | 2dd556b6c0893a9a8bf06c565340f78e |
|
BLAKE2b-256 | 0680abb61e2716b6060e3d6611b6b498b62fc36ac27bc32d925906ddf5c1ea4a |