Skip to content

JihongJu/ulauncher-1dictionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ulauncher 1Dictionary

drawing 1Dictionary helps you access all your favourite dictionaries easily via Ulauncher.

Key features

  • Fuzzy search No worries for typo anymore!
  • Multi language support Many languages can be searched altogether. For example, English words can be searched together with Dutch words, as well as French, Spanish, Italian, German, Norwegian, and any other language.
  • Configurable English and Nederlands are the default active languages. Check custom dictionaries for more information about how to activate other languages.
  • Extensible If you are learning languages other than the default supported languages. It is possible to add more language support. Check the custom dictionaries section to add custom vocabularyies and the corresponding online dictionaryies.

Usage

demo

Requirements

Installation

Open Ulauncher Preferences, go to the "Extentions tab", click "Add Extension", copy-paste the following link and click the "Add" button:

https://github.com/JihongJu/ulauncher-1dictionary

installation

Custom dictionaries

Configure vocabulary

By default, 1Dictionary support Deutsch, English, Espanol, Francais, Italiano, Nederlands, and Norsk. But only English and Nederlands are activated by default. You can modify the list of active vocabularies via the "Vocabulary" section of the extension preference.

Active your favourate vocabulory by adding it to the "Active vocabulary" field as comma-delimted text on the Ulauncher->Preferences->Extensions->1Dictionary page:

active-vocabulary

Notes:

  • The more vocabularies activated, the slower the search is. Speed is often not an issue on modern computers. But in case you feel laggy. Consider deactivating the vocabularies you don't need, or switch to the 'regex' matching method.

Configure dictionaries

1Dictionary uses the following online dictionary services by default for the supported vocabularies:

Online dictionary service Vocabulary Dictionary URL
Linguee deutsch https://www.linguee.com/german-english/search?source=auto&query=%s
Merriam-Webster english https://www.merriam-webster.com/dictionary/%s
SpanishDict espanol https://www.spanishdict.com/translate/%s?langFrom=es
Linguee francais https://www.linguee.com/french-english/search?source=auto&query=%s
Collins italiano https://www.collinsdictionary.com/dictionary/italian-english/%s
Linguee nederlands https://www.linguee.com/dutch-english/search?source=auto&query=%s
Google Translate norsk https://translate.google.com/#view=home&op=translate&sl=no&tl=en&text=%s

It is possible to modify the dictionary URL via Ulauncher->Preferences->Extensions->1Dictionary in the corresponding configuration field.

Extend vocabulary

Deutsch, (US) English, Espanol, Francais, Italiano, Nederlands, and Norsk from JUST WORDS! are shipped with 1dictionary. You can extend the list by adding a new vocabulary file.

The vocabulary files locate in the directory ~/.local/share/ulauncher/extensions/com.github.jihongju.ulauncher-1dictionary/vocabularies. Each vocabulary file is a newline-delimited text file. The filename indicates the language, e.g.,

language vocabulary file name
English english.txt
Nederlands nederlands.txt
Espanol espanol.txt
Deutsch deutsch.txt
Francais francais.txt
Italiano italiano.txt
Norsk norsk.txt

Configure online dictionary services

1Dictionary uses Google Translate for custom vocabularies. You can add your preferred online dictionary service to gain better experience.

Online dictionary service can be configured in the "Online dictionary service" field on the extension preference page:

online-dictionary

Online dictionary service Vocabulary needed Configuraion
Any other online dictionary anyvocabulary.txt anyvocabulary, query-for-any-online-dictionary-with-a-word-placeholder-'%s'

Notes:

  • Use %s as the placeholder for the word to search in the query
  • Use , to delimit language and query; The name of the language has to match the vocabulary file name, e.g. english -> english.txt, nederlands -> nederlands.txt
  • Use ; to delimit different dictionaries, for example, english, https://www.merriam-webster.com/dictionary/%s ; nederlands, https://www.linguee.com/dutch-english/search?source=auto&query=%s

Development

  1. (Exit Ulauncher if it's running) Run ulauncher --no-extensions --dev -v

  2. (In another terminal) Run

VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054/ulauncher-1dictionary PYTHONPATH=$HOME/src/Ulauncher /usr/bin/python3 $HOME/.local/share/ulauncher/extensions/ulauncher-1dictionary/main.py

References