feat(tmux): add role icons to left side of status bar
Shows icon before brackets: 😺 [gastown/Rictus] polecat
Existing sessions need restart to see the change.
This commit is contained in:
@@ -435,20 +435,33 @@ func (t *Tmux) ApplyTheme(session string, theme Theme) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// roleIcons maps role names to display icons for the status bar.
|
||||||
|
var roleIcons = map[string]string{
|
||||||
|
"coordinator": "🎩", // Mayor
|
||||||
|
"health-check": "🦉", // Deacon
|
||||||
|
"witness": "👁",
|
||||||
|
"refinery": "🏭",
|
||||||
|
"crew": "👷",
|
||||||
|
"polecat": "😺",
|
||||||
|
}
|
||||||
|
|
||||||
// SetStatusFormat configures the left side of the status bar.
|
// SetStatusFormat configures the left side of the status bar.
|
||||||
// Shows: [rig/worker] role
|
// Shows: icon [rig/worker] role
|
||||||
func (t *Tmux) SetStatusFormat(session, rig, worker, role string) error {
|
func (t *Tmux) SetStatusFormat(session, rig, worker, role string) error {
|
||||||
// Format: [gastown/Rictus] polecat
|
// Get icon for role (empty string if not found)
|
||||||
|
icon := roleIcons[role]
|
||||||
|
|
||||||
|
// Format: 😺 [gastown/Rictus] polecat
|
||||||
var left string
|
var left string
|
||||||
if rig == "" {
|
if rig == "" {
|
||||||
// Mayor or other top-level agent
|
// Mayor or other top-level agent
|
||||||
left = fmt.Sprintf("[%s] %s ", worker, role)
|
left = fmt.Sprintf("%s [%s] %s ", icon, worker, role)
|
||||||
} else {
|
} else {
|
||||||
left = fmt.Sprintf("[%s/%s] %s ", rig, worker, role)
|
left = fmt.Sprintf("%s [%s/%s] %s ", icon, rig, worker, role)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow enough room for the identity
|
// Allow enough room for the identity (increased for icon)
|
||||||
if _, err := t.run("set-option", "-t", session, "status-left-length", "40"); err != nil {
|
if _, err := t.run("set-option", "-t", session, "status-left-length", "45"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_, err := t.run("set-option", "-t", session, "status-left", left)
|
_, err := t.run("set-option", "-t", session, "status-left", left)
|
||||||
|
|||||||
Reference in New Issue
Block a user