Skip to main content
Version: 1.4

Keybinds & Cheatsheets

██╗  ██╗███████╗██╗   ██╗██████╗ ██╗███╗   ██╗██████╗ ███████╗
██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔══██╗██║████╗  ██║██╔══██╗██╔════╝
█████╔╝ █████╗   ╚████╔╝ ██████╔╝██║██╔██╗ ██║██║  ██║███████╗
██╔═██╗ ██╔══╝    ╚██╔╝  ██╔══██╗██║██║╚██╗██║██║  ██║╚════██║
██║  ██╗███████╗   ██║   ██████╔╝██║██║ ╚████║██████╔╝███████║
╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═════╝ ╚═╝╚═╝  ╚═══╝╚═════╝ ╚══════╝

The dms keybinds command provides a unified interface for viewing and managing keybinds across different applications. It can parse application-specific configurations (like Hyprland) and display user-defined cheatsheets in a consistent format.

Overview

The keybinds framework offers:

Quick Start

List all available keybind providers:

dms keybinds list
# Alias options:
dms cheatsheet list
dms chsht list

Show keybinds for a specific application:

dms keybinds show hyprland
dms keybinds show sway
dms keybinds show mangowc
dms keybinds show tmux
dms keybinds show firefox

:::tip Display in Shell You can also display keybinds directly within DMS using IPC:

dms ipc call keybinds toggle hyprland
dms ipc call keybinds toggle sway
dms ipc call keybinds toggle <provider>

This opens a modal overlay showing the keybinds in the shell interface. :::

DMS Keybinds UI displayDMS Keybinds UI display

Built-in Providers

Hyprland

The Hyprland provider automatically parses your Hyprland configuration files and extracts keybinds.

Features:

Usage:

# Use default Hyprland config path (~/.config/hypr)
dms keybinds show hyprland

# Specify custom path
dms keybinds show hyprland --path /path/to/hypr/config

Description Priority:

The provider generates descriptions in this order:

  1. Custom comment in your config (e.g., bind = SUPER, T, exec, kitty # Open terminal)
  2. Auto-generated for known dispatchers (e.g., killactive → "Close window")
  3. Fallback format showing dispatcher and params (e.g., togglegroup)

Category Logic:

Binds are automatically categorized based on their dispatcher:

Example Hyprland config:

##! Window Management
bind = SUPER, Q, killactive
bind = SUPER, F, fullscreen, 0

###! Movement
bind = SUPER, left, movefocus, l
bind = SUPER, right, movefocus, r

##! Workspaces
bind = SUPER, 1, workspace, 1
bind = SUPER, 2, workspace, 2

##! Applications
bind = SUPER, T, exec, kitty # Open terminal
bind = SUPER, E, exec, thunar # File manager

Sway

The Sway provider automatically parses your Sway configuration files and extracts keybinds.

Features:

Usage:

# Use default Sway config path (~/.config/sway/config)
dms keybinds show sway

# Specify custom path
dms keybinds show sway --path /path/to/sway/config

Example Sway config:

##! Window Management
bindsym $mod+q kill
bindsym $mod+f fullscreen toggle

###! Movement
bindsym $mod+Left focus left
bindsym $mod+Right focus right

##! Workspaces
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2

##! Applications
bindsym $mod+Return exec kitty # Open terminal

MangoWC

The MangoWC provider automatically parses your MangoWC (dwl) configuration and extracts keybinds.

Features:

Usage:

# Use default MangoWC config path
dms keybinds show mangowc

# Specify custom path
dms keybinds show mangowc --path /path/to/mangowc/config

Niri

The Niri provider parses KDL-format Niri configuration files and extracts keybinds. Unlike the other providers, Niri is writable—you can create and manage keybind overrides through DMS.

Features:

Usage:

# Use default Niri config path (~/.config/niri)
dms keybinds show niri

# Specify custom config directory
dms keybinds show niri --path /path/to/niri/config

Writing Keybinds

Set overrides that get written to ~/.config/niri/dms/binds.kdl:

# Basic keybind
dms keybinds set niri "Mod+T" "spawn kitty"

# With description (shown in hotkey overlay)
dms keybinds set niri "Mod+T" "spawn kitty" --desc "Open terminal"

# With options
dms keybinds set niri "Mod+V" "spawn pavucontrol" \
--desc "Volume control" \
--allow-when-locked

# Disable key repeat
dms keybinds set niri "Mod+Q" "close-window" --no-repeat

# Set cooldown between activations
dms keybinds set niri "Mod+Print" "screenshot" --cooldown-ms 500

# Replace an existing keybind with a new key
dms keybinds set niri "Mod+Shift+T" "spawn kitty" \
--desc "Open terminal" \
--replace-key "Mod+T"

Remove a keybind:

dms keybinds remove niri "Mod+T"

Niri Config Setup

Include the DMS binds file in your Niri config:

// ~/.config/niri/config.kdl

// Include DMS keybind overrides
include "~/.config/niri/dms/binds.kdl"

binds {
Mod+Q { close-window; }
Mod+T { spawn "kitty"; }
}

:::tip Include Order Matters

The cheatsheet output includes conflict detection showing which binds are overridden. :::

Bind Options

OptionFlagDescriptionrepeat--no-repeatDisable key repeat (default: enabled)cooldown-ms--cooldown-ms <ms>Minimum time between activationsallow-when-locked--allow-when-lockedAllow bind when screen is lockedhotkey-overlay-title--desc <text>Description shown in Niri's hotkey overlay

Action Formats

# Simple action
dms keybinds set niri "Mod+F" "fullscreen"

# Action with argument
dms keybinds set niri "Mod+1" "focus-workspace 1"

# Spawn with simple command
dms keybinds set niri "Mod+T" "spawn kitty"

# Spawn with shell command
dms keybinds set niri "Mod+P" "spawn sh -c \"wofi --show drun\""

Category Logic

Binds are auto-categorized based on their action:

CategoryActionsAlt-Tabnext-window, previous-windowScreenshotAnything containing "screenshot"Overviewshow-hotkey-overlay, toggle-overviewSystemquit, power-off-monitors, DPMS actionsExecutespawn commandsWorkspaceActions containing "workspace"Monitorfocus-monitor-*, move-*-to-monitor-*WindowFocus, move, swap, resize, column actionsOtherEverything else

Custom Cheatsheets

You can create custom cheatsheets for any application by adding JSON files to the cheatsheets directory.

Directory Locations

The framework follows XDG Base Directory standards:

Default location (when no XDG vars set):

~/.config/DankMaterialShell/cheatsheets/

With XDG_CONFIG_HOME set:

$XDG_CONFIG_HOME/DankMaterialShell/cheatsheets/

With XDG_CONFIG_DIRS set (NixOS compatibility): The framework searches in this order:

  1. $XDG_CONFIG_HOME/DankMaterialShell/cheatsheets/
  2. Each directory in $XDG_CONFIG_DIRS/DankMaterialShell/cheatsheets/

JSON Format

Create a file named after your application (e.g., vim.json, tmux.json):

{
"title": "Vim Keybinds",
"provider": "vim",
"binds": {
"Mode": [
{
"key": "i",
"desc": "Enter insert mode",
"subcat": "Insert"
},
{
"key": "Esc",
"desc": "Exit insert mode",
"subcat": "Normal"
}
],
"Editing": [
{
"key": "dd",
"desc": "Delete current line",
"subcat": "Delete"
},
{
"key": "yy",
"desc": "Copy current line",
"subcat": "Yank"
},
{
"key": "p",
"desc": "Paste after cursor",
"subcat": "Paste"
}
],
"Navigation": [
{
"key": "gg",
"desc": "Go to first line"
},
{
"key": "G",
"desc": "Go to last line"
}
]
}
}

Field Reference

Example: tmux Cheatsheet

File: ~/.config/DankMaterialShell/cheatsheets/tmux.json

{
"title": "tmux Keybinds",
"provider": "tmux",
"binds": {
"Sessions": [
{
"key": "Ctrl+B, $",
"desc": "Rename session"
},
{
"key": "Ctrl+B, d",
"desc": "Detach from session"
}
],
"Windows": [
{
"key": "Ctrl+B, c",
"desc": "Create new window"
},
{
"key": "Ctrl+B, ,",
"desc": "Rename window"
},
{
"key": "Ctrl+B, n",
"desc": "Next window"
},
{
"key": "Ctrl+B, p",
"desc": "Previous window"
}
],
"Panes": [
{
"key": "Ctrl+B, %",
"desc": "Split vertically",
"subcat": "Split"
},
{
"key": "Ctrl+B, \"",
"desc": "Split horizontally",
"subcat": "Split"
},
{
"key": "Ctrl+B, x",
"desc": "Close pane",
"subcat": "Management"
}
]
}
}

After creating the file, it will automatically be discovered:

dms keybinds list
# Shows: hyprland, mangowc, sway, firefox, tmux, vim, ...

dms keybinds show tmux
# Displays your custom tmux cheatsheet

Command Reference

dms keybinds list

Lists all available keybind providers (both built-in and custom).

Aliases: dms cheatsheet list, dms chsht list

dms keybinds list

Example output:

Available providers:
- hyprland
- mangowc
- sway
- firefox
- tmux
- vim

dms keybinds show <provider>

Displays keybinds for the specified provider.

Aliases: dms cheatsheet show, dms chsht show

dms keybinds show <provider> [flags]

Flags:

Examples:

# Show Hyprland keybinds from default location
dms keybinds show hyprland

# Show Hyprland keybinds from custom location
dms keybinds show hyprland --path /custom/path/to/hypr

# Show Sway keybinds with custom config
dms keybinds show sway --path /etc/sway/config

# Show MangoWC keybinds with custom config
dms keybinds show mangowc --path /custom/mangowc/config

# Show custom cheatsheet
dms keybinds show vim

Tips & Best Practices

Organizing Hyprland Configs

Use section headers to organize your keybinds:

##! Window Management
###! Focus
bind = SUPER, left, movefocus, l
bind = SUPER, right, movefocus, r

###! Layout
bind = SUPER, F, fullscreen, 0
bind = SUPER, V, togglefloating

##! Applications
bind = SUPER, T, exec, kitty
bind = SUPER, B, exec, firefox

Hiding Internal Binds

Use [hidden] to exclude binds from the display:

# This won't appear in the keybinds list
bind = SUPER, X, exec, secret-script # [hidden]

Descriptive Comments

Add clear comments to override auto-generated descriptions:

# Auto-generated: "Launch application: kitty"
bind = SUPER, T, exec, kitty

# Custom: "Open terminal"
bind = SUPER, T, exec, kitty # Open terminal

Consistent Naming

When creating custom cheatsheets, use consistent naming: