AI Integration

Control your desktop with natural language and get intelligent assistance.

Optional Features

AI features are completely optional and require external API keys. DWN works perfectly without them.

Overview

DWN integrates with two AI services to provide intelligent desktop assistance:

  • OpenRouter API - Powers the AI command palette and context analysis
  • Exa API - Provides semantic web search capabilities
🤖

AI Command Palette

Type natural language commands to control your desktop. Launch apps, query system info, and more.

Super + Shift + A

👁

Context Analysis

AI analyzes your current workspace to understand your task and provide relevant suggestions.

Super + A

🔍

Semantic Search

Search the web using meaning, not just keywords. Find relevant content instantly.

Super + Shift + E

Setting Up OpenRouter

OpenRouter provides access to multiple AI models through a single API. You can use free models or paid ones depending on your needs.

1

Get an API Key

Visit https://openrouter.ai/keys and create a free account to get your API key.

2

Set the Environment Variable

Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):

~/.bashrc
export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
3

Choose a Model (Optional)

Configure the AI model in your DWN config file:

~/.config/dwn/config
[ai]
model = google/gemini-2.0-flash-exp:free

Browse available models at openrouter.ai/models

Recommended Free Models

Model ID Provider Best For
google/gemini-2.0-flash-exp:free Google Fast responses, good general use
meta-llama/llama-3.2-3b-instruct:free Meta Quick commands, lightweight
mistralai/mistral-7b-instruct:free Mistral Balanced performance

AI Command Palette

Press Super + Shift + A to open the command palette. Type natural language commands and press Enter.

Supported Commands

Category Examples
Launch Applications "open firefox"
"run terminal"
"launch file manager"
"start chrome"
System Queries "what time is it"
"how much memory is free"
"what's my IP address"
"show disk usage"
General Questions "how do I resize the master area"
"what's the shortcut for fullscreen"
"explain tiling mode"
Pro Tip

The AI understands context. You can say "open browser" instead of remembering the exact application name - it will figure out what you mean.

Context Analysis

Press Super + A to see AI-powered analysis of your current workspace.

What It Shows

  • Task Type - Coding, browsing, communication, etc.
  • Focused Window - Currently active application
  • Suggestions - Relevant shortcuts or actions based on context
  • Workspace Summary - Overview of open applications

Setting Up Exa Search

Exa provides semantic search - finding content based on meaning rather than exact keywords.

1

Get an Exa API Key

Visit https://dashboard.exa.ai/api-keys and create an account to get your API key.

2

Set the Environment Variable

~/.bashrc
export EXA_API_KEY="your-exa-key-here"
3

Start Searching

Press Super + Shift + E and type your query.

Unlike traditional search, Exa understands the meaning of your query.

Traditional Search

Keyword matching

  • Exact keyword matches
  • Boolean operators needed
  • Miss relevant results

"nginx reverse proxy setup tutorial"

Search Tips

  • Use natural, conversational queries
  • Be specific about what you're looking for
  • Results appear in a dmenu/rofi list - select to open in browser
  • Search includes articles, documentation, tutorials, and more

Privacy Considerations

Data Sent to External Services

When using AI features, the following data is sent to external APIs:

Feature Data Sent Service
Command Palette Your typed command OpenRouter (then to model provider)
Context Analysis Window titles, app names OpenRouter (then to model provider)
Semantic Search Your search query Exa

If you're concerned about privacy, you can:

  • Not configure API keys (AI features simply won't work)
  • Use OpenRouter with privacy-focused models
  • Only use AI features when needed

Troubleshooting

Make sure your API key is properly set:

  1. Check the environment variable: echo $OPENROUTER_API_KEY
  2. Ensure the variable is exported in your shell profile
  3. Log out and back in, or source your profile: source ~/.bashrc
  4. Restart DWN

Try using a faster model. Free models can sometimes be slow due to rate limiting. Gemini Flash is usually the fastest free option.

Check your Exa API key and ensure you have remaining credits. Visit the Exa dashboard to check your usage.