Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fredo-0.0.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

fredo-0.0.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file fredo-0.0.1.tar.gz.

File metadata

  • Download URL: fredo-0.0.1.tar.gz
  • Upload date:
  • Size: 8.1 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

Hashes for fredo-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d225e045ee6ce0e8d19674083c74c0bd5d36a0bbbbb104c7a0e06ee31f496265
MD5 e483393ee9e28024cf7887c213606a66
BLAKE2b-256 1781ec3c71f5016b561580fcacc22bfb840bc0a47bca1909272bb0df34d719ec

See more details on using hashes here.

File details

Details for the file fredo-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fredo-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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

Hashes for fredo-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9374d1894d91fea6f5725ae885c1a3039ff05b18f06829b0faa8d01155f9dc8
MD5 d1931ac1ecf2e7fc5b69279b043307ac
BLAKE2b-256 c8b978bbdaf4f6033791c781d17d1a4b49c81aa0a6396c910bcdef1b1673a199

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page