Alfred alternative for linux
Project description
Fredo
Fredo is an attempt to copy some of Alfred's features to run on linux (X11).
Fredo was a POC project originally made to follow a book, but since It actually became useful to me I'm opening the repo with It's obvious flaws.
How It Works
Fredo implements a simple interface written in kivy that receives input from the user. The input is then parsed at runtime by Fredo that resolves what plugin should be used to get options for the current query. Thus, Fredo works with prefixes. One can have a prefix 'p' for running python scripts for example, or the prefix 'y' to quickly search and open youtube.
Plugins are just python classes that implements two methods: get_options
and action
. The former takes in the current query and returns a list of options, the latter is a definition of the action to take when the user selects an option, like copying to the clipboard or opening a document.
Writing a Plugin
This will propably change, but to write a plugin you should write a python class that inherit the Plugin
class, from fredo.plugins.base
. Your class should implement at least two methods:
action(command)
This is the method that will run once the user selects an option. The command argument is a string defined in the option.
get_options(query)
This is the method that gives the options to the user. It receives a query, and It should return a list of options. An option is defined as a dict with a title
key, an optional subtitle
key (that will be displayed in the gui) and with a command
key that will be passed to the action
method one the option is selected.
Defining plugins and prefixes
For the moment, Alfredo gets Its configs from the conf.py file in the root of the project. There you can find simple examples on how the plugins and prefixes are set.
Drawbacks
To aviod a frozen screen while expensive functions run to search for results (like searching for files in a disk or querying a slow api), every time the user types a new character a new process is spawned to handle the plugin's search for results, taking place of the previous process that is brutally killed. That means that It's not possible to cache the results, and that a lot of processes are created and killed while using Alfredo. I don't really know how to handle this and would appreciate any help on the matter.
The executable app is built using PyInstaller and at the moment I couldn't find a simpler way to distribute It.
There is no decent dependency management yet (some default actions assume that the user has a certain package installed, like xclip
).
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
Built Distribution
File details
Details for the file fredo-0.0.2.tar.gz
.
File metadata
- Download URL: fredo-0.0.2.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7411106a86227d8d525329a0582a2d43ea5720aacc11de81684512e2c411f23 |
|
MD5 | 65aa57d49d7e0802f18ba079d63bdf2d |
|
BLAKE2b-256 | b37c1f8851893ebf0005b9914ddd5442c8cc643a7a60ed531e454e9946293bb4 |
File details
Details for the file fredo-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: fredo-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df41cb001bf50a4bc7a6bbe0fb7c0333aba1c44a4d9ea37505a8a422e773a6b6 |
|
MD5 | b69573792690f6fb544df468066ce837 |
|
BLAKE2b-256 | 6f1a3dc91f66ff293b2c32927c84a1020e62d4044893ed7d7062c2efd3ca2bc6 |