diff --git a/dmenu-launcher.sh b/dmenu-launcher.sh index ea9de6a..bf74184 100755 --- a/dmenu-launcher.sh +++ b/dmenu-launcher.sh @@ -5,8 +5,10 @@ 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="-i -l 20 -fn 'JetBrains Mono-12' -nb '#1e1e1e' -nf '#d4d4d4' -sb '#007acc' -sf '#ffffff'" +DMENU_OPTS="-f -i -l 20 -fn 'JetBrains Mono-12' -nb '#1e1e1e' -nf '#d4d4d4' -sb '#007acc' -sf '#ffffff'" # Main categories declare -A CATEGORIES=( @@ -25,13 +27,13 @@ servers() { case "$choice" in "๐Ÿ  HAS - Home Automation Server") - konsole -e ssh root@Home-Automation-Server & + konsole -e ssh $SSH_OPTS root@Home-Automation-Server & ;; "๐Ÿง  LLMS - LLM Server") - konsole -e ssh milhy777@192.168.0.41 & + konsole -e ssh $SSH_OPTS milhy777@192.168.0.41 & ;; "๐Ÿ’ป Aspire - Main Workstation") - konsole -e ssh milhy777@192.168.0.10 & + 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" & @@ -40,10 +42,10 @@ servers() { 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 milhy777@192.168.0.41 '~/tmux-autostart.sh'; ssh root@Home-Automation-Server '~/tmux-autostart.sh'; echo 'Done!'; read" & + 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 milhy777@192.168.0.41 '~/system_monitor.sh compact' 2>/dev/null || echo 'Offline'; echo 'HAS:'; ssh root@Home-Automation-Server '~/system_monitor.sh compact' 2>/dev/null || echo 'Offline'; echo; echo 'Press Ctrl+C to exit'; sleep 3; done" & + 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 } @@ -107,7 +109,7 @@ web_services() { firefox --new-tab "http://192.168.0.41:11434" & ;; "LLMS - Shared Folder") - llms-mount && dolphin /mnt/llms & + timeout 5s llms-mount && dolphin /mnt/llms & ;; "Aspire - Dev Server (8000)") firefox --new-tab "http://192.168.0.10:8000" & @@ -136,7 +138,7 @@ monitoring_tools() { konsole --noclose -e watch -n 1 'sensors | grep -E "Core|temp"' & ;; "CPU Info") - konsole --noclose -e sh -c 'cat /proc/cpuinfo | grep -E "model name|cpu MHz|cache size" | head -6; read' & + konsole --noclose -e sh -c 'grep -E -m 6 "model name|cpu MHz|cache size" /proc/cpuinfo; read' & ;; "Tmux Monitor Session") tmux-sys @@ -247,7 +249,7 @@ reference_guide() { kate /home/milhy777/Develop/CLAUDE.md & ;; "Alias Reference") - konsole --noclose -e sh -c 'cat /home/milhy777/.shell_common | grep "^alias" | head -20; echo "...and more"; read' & + 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' & diff --git a/install-monitoring-tools.sh b/install-monitoring-tools.sh index 2a37032..0bf5947 100755 --- a/install-monitoring-tools.sh +++ b/install-monitoring-tools.sh @@ -5,6 +5,8 @@ set -euo pipefail +export DEBIAN_FRONTEND=noninteractive + # Colors RED='\033[0;31m' GREEN='\033[0;32m' @@ -23,12 +25,12 @@ fi # Update package list echo -e "${YELLOW}๐Ÿ“‹ Updating package list...${NC}" -sudo apt update +sudo apt-get update -y -o Acquire::Retries=2 # Install iotop (I/O monitoring) echo -e "${YELLOW}๐Ÿ“Š Installing iotop (I/O monitoring)...${NC}" if ! command -v iotop >/dev/null 2>&1; then - sudo apt install -y iotop + sudo apt-get install -y iotop echo -e "${GREEN}โœ… iotop installed${NC}" else echo -e "${GREEN}โœ… iotop already installed${NC}" @@ -37,7 +39,7 @@ fi # Install nethogs (network monitoring per process) echo -e "${YELLOW}๐ŸŒ Installing nethogs (network monitoring)...${NC}" if ! command -v nethogs >/dev/null 2>&1; then - sudo apt install -y nethogs + sudo apt-get install -y nethogs echo -e "${GREEN}โœ… nethogs installed${NC}" else echo -e "${GREEN}โœ… nethogs already installed${NC}" @@ -53,11 +55,11 @@ if ! command -v btop >/dev/null 2>&1; then else # Fallback to apt (if available) echo "Installing btop via apt..." - sudo apt install -y btop 2>/dev/null || { + sudo apt-get install -y btop 2>/dev/null || { echo -e "${YELLOW}btop not available in apt, building from source...${NC}" # Install dependencies for building - sudo apt install -y build-essential git cmake + sudo apt-get install -y build-essential git cmake # Clone and build btop cd /tmp @@ -77,7 +79,7 @@ fi # Install dmenu if not present echo -e "${YELLOW}๐Ÿ“‹ Installing dmenu...${NC}" if ! command -v dmenu >/dev/null 2>&1; then - sudo apt install -y dmenu + sudo apt-get install -y dmenu echo -e "${GREEN}โœ… dmenu installed${NC}" else echo -e "${GREEN}โœ… dmenu already installed${NC}" @@ -86,7 +88,7 @@ fi # Install python3-keyring for vault functionality echo -e "${YELLOW}๐Ÿ”’ Installing python3-keyring...${NC}" if ! python3 -c "import keyring" 2>/dev/null; then - sudo apt install -y python3-keyring + sudo apt-get install -y python3-keyring echo -e "${GREEN}โœ… python3-keyring installed${NC}" else echo -e "${GREEN}โœ… python3-keyring already installed${NC}" @@ -114,7 +116,7 @@ fi echo -e "${BLUE}๐Ÿงช Testing installations...${NC}" echo -n "iotop: " -if iotop --version >/dev/null 2>&1; then +if command -v iotop >/dev/null 2>&1; then echo -e "${GREEN}โœ… Working${NC}" else echo -e "${RED}โŒ Failed${NC}"