Skip to content

Cube-Oakley/glint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glint

Screenshot-to-AI assistant for Linux (Wayland). Bind it to a hotkey, select a region of your screen, ask a question, and get an AI-powered answer in a floating window. Like Circle to Search, but for your desktop.

How it works

  1. Press your hotkey
  2. Select a screen region (using slurp)
  3. A floating window opens with a preview of your screenshot
  4. Type a question about what you captured and hit Enter
  5. The AI streams a response in real-time
  6. Ask follow-up questions in the same session

Quick start

git clone https://github.com/cube-oakley/glint.git
cd glint
bash install.sh

The installer will:

  • Check all dependencies
  • Ask which AI provider you want (xAI or OpenRouter)
  • Prompt for your API key (or you can add it to the config file later)
  • Install Glint to ~/.local/share/glint/
  • Add glint to ~/.local/bin/ (make sure it's on your PATH)

Bind to a hotkey

Hyprland (~/.config/hypr/hyprland.conf):

bind = SUPER SHIFT, S, exec, glint

Sway (~/.config/sway/config):

bindsym $mod+Shift+s exec glint

Configuration

Config file: ~/.config/glint/config.toml

[ai]
provider = "xai"                       # "xai" or "openrouter"
base_url = "https://api.x.ai"
model = "grok-4.20-0309-reasoning"
api_key_env = "XAI_API_KEY"
api_key = ""                            # Or set directly here

[ui]
show_preview = true
width = 520
height = 640

[screenshot]
tool = "grim"

Switching providers

You can store credentials for both providers and switch by changing the provider field:

[ai]
provider = "openrouter"                 # <-- change this to switch
base_url = "https://openrouter.ai/api"
model = "x-ai/grok-4.20"
api_key_env = "OPENROUTER_API_KEY"
api_key = "sk-or-..."
reasoning = true                        # Enable reasoning (default: true, OpenRouter only)

[ai.xai]
base_url = "https://api.x.ai"
model = "grok-4.20-0309-reasoning"
api_key_env = "XAI_API_KEY"
api_key = "xai-..."

[ai.openrouter]
base_url = "https://openrouter.ai/api"
model = "x-ai/grok-4.20"
api_key_env = "OPENROUTER_API_KEY"
api_key = "sk-or-..."

When provider = "xai", Glint uses the top-level [ai] fields plus any overrides in [ai.xai]. Same for openrouter.

API keys

You can provide your API key in three ways (checked in order):

  1. api_key in the config file
  2. api_key in the provider-specific section (e.g. [ai.xai])
  3. Environment variable specified by api_key_env

Dependencies

System packages:

  • grim — Wayland screenshot tool
  • slurp — Wayland region selector
  • python3 (3.11+)
  • python-gobject — PyGObject GTK4 bindings
  • libadwaita — Adwaita widget library
  • gtk4

Python packages:

  • httpx — HTTP client with streaming

Installing dependencies

Arch Linux:

sudo pacman -S grim slurp python python-gobject libadwaita gtk4
pip install httpx

Debian/Ubuntu:

sudo apt install grim slurp python3 python3-gi libadwaita-1-dev libgtk-4-dev
pip install httpx

Uninstall

rm -rf ~/.local/share/glint
rm ~/.local/bin/glint
rm -rf ~/.config/glint

License

MIT

About

Screenshot-to-AI assistant for Linux (Wayland)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors