2026-05-18 21:17:54 +00:00
# Tailscale Widget Plugin for Dank Material Shell
A lightweight widget plugin that shows Tailscale connectivity status on the Dank Bar with quick controls for toggling connection, switching exit nodes, and copying peer addresses.
2026-07-15 01:11:59 -07:00

2026-05-19 00:20:09 +00:00
2026-05-18 21:17:54 +00:00
## Features
- **Status icon** in the bar — `vpn_key` when connected, `vpn_key_off` when disconnected
- **Right-click** to toggle Tailscale on/off
- **Left-click** to open a popout showing:
2026-07-15 01:11:59 -07:00
- Your current Tailscale IP (when connected)
2026-05-18 21:17:54 +00:00
- Active exit node (with clear button)
2026-07-15 01:11:59 -07:00
- Peer list with hostnames and IPs (when connected)
- A clear "Not connected" empty state when disconnected (no stale peer list)
2026-05-18 21:17:54 +00:00
- **Click-to-copy** any hostname or IP to clipboard
- **Exit node selection** — click `↗` on any exit-node-capable peer to route through it
2026-05-24 20:59:00 +00:00
- **On-demand status** — polls Tailscale for ground truth on load, explicit actions, and post-mutation verification (defensive poll-act-poll for toggles; no always-on timer)
2026-07-15 01:11:59 -07:00
- **Single-flight actions** — concurrent status/toggle/exit/copy chains are rejected while an operation is in flight
2026-05-18 21:17:54 +00:00
- **Toast notifications** for all errors
## Requirements
- Dank Material Shell installed and running
- `tailscale` CLI available on `PATH`
2026-05-22 06:33:08 +00:00
- A clipboard tool (`dms` or `wl-copy` )
2026-05-18 21:17:54 +00:00
## Installation
1. Clone or copy this repository so that the `tailscalectl/` directory is available:
```
git clone < repo-url >
```
2. Place the `tailscalectl/` directory into your DMS plugins directory:
```
mv tailscalectl ~/.config/dankmaterialshell/plugins/
```
The directory must contain:
```
tailscalectl/
├── plugin.json
├── TailscaleWidget.qml
2026-07-15 01:11:59 -07:00
├── lib.js
└── i18n/
2026-05-18 21:17:54 +00:00
```
3. Reload the plugin:
```
dms ipc call plugins reload tailscalectl
```
4. The Tailscale icon should appear on your Dank Bar. If connected, it shows a filled key icon; if disconnected, an outlined key icon.
## Usage
| Action | How |
|---|---|
| Toggle connection | Right-click the bar icon |
| Open popout | Left-click the bar icon |
| Copy hostname/IP | Click the text in the peer list |
| Set exit node | Click `↗` next to an exit-node peer |
| Clear exit node | Click `× ` next to "Exit node: ..." or click `↗` on current node |
## Plugin Manifest
```json
{
"id": "tailscalectl",
"name": "Tailscale",
"description": "Tailscale status and controls on the Dank Bar",
2026-07-15 01:11:59 -07:00
"author": "John Morris",
2026-05-18 21:17:54 +00:00
"icon": "vpn_key",
"type": "widget",
2026-07-15 01:11:59 -07:00
"capabilities": ["dankbar-widget"],
2026-05-18 21:17:54 +00:00
"component": "./TailscaleWidget.qml",
2026-07-15 01:11:59 -07:00
"permissions": ["process"],
"requires": ["tailscale"],
"version": "0.2.1"
2026-05-18 21:17:54 +00:00
}
```
2026-05-24 20:59:00 +00:00
## Implementation notes
- Uses `Proc` singleton (from `qs.Common` ) for all external `tailscale` commands (one-shot stdout capture + auto cleanup).
- Fully I18n-ready via `I18n.tr(...)` (source keys in American English only today; see `tailscalectl/i18n/` for scaffolding).
- Follows current `dms-plugin-dev` + DMS 1.4 plugin best practices (capabilities, requires, no raw Process for one-shots, etc.).
2026-07-15 01:11:59 -07:00
- Toggle uses intentional defensive poll-act-poll; a failed status poll aborts the pending toggle (does not invent `up` /`down` ).
- When `BackendState` is not `Running` , peer list / exit node / self IP are cleared so the UI never shows a stale connected-looking peer list.
- Status row uses `RowLayout` with a real `Layout.fillWidth` spacer (not a no-op on plain `Row` ).
- Peer `ListView` uses `Flickable.StopAtBounds` (no desktop rubber-band overshoot).
2026-05-24 20:59:00 +00:00
2026-05-18 21:17:54 +00:00
## Testing
```bash
node --test test/lib.test.js
```
## License
See [LICENSE ](LICENSE ).