Skip to content

PluginYadm

Fábio Luciano edited this page Mar 23, 2026 · 1 revision

Plugin: yadm

Display yadm dotfile repository status showing modified files, untracked files, and commits ahead/behind the remote. The plugin appears in the status bar only when yadm is initialized, and provides real-time status of your dotfile repository.

Screenshot

󰒓 yadm ~2 ↑1      # 2 modified, 1 ahead - yellow/warning
󰒓 yadm +3         # 3 untracked - blue/info
󰒓 yadm            # Clean state - green/ok
󰒓 main ~1 +2 ↑3   # Branch view with changes
                  # (hidden when yadm not initialized)

Requirements

Property Value
Platform macOS, Linux
Dependencies git, yadm
Content Type dynamic
Presence conditional (hidden when yadm is not initialized)

Installation

# macOS (Homebrew)
brew install yadm

# Linux (script install)
curl -fLo /usr/local/bin/yadm https://github.com/TheLocehiliosan/yadm/raw/master/yadm
chmod a+x /usr/local/bin/yadm

# Linux (Debian/Ubuntu)
sudo apt install yadm

# Linux (Arch)
sudo pacman -S yadm

# Linux (Fedora)
sudo dnf install yadm

Make sure yadm is initialized before using this plugin:

yadm init
yadm remote add origin <your-repo-url>

Quick Start

# Enable plugin
set -g @powerkit_plugins "yadm"

Configuration Example

# Enable plugin
set -g @powerkit_plugins "yadm"

# Icon
set -g @powerkit_plugin_yadm_icon "󰒓"

# Show branch name instead of "yadm" label
set -g @powerkit_plugin_yadm_show_branch "true"
set -g @powerkit_plugin_yadm_branch_max_length "15"

# Cache duration (seconds)
set -g @powerkit_plugin_yadm_cache_ttl "60"

Options Reference

Option Type Default Description
@powerkit_plugin_yadm_icon icon 󰒓 Plugin icon (cog-outline)
@powerkit_plugin_yadm_icon_modified icon 󰒓 Icon when files are modified
@powerkit_plugin_yadm_show_branch bool false Show branch name instead of "yadm" label
@powerkit_plugin_yadm_branch_max_length number 15 Maximum branch name length (0 to disable truncation)
@powerkit_plugin_yadm_cache_ttl number 60 Cache duration in seconds
@powerkit_plugin_yadm_show_only_on_threshold bool false Only show when warning/error threshold is exceeded

States

State Condition Visibility
active yadm initialized, repository is valid Visible
inactive yadm not initialized or not a valid repository Hidden

Health Levels

Level Condition Color
ok Clean state, no changes, no unpushed commits Green
info Local modifications (changed or untracked files) Blue
warning Commits ahead of remote (unpushed commits) Yellow

Context Values

Context Description
clean No changes, no unpushed commits
modified Local modifications detected
unpushed Commits ahead of remote

Display Format

The plugin shows the yadm status with change indicators:

yadm [~changed] [+untracked] [↑ahead] [↓behind]

Or if show_branch is enabled:

branch [~changed] [+untracked] [↑ahead] [↓behind]

Indicators

Symbol Meaning
~N N modified/staged files
+N N untracked files
↑N N commits ahead of remote (not pushed)
↓N N commits behind remote (need to pull)

Examples

Display Meaning
yadm Clean state, no changes
yadm ~2 2 modified files
yadm +3 3 untracked files
yadm ~1 +2 1 modified, 2 untracked
yadm ↑3 3 commits ahead (need to push)
yadm ↓2 2 commits behind (need to pull)
yadm ~2 ↑1 2 modified, 1 ahead
main ~1 +2 ↑3 Branch view with changes
(hidden) yadm not initialized

How It Works

The plugin runs yadm status --porcelain=v1 --branch to get repository status and parses:

  1. Branch information: Current branch name and tracking status
  2. File changes: Modified (staged/unstaged) and untracked files
  3. Ahead/behind counts: Commits not pushed/pulled

The plugin is globally relevant as yadm manages $HOME dotfiles regardless of current directory.

Examples

Minimal Configuration

set -g @powerkit_plugins "yadm"

Show Branch Name

set -g @powerkit_plugins "yadm"
set -g @powerkit_plugin_yadm_show_branch "true"

Combined with Git and Development Tools

set -g @powerkit_plugins "group(git,yadm,chezmoi),group(cpu,memory),datetime"

Custom Icon for Modified State

set -g @powerkit_plugins "yadm"
set -g @powerkit_plugin_yadm_icon "󰒓"
set -g @powerkit_plugin_yadm_icon_modified "󰒔"

Faster Cache for Performance

set -g @powerkit_plugins "yadm"
# Check status every 2 minutes instead of every minute
set -g @powerkit_plugin_yadm_cache_ttl "120"

Troubleshooting

Plugin is always hidden

  1. Make sure yadm is initialized: yadm status should work without errors
  2. Check that yadm repository is valid: yadm rev-parse --is-inside-work-tree should return true
  3. Verify yadm is in your $PATH: which yadm
  4. Check dependencies: git --version and yadm --version

Plugin shows incorrect status

Clear the PowerKit cache to force a refresh:

# Via keybinding (default: Ctrl+d if configured)
# Or manually:
rm -rf ~/.cache/tmux-powerkit/data/plugin_yadm_*
tmux source ~/.tmux.conf

Performance issues

If yadm status is slow, increase the cache TTL:

set -g @powerkit_plugin_yadm_cache_ttl "300"  # 5 minutes

Related Plugins

  • git - Git repository status
  • chezmoi - Chezmoi dotfile status
  • github - GitHub notifications

Learn More

Clone this wiki locally