Go to file
rozodru 06e1e490a0 fixed issue where the name of the active window/frame disappears on workspace change 2025-07-20 16:51:06 -04:00
LICENSE Initial commit 2025-07-20 13:53:54 -04:00
README.md initial commit 2025-07-20 13:55:00 -04:00
waybar-nedm-workspaces.py fixed issue where the name of the active window/frame disappears on workspace change 2025-07-20 16:51:06 -04:00

README.md

NEDM Waybar Integration

A Python script that displays NEDM workspace information and focused window details in Waybar.

What it does

  • Shows current workspace number with a bullet indicator (●)
  • Displays the name of the currently focused application (e.g., "foot", "firefox")
  • Provides tooltip with detailed workspace and window information
  • Automatically reconnects if NEDM restarts
  • Updates in real-time as you switch workspaces or focus different windows

Requirements

  • NEDM (cagebreak) window manager with IPC enabled
  • Python 3
  • Waybar

Installation

  1. Place the script in your scripts directory:

    cp waybar-nedm-workspaces.py ~/scripts/
    chmod +x ~/scripts/waybar-nedm-workspaces.py
    
  2. Add the custom module to your Waybar configuration.

Waybar Configuration

Add to waybar config.json

Add "custom/nedm-workspaces" to your modules list:

{
  "modules-left": ["custom/nedm-workspaces"],
  "custom/nedm-workspaces": {
    "exec": "python3 ~/scripts/waybar-nedm-workspaces.py",
    "return-type": "json",
    "restart-interval": 1,
    "tooltip": true
  }
}

Add styling to style.css

#custom-nedm-workspaces {
  background-color: #2e3440;
  color: #d8dee9;
  padding: 0 10px;
  margin: 0 5px;
  border-radius: 5px;
}

#custom-nedm-workspaces.disconnected {
  background-color: #bf616a;
  color: #ffffff;
}

#custom-nedm-workspaces.error {
  background-color: #d08770;
  color: #ffffff;
}

Output Format

The script displays information in the format: WS: ●2 | foot

  • WS: - Workspace indicator
  • ●2 - Current workspace number with bullet
  • foot - Name of the focused application

Security Note

This script uses process names from PIDs instead of window titles for security. It does NOT require NEDM to be run with the -b flag, which would expose window titles but compromise security.

Troubleshooting

If the script shows "NEDM: Disconnected":

  1. Ensure NEDM is running with IPC enabled
  2. Check that the IPC socket exists in /run/user/$(id -u)/
  3. Verify NEDM was started without disabling IPC

If it shows generic "View X" instead of process names:

  • The process may have terminated
  • The script will fall back to view IDs when process information is unavailable