Modern file explorer for the gardesk desktop
garfield is a file explorer designed for the gardesk ecosystem. It features tabbed browsing, split panes, multiple view modes (grid, list, column), thumbnails and previews, undo/redo for file operations, trash support, and XDG Desktop Portal integration for native file picker dialogs across applications.
garfield is available as an RPM package for Fedora and RHEL-compatible distributions.
Launch garfield to browse your files:
garfield can be used as a file picker dialog:
garfield is keyboard-driven. Here are the essential shortcuts:
| Key | Action |
|---|---|
Enter | Open selected item |
Backspace | Go to parent directory |
Ctrl+T | New tab |
Ctrl+W | Close tab |
Ctrl+Tab | Next tab |
Ctrl+Shift+Tab | Previous tab |
Ctrl+C | Copy selected files |
Ctrl+X | Cut selected files |
Ctrl+V | Paste files |
Ctrl+Z | Undo last operation |
Ctrl+Shift+Z | Redo operation |
Delete | Move to trash |
Shift+Delete | Delete permanently |
Ctrl+N | New folder |
F2 | Rename |
Ctrl+H | Toggle hidden files |
Ctrl+1 | Grid view |
Ctrl+2 | List view |
Ctrl+3 | Column view |
Ctrl+\ | Split pane horizontal |
Ctrl+- | Split pane vertical |
? | Show help |
Escape | Cancel/close dialog |
Open multiple directories in tabs. Ctrl+T for new tab, Ctrl+W to close.
Split view horizontally or vertically for side-by-side browsing.
Grid, list, and column (Miller columns) view modes.
Thumbnails for images, previews for images and PDFs in column view.
Undo file operations like move, copy, delete. Ctrl+Z/Ctrl+Shift+Z.
XDG Desktop Portal backend for native file dialogs in any application.
garfield accepts the following command-line options:
| Option | Type | Default | Description |
|---|---|---|---|
PATH | path | $HOME | Starting directory |
--picker, -p | flag | false | Enable file picker mode |
--directory, -d | flag | false | Select directories only (requires --picker) |
--multiple, -m | flag | false | Allow multiple selection (requires --picker) |
--filter, -f | string | none | File filter patterns (semicolon-separated, e.g., "*.rs;*.toml") |
--title, -t | string | auto | Dialog title (requires --picker) |
--accept-label | string | "Open"/"Save" | Custom accept button text |
--save | flag | false | Enable save mode for SaveFile portal requests |
--save-filename | string | none | Suggested filename for save mode |
--parent-window | u32 | none | Parent X11 window ID for transient-for hint |
GARFIELD_LOG - Set log level (trace, debug, info, warn, error)XDG_RUNTIME_DIR - Directory for IPC socketgarfield is the file explorer for the gardesk desktop environment. It provides a modern, keyboard-driven interface for file management with features like tabs, split panes, and advanced previews. garfield also serves as the XDG Desktop Portal file chooser, providing native file dialogs for all applications.
Key components:
garfield renders using gartk (the gardesk UI toolkit) with native X11 support, avoiding external framework dependencies like GTK or Qt.
garfield uses a recursive pane tree architecture inspired by tiling window managers like i3 and bspwm. This enables unlimited nesting of split panes, each maintaining independent tabs and view modes.
Window Layout
├── Pane (Split: Horizontal, ratio=0.5)
│ ├── Pane (Leaf)
│ │ ├── Tab 1: /home/user/Documents
│ │ └── Tab 2: /home/user/Downloads
│ └── Pane (Split: Vertical, ratio=0.6)
│ ├── Pane (Leaf)
│ │ └── Tab 1: /home/user/Projects
│ └── Pane (Leaf)
│ └── Tab 1: /home/user/Music The pane system uses a recursive tree structure with two node types:
Layout constants define the pane dimensions:
| Constant | Value | Purpose |
|---|---|---|
MIN_PANE_SIZE | 100px | Minimum pane dimension |
DIVIDER_SIZE | 4px | Divider hit area width |
PANE_TOOLBAR_HEIGHT | 24px | Per-pane toolbar height |
VIEW_BUTTON_WIDTH | 24px | View mode button size |
When splitting a pane, the new pane inherits the current directory and view mode from the focused pane. Closing a split pane transfers focus to its sibling, preventing closure when only one pane remains.
# Split operations
Ctrl+\ # Split current pane horizontally (side-by-side)
Ctrl+- # Split current pane vertically (stacked)
# Focus navigation between panes
Focus moves via spatial navigation (left/right/up/down)
Similar to tmux panes or i3wm containers Each leaf pane contains a vector of tabs with independent navigation state. Tab operations include:
| Operation | Shortcut | Description |
|---|---|---|
| new_tab | Ctrl+T | Create tab cloning current directory |
| close_active_tab | Ctrl+W | Close focused tab |
| next_tab | Ctrl+Tab | Switch to next tab |
| prev_tab | Ctrl+Shift+Tab | Switch to previous tab |
| switch_tab(n) | Ctrl+1-9 | Switch to tab by number |
| reorder_tab | Drag tab | Reorder tabs via drag-drop |
Middle-clicking a file or folder opens it in a new tab, preserving the current view.
garfield provides multiple ways to navigate the filesystem efficiently, including Vim-style keyboard navigation, a sidebar with quick access locations, and a breadcrumb/address bar for direct path entry.
garfield implements Vim-inspired keyboard navigation that adapts to the current view mode:
| Key | Alt | Action |
|---|---|---|
h | Left | Move left / go to parent directory |
j | Down | Move selection down |
k | Up | Move selection up |
l | Right | Move right / enter directory |
g | Home | Jump to first item |
G | End | Jump to last item |
~ | - | Go to home directory |
/ | - | Go to root directory |
Enter | - | Open selected item |
Backspace | - | Go to parent directory |
r | F5 | Refresh directory listing |
H | Ctrl+H | Toggle hidden files |
Grid mode: All four directional keys move the cursor in a 2D grid. List mode: Vertical keys move selection; horizontal keys traverse directories.
The sidebar provides quick access to XDG standard directories and user bookmarks.
It uses the dirs crate for automatic path discovery.
Custom bookmarks are stored in ~/.config/garfield/bookmarks
and support drag-drop reordering:
The drag-drop system uses a 300ms hover delay to prevent accidental reordering, with visual drop highlight feedback showing the insertion point.
Sidebar layout: 28px item height, 8px padding for comfortable click targets while maintaining compact vertical space.
The breadcrumb bar shows the current path as clickable segments. Click any segment to navigate directly to that directory.
The address bar provides prefix-based path completion as you type, searching the target directory for matching entries.
garfield supports three view modes, switchable via the per-pane toolbar or keyboard shortcuts. Each pane maintains its own view mode independently.
Icons arranged in a responsive grid with thumbnails for images. Best for visual browsing of image directories or when you need to see many files at once.
Detailed list with sortable columns showing file metadata:
Click column headers to sort. Click again to reverse direction. Navigation uses vertical movement (j/k or up/down) with Enter/Backspace for directory traversal.
Three-pane hierarchical view following the Miller columns pattern popularized by macOS Finder. Each column shows one directory level:
Column layout constants:
The preview column renders different content based on selection:
Surface caching prevents re-rendering on every frame, maintaining smooth scrolling even with large image previews.
Standard file operations with full undo/redo support. All destructive operations can be reversed.
Copy and move files using the clipboard. The clipboard integrates with X11 for inter-application copy/paste compatibility.
When pasting files that already exist in the destination, garfield automatically generates unique names by appending numbers (e.g., file.txt → file (1).txt).
File operations can be undone and redone, maintaining a history stack:
Supported undoable operations:
garfield implements the Freedesktop.org Trash specification, moving deleted files to a recoverable location instead of permanent deletion.
Access the Trash from the sidebar to:
Trash location follows XDG specification: ~/.local/share/Trash/
Right-click to access context-sensitive actions. The menu adapts based on what's selected:
| Action | Shortcut | Description |
|---|---|---|
| Open | Enter | Open with default application |
| Open With... | - | Choose application (submenu) |
| Open in New Tab | Middle-click | Open folder in new tab |
| Copy | Ctrl+C | Copy to clipboard |
| Cut | Ctrl+X | Cut to clipboard |
| Paste | Ctrl+V | Paste from clipboard |
| Duplicate | Ctrl+D | Create copy in same directory |
| Rename | F2 | Rename selected item |
| Move to Trash | Delete | Move to trash |
| Delete | Shift+Del | Permanent deletion |
| Properties | Alt+Enter | Show file properties dialog |
Menu styling uses 28px item height, 200px minimum width, with 300ms hover delay before opening submenus to prevent accidental triggers.
garfield generates previews for supported file types, with caching for performance.
Automatic thumbnail generation for images in grid view. The thumbnail system uses Triangle filter for high-quality downsampling with caching:
~/.cache/garfield/thumbnails/Full image preview in column view's preview pane. Uses Cairo surface caching to maintain smooth scrolling with large images.
Supported image formats:
First page preview for PDF documents in column view. Uses Poppler for rendering with Cairo surface caching.
Requirements:
garfield provides search and filtering capabilities for quickly locating files.
Press / or Ctrl+F to
open the search bar. Type to filter the current directory:
In picker mode, the --filter flag restricts
visible files by extension:
Empty filters match all files. Filters apply pattern matching with glob-style wildcards.
garfield-portal implements the XDG Desktop Portal FileChooser interface, providing native file dialogs for all applications. When an application requests a file dialog, garfield opens in picker mode.
To use garfield as the system file chooser:
Create a portal configuration file:
# ~/.config/xdg-desktop-portal/portals.conf
[preferred]
default=garfield
org.freedesktop.impl.portal.FileChooser=garfield Add to your window manager startup:
-- ~/.config/gar/init.lua
gar.spawn("garfield-portal") garfield-portal implements the following XDG portal methods:
Opens a file picker dialog. Supports options:
multiple - Allow multiple selectiondirectory - Select directories onlyfilters - File type filterscurrent_folder - Starting directoryOpens a save file dialog. Additional options:
current_name - Suggested filenamecurrent_folder - Starting directoryService: org.freedesktop.impl.portal.desktop.garfield
Object: /org/freedesktop/portal/desktop
Interface: org.freedesktop.impl.portal.FileChooser
Methods:
OpenFile(handle, app_id, parent_window, title, options)
SaveFile(handle, app_id, parent_window, title, options) Test the portal with a GTK or Qt application:
The garfieldctl command-line tool controls a running garfield
instance via IPC.
| Command | Description |
|---|---|
open PATH [--new-tab] | Open a directory in garfield (optionally in new tab) |
current-dir | Get the current working directory |
status | Get garfield status |
quit | Quit garfield |
garfield listens on a Unix domain socket at $XDG_RUNTIME_DIR/garfield.sock.
Commands are sent as JSON lines.
| Command | Description |
|---|---|
open | Open a directory (path: string, new_tab: bool) |
current_dir | Get current directory path |
status | Get application status |
quit | Quit the application |
Open directories from gar keybindings:
-- ~/.config/gar/init.lua
-- Launch garfield or focus existing instance
gar.bind("super+e", function()
-- Try to show existing instance, or start new
if os.execute("garfieldctl status > /dev/null 2>&1") then
gar.spawn("garfieldctl open " .. os.getenv("HOME"))
else
gar.spawn("garfield")
end
end) If thumbnails aren't showing:
PDF preview requires poppler-utils:
If applications aren't using garfield for file dialogs:
If garfieldctl can't connect to garfield:
Run garfield with verbose logging:
For further assistance:
? in garfield to show keyboard shortcuts