-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdmenu-launcher.sh
More file actions
executable file
·348 lines (319 loc) · 12 KB
/
Copy pathdmenu-launcher.sh
File metadata and controls
executable file
·348 lines (319 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
#!/bin/bash
# 🚀 dmenu-launcher.sh - Comprehensive dmenu launcher for milhy777
# Unified 3-PC development ecosystem launcher
set -euo pipefail
SSH_OPTS="-o BatchMode=yes -o ConnectTimeout=2 -o ConnectionAttempts=1 -o ServerAliveInterval=5 -o ServerAliveCountMax=1 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=accept-new"
# Colors and styling
DMENU_OPTS="-f -i -l 20 -fn 'JetBrains Mono-12' -nb '#1e1e1e' -nf '#d4d4d4' -sb '#007acc' -sf '#ffffff'"
# Main categories
declare -A CATEGORIES=(
["🖥️ 3-PC Servers"]="servers"
["🤖 AI Tools"]="ai"
["🌐 Web Services"]="web"
["📊 Monitoring"]="monitor"
["⚡ Quick Actions"]="quick"
["🔒 Vault (Secured)"]="vault"
["📚 Reference"]="reference"
)
# 3-PC Servers submenu
servers() {
local choice=$(echo -e "🏠 HAS - Home Automation Server\n🧠 LLMS - LLM Server\n💻 Aspire - Main Workstation\n🔗 Session Manager\n📋 Tmux Status\n🔄 Restart All Sessions\n📊 Multi-Server Monitor" | dmenu $DMENU_OPTS -p "🖥️ 3-PC Servers:")
case "$choice" in
"🏠 HAS - Home Automation Server")
konsole -e ssh $SSH_OPTS root@Home-Automation-Server &
;;
"🧠 LLMS - LLM Server")
konsole -e ssh $SSH_OPTS milhy777@192.168.0.41 &
;;
"💻 Aspire - Main Workstation")
konsole -e ssh $SSH_OPTS milhy777@192.168.0.10 &
;;
"🔗 Session Manager")
konsole -e bash -c "session-list; echo; echo 'Commands: session-aspire, session-has, session-llms'; echo 'Press any key...'; read" &
;;
"📋 Tmux Status")
konsole -e bash -c "echo '=== UNIFIED 3-PC TMUX ECOSYSTEM ==='; session-list; echo; echo 'Press any key...'; read" &
;;
"🔄 Restart All Sessions")
konsole -e bash -c "echo 'Restarting tmux sessions on all servers...'; ~/tmux-autostart.sh; ssh $SSH_OPTS milhy777@192.168.0.41 '~/tmux-autostart.sh'; ssh $SSH_OPTS root@Home-Automation-Server '~/tmux-autostart.sh'; echo 'Done!'; read" &
;;
"📊 Multi-Server Monitor")
konsole -e bash -c "while true; do clear; echo '=== UNIFIED 3-PC ECOSYSTEM STATUS ==='; echo; echo 'ASPIRE:'; ~/system_monitor.sh compact; echo 'LLMS:'; ssh -n $SSH_OPTS milhy777@192.168.0.41 '~/system_monitor.sh compact' 2>/dev/null || echo 'Offline'; echo 'HAS:'; ssh -n $SSH_OPTS root@Home-Automation-Server '~/system_monitor.sh compact' 2>/dev/null || echo 'Offline'; echo; echo 'Press Ctrl+C to exit'; sleep 3; done" &
;;
esac
}
# AI Tools submenu
ai_tools() {
local choice=$(echo -e "Claude (Local)\nClaude Code\nClaude Dev\nGemini Account 1\nGemini Account 2\nMyCoder v2.0\nMyCoder Simple\nVS Code Insiders\nBrowser OS" | dmenu $DMENU_OPTS -p "🤖 AI Tools:")
case "$choice" in
"Claude (Local)")
/home/milhy777/.claude/local/claude
;;
"Claude Code")
cd /home/milhy777/Develop && claude
;;
"Claude Dev")
/home/milhy777/claude-dev
;;
"Gemini Account 1")
firefox --new-window "https://gemini.google.com" &
;;
"Gemini Account 2")
firefox --private-window "https://gemini.google.com" &
;;
"MyCoder v2.0")
cd /home/milhy777/Develop/Production/MyCoder-v2.0 && poetry run python -m enhanced_mycoder_v2
;;
"MyCoder Simple")
cd /home/milhy777 && python3 simple_mycoder.py
;;
"VS Code Insiders")
code-insiders &
;;
"Browser OS")
firefox --new-window "about:blank" &
;;
esac
}
# Web Services submenu
web_services() {
local choice=$(echo -e "HAS - Home Assistant (8123)\nHAS - AdGuard (3000)\nHAS - Portainer (9000)\nHAS - ZEN Coordinator (8020)\nLLMS - LLM Interface (8080)\nLLMS - Ollama API (11434)\nLLMS - Shared Folder\nAspire - Dev Server (8000)\nAspire - Testing (3001)" | dmenu $DMENU_OPTS -p "🌐 Web Services:")
case "$choice" in
"HAS - Home Assistant (8123)")
firefox --new-tab "http://192.168.0.58:8123" &
;;
"HAS - AdGuard (3000)")
firefox --new-tab "http://192.168.0.58:3000" &
;;
"HAS - Portainer (9000)")
firefox --new-tab "http://192.168.0.58:9000" &
;;
"HAS - ZEN Coordinator (8020)")
firefox --new-tab "http://192.168.0.58:8020/services" &
;;
"LLMS - LLM Interface (8080)")
firefox --new-tab "http://192.168.0.41:8080" &
;;
"LLMS - Ollama API (11434)")
firefox --new-tab "http://192.168.0.41:11434" &
;;
"LLMS - Shared Folder")
timeout 5s llms-mount && dolphin /mnt/llms &
;;
"Aspire - Dev Server (8000)")
firefox --new-tab "http://192.168.0.10:8000" &
;;
"Aspire - Testing (3001)")
firefox --new-tab "http://192.168.0.10:3001" &
;;
esac
}
# Monitoring tools submenu
monitoring_tools() {
local choice=$(echo -e "htop\nCustom System Monitor\nReal-time Monitor\nTemperature Watch\nCPU Info\nTmux Monitor Session\nPower Status\niotop (install needed)\nnethogs (install needed)\nbtop (install needed)" | dmenu $DMENU_OPTS -p "📊 Monitoring:")
case "$choice" in
"htop")
konsole --noclose -e htop &
;;
"Custom System Monitor")
konsole --noclose -e /home/milhy777/system_monitor.sh &
;;
"Real-time Monitor")
konsole --noclose -e /home/milhy777/system_monitor.sh realtime &
;;
"Temperature Watch")
konsole --noclose -e watch -n 1 'sensors | grep -E "Core|temp"' &
;;
"CPU Info")
konsole --noclose -e sh -c 'grep -E -m 6 "model name|cpu MHz|cache size" /proc/cpuinfo; read' &
;;
"Tmux Monitor Session")
tmux-sys
;;
"Power Status")
konsole --noclose -e sh -c '/home/milhy777/power-enhanced status; read' &
;;
"iotop (install needed)")
notify-send "iotop" "Needs installation: sudo apt install iotop"
;;
"nethogs (install needed)")
notify-send "nethogs" "Needs installation: sudo apt install nethogs"
;;
"btop (install needed)")
notify-send "btop" "Needs installation: sudo snap install btop"
;;
esac
}
# Quick actions submenu
quick_actions() {
local choice=$(echo -e "SSH → HAS\nSSH → LLMS\nSSH → Aspire\nTmux Sessions\nPower Performance\nPower Balanced\nPower Emergency\nGit Status\nDocker PS\nBackup Status\nSession List" | dmenu $DMENU_OPTS -p "⚡ Quick Actions:")
case "$choice" in
"SSH → HAS")
konsole -e HAS &
;;
"SSH → LLMS")
konsole -e LLMS &
;;
"SSH → Aspire")
konsole -e Aspire &
;;
"Tmux Sessions")
konsole -e session-manager &
;;
"Power Performance")
power-performance && notify-send "Power" "Set to Performance mode"
;;
"Power Balanced")
power-balanced && notify-send "Power" "Set to Balanced mode"
;;
"Power Emergency")
power-emergency && notify-send "Power" "Emergency mode activated"
;;
"Git Status")
konsole --noclose -e sh -c 'gs; read' &
;;
"Docker PS")
konsole --noclose -e sh -c 'dps; read' &
;;
"Backup Status")
konsole --noclose -e sh -c 'backup-status; read' &
;;
"Session List")
konsole --noclose -e sh -c 'session-list; read' &
;;
esac
}
# Vault (secured) submenu
vault_access() {
# Check if keyring is available (future implementation)
if ! command -v python3 >/dev/null 2>&1; then
notify-send "Vault" "Python3 required for keyring access"
return 1
fi
local choice=$(echo -e "Network Topology\nSSH Keys\nAPI Keys\nService Passwords\nDatabase Connections\n---\nInstall Keyring\nSetup Vault" | dmenu $DMENU_OPTS -p "🔒 Vault (Secured):")
case "$choice" in
"Network Topology")
notify-send "Vault" "Feature available after keyring setup"
;;
"SSH Keys")
konsole -e sh -c 'ls -la ~/.ssh/; read' &
;;
"API Keys")
notify-send "Vault" "Secured vault not yet implemented"
;;
"Service Passwords")
notify-send "Vault" "Secured vault not yet implemented"
;;
"Database Connections")
notify-send "Vault" "Secured vault not yet implemented"
;;
"Install Keyring")
konsole -e sh -c 'echo "Run: sudo apt install python3-keyring"; read' &
;;
"Setup Vault")
notify-send "Vault" "Vault setup script - coming soon"
;;
esac
}
# Reference submenu
reference_guide() {
local choice=$(echo -e "MILHY777.md - Personal Guide\nFUT-TASKLIST.md - dmenu Tasks\nCLAUDE.md - Development Guide\nAlias Reference\nKeyboard Shortcuts\nWeb Services URLs\nWorkflow Patterns" | dmenu $DMENU_OPTS -p "📚 Reference:")
case "$choice" in
"MILHY777.md - Personal Guide")
kate /home/milhy777/MILHY777.md &
;;
"FUT-TASKLIST.md - dmenu Tasks")
kate /home/milhy777/FUT-TASKLIST.md &
;;
"CLAUDE.md - Development Guide")
kate /home/milhy777/Develop/CLAUDE.md &
;;
"Alias Reference")
konsole --noclose -e sh -c 'grep -E "^alias" /home/milhy777/.shell_common | head -20; echo "...and more"; read' &
;;
"Keyboard Shortcuts")
konsole --noclose -e sh -c 'echo "Tmux: Ctrl+a (prefix)"; echo "VS Code: Ctrl+Shift+P (palette)"; echo "KDE: Meta+T (terminal)"; read' &
;;
"Web Services URLs")
konsole --noclose -e sh -c 'echo "HAS: http://192.168.0.58:8123"; echo "LLMS: http://192.168.0.41:8080"; echo "Aspire: http://192.168.0.10:8000"; read' &
;;
"Workflow Patterns")
konsole --noclose -e sh -c 'echo "Development: claude-dev + code-insiders"; echo "Monitoring: syswatch + tmux-sys"; echo "Remote: HAS + LLMS + session-manager"; read' &
;;
esac
}
# Main menu
main_menu() {
local categories_list=""
for category in "${!CATEGORIES[@]}"; do
categories_list+="$category\n"
done
local choice=$(echo -e "$categories_list" | dmenu $DMENU_OPTS -p "🚀 milhy777 Launcher:")
case "$choice" in
"🖥️ 3-PC Servers")
servers
;;
"🤖 AI Tools")
ai_tools
;;
"🌐 Web Services")
web_services
;;
"📊 Monitoring")
monitoring_tools
;;
"⚡ Quick Actions")
quick_actions
;;
"🔒 Vault (Secured)")
vault_access
;;
"📚 Reference")
reference_guide
;;
esac
}
# Check dependencies
check_dependencies() {
local missing_deps=()
if ! command -v dmenu >/dev/null 2>&1; then
missing_deps+=("dmenu")
fi
if ! command -v konsole >/dev/null 2>&1; then
missing_deps+=("konsole")
fi
if [ ${#missing_deps[@]} -gt 0 ]; then
echo "Missing dependencies: ${missing_deps[*]}"
echo "Install with: sudo apt install ${missing_deps[*]}"
exit 1
fi
}
# Main execution
main() {
check_dependencies
main_menu
}
# Handle script arguments
case "${1:-main}" in
"ai")
ai_tools
;;
"web")
web_services
;;
"monitor")
monitoring_tools
;;
"quick")
quick_actions
;;
"vault")
vault_access
;;
"reference")
reference_guide
;;
*)
main
;;
esac