Elephant - cuz it's phat - is a powerful data provider service and backend for building custom application launchers and desktop utilities. It provides various data sources and actions through a plugin-based architecture, communicating via Unix sockets and Protocol Buffers.
Elephant acts as a unified backend service that aggregates data from various sources (desktop applications, files, clipboard history, etc.) and provides a consistent interface for frontend applications like custom launchers, productivity tools, or desktop widgets.
-
๐ Desktop Applications
- Auto-detection of
uwsm
orapp2unit
- Application launch history
- Desktop entry parsing
- Auto-detection of
-
๐ Files
- File preview (text/image)
- File operations: open, copy path, copy content
- Directory navigation
-
๐ Clipboard
- Text and image clipboard history
- Clipboard content management
-
โก Runner
- Command execution from explicit lists
$PATH
scanning for executables
-
๐ฃ Symbols/Emojis
- Multi-locale emoji and symbol support
- Unicode character database
-
๐งฎ Calculator/Unit Conversion
- Mathematical calculations with history
- Unit conversion using
qalc
-
๐ Custom Menus
- User-defined menu creation
- Custom action definitions
-
๐ Provider List
- Dynamic listing of all loaded providers and menus
-
๐ Websearch
- ... define custom search engines
yay -S elephant
# Providers, f.e.
yay -S elephant-desktopapplications
# Clone the repository
git clone https://github.com/abenz1267/elephant
cd elephant
# Build and install the main binary
cd cmd
go install elephant.go
# Create configuration directories
mkdir -p ~/.config/elephant/providers
# Build and install a provider (example: desktop applications)
cd ../internal/providers/desktopapplications
go build -buildmode=plugin
cp desktopapplications.so ~/.config/elephant/providers/
# Start elephant with default configuration
elephant
# Start with debug logging
elephant --debug
# Use custom configuration directory
elephant --config /path/to/config
Elephant includes a built-in client for testing and basic operations:
# Query provider (providers;query;limit;exactsearch)
elephant query "files;documents;10;false"
# activate item (qid;provider;identifier;action;query)
elephant activate "1;files;<identifier>;open;"
# List all installed providers
elephant listproviders
# Open a custom menu, requires a subscribed frontend.
elephant menu "screenshots"
# Show version
elephant version
# Generate configuration documentation
elephant generatedoc
Elephant uses a configuration directory structure:
~/.config/elephant/
โโโ elephant.toml # Main configuration
โโโ .env # Environment variables
โโโ providers/ # Provider plugins
โโโ files.so
โโโ desktopapplications.so
โโโ ...
Elephant uses Unix domain sockets for IPC and Protocol Buffers for message serialization. The main message types are:
- Query Messages: Request data from providers
- Activation Messages: Execute actions
- Menu Messages: Request custom menu data
- Subscribe Messages: Listen for real-time updates
To integrate with Elephant, your application needs to:
- Connect to the Unix socket (typically at
/tmp/elephant.sock
) - Send Protocol Buffer messages
- Handle responses and updates
See the pkg/pb/
directory for Protocol Buffer definitions.
elephant/
โโโ cmd/ # Main application entry point
โโโ internal/
โ โโโ comm/ # Communication layer (Unix sockets, protobuf)
โ โโโ common/ # Shared utilities and configuration
โ โโโ providers/ # Data provider plugins
โ โโโ util/ # Helper utilities
โโโ pkg/pb/ # Protocol Buffer definitions
โโโ flake.nix # Nix development environment
Providers are Go plugins that implement the provider interface. See existing providers in internal/providers/
for examples.
# Clone repository
git clone https://github.com/abenz1267/elephant
cd elephant
# Install dependencies
go mod download
# Build main binary
go build -o elephant cmd/elephant.go
# Run tests
go test ./...
A Nix flake is provided for reproducible development:
nix develop
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Please ensure your code follows Go best practices and includes appropriate documentation.
This project is licensed under the GNU General Public License v3.0. See LICENSE for details.
- ๐ฌ Discord Community
- ๐ Issue Tracker