2.2 KiB
2.2 KiB
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
-
Place the script in your scripts directory:
cp waybar-nedm-workspaces.py ~/scripts/ chmod +x ~/scripts/waybar-nedm-workspaces.py
-
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 bulletfoot
- 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":
- Ensure NEDM is running with IPC enabled
- Check that the IPC socket exists in
/run/user/$(id -u)/
- 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