commit 343af5e9d22f8df222cfedb1f4b6a313f90510ba Author: Pepe44DEV Date: Tue Mar 17 00:32:42 2026 +0100 Inital Comit Upload Config Files diff --git a/config.jsonc b/config.jsonc new file mode 100644 index 0000000..06d3969 --- /dev/null +++ b/config.jsonc @@ -0,0 +1,92 @@ +{ + "layer": "top", + "position": "top", + "height": 42, + "spacing": 6, + + "modules-left": [ + "hyprland/workspaces" + ], + + "modules-center": [ + "clock" + ], + + "modules-right": [ + "pulseaudio", + "network", + "custom/serverstatus", + "cpu", + "memory", + "temperature", + "tray", + "custom/notifications" + ], + + "hyprland/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{name}" + }, + + "clock": { + "format": " {:%H:%M}", + "tooltip-format": " {:%A, %d. %B %Y}" + }, + + "cpu": { + "format": " {usage}%", + "tooltip": true + }, + + "memory": { + "format": " {}%", + "tooltip": true + }, + + "temperature": { + "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + "format": " {temperatureC}°C", + "format-critical": " {temperatureC}°C", + "tooltip": true + }, + + "network": { + "format-wifi": " {signalStrength}%", + "format-ethernet": "󰈀 Ethernet", + "format-disconnected": "󰖪 Offline", + "tooltip-format-wifi": "{essid} ({signalStrength}%)", + "tooltip-format-ethernet": "Kabel verbunden", + "tooltip-format-disconnected": "Keine Verbindung" + }, + + "pulseaudio": { + "format": "{icon} {volume}%", + "format-muted": " muted", + "format-icons": { + "default": ["", "", ""] + } + }, + + "tray": { + "icon-size": 16, + "spacing": 8 + }, + + "custom/notifications": { + "exec": "~/.config/waybar/scripts/notifications.sh", + "interval": 2, + "return-type": "json", + "on-click": "swaync-client -t", + "escape": true + }, + + "custom/serverstatus": { + "exec": "/home/pascal/.config/waybar/scripts/server-status.sh", + "interval": 10, + "return-type": "json", + "tooltip": true, + "on-click": "bash /home/pascal/.config/hypr/scripts/homelab/homelab-menu.sh" + } +} \ No newline at end of file diff --git a/scripts/notifications.sh b/scripts/notifications.sh new file mode 100755 index 0000000..a196d8a --- /dev/null +++ b/scripts/notifications.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +count=$(swaync-client -c) + +if [ "$count" -eq 0 ]; then + echo '{"text":"󰂚","class":"none"}' +else + echo "{\"text\":\"󰂚 $count\",\"class\":\"notification\"}" +fi diff --git a/scripts/server-status.sh b/scripts/server-status.sh new file mode 100755 index 0000000..569e8db --- /dev/null +++ b/scripts/server-status.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +SERVER="10.0.0.15" +SSH_TARGET="root@$SERVER" + +if ping -c 1 -W 1 "$SERVER" >/dev/null 2>&1; then + + STATS=$(ssh -o ConnectTimeout=2 -o BatchMode=yes "$SSH_TARGET" ' + +CPU=$(top -bn1 | grep "Cpu(s)" | awk "{print int(\$2+\$4)}") + +RAM=$(free | awk "/Mem:/ {printf \"%.0f\", (\$3/\$2)*100}") + +DISK=$(df / | awk "NR==2 {gsub(\"%\",\"\",\$5); print \$5}") + +LOAD=$(cut -d " " -f1 /proc/loadavg) + +UPTIME=$(uptime -p | sed "s/up //") + +TEMP=$(cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null | awk "{printf \"%.0f\", \$1/1000}") + +DOCKER=$(docker ps -q 2>/dev/null | wc -l) + +printf "CPU: %3s%%\nRAM: %3s%%\nDisk: %3s%%\nLoad: %s\nUp: %s\nTemp: %s°C\nDocker: %s running" \ +"$CPU" "$RAM" "$DISK" "$LOAD" "$UPTIME" "$TEMP" "$DOCKER" + +' 2>/dev/null) + + if [ -n "$STATS" ]; then + TEXT="󰒋" + CLASS="online" + TOOLTIP=$(printf "PDEV Server (%s)\n\n%s" "$SERVER" "$STATS") + else + TEXT="󰒋" + CLASS="warning" + TOOLTIP=$(printf "Server erreichbar\nSSH Verbindung fehlgeschlagen") + fi + +else + TEXT="󰒋" + CLASS="offline" + TOOLTIP="Server offline" +fi + +jq -cn \ + --arg text "$TEXT" \ + --arg tooltip "$TOOLTIP" \ + --arg class "$CLASS" \ + '{text:$text, tooltip:$tooltip, class:$class}' \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..1e14fe2 --- /dev/null +++ b/style.css @@ -0,0 +1,172 @@ +* { + border: none; + border-radius: 0; + font-family: "JetBrainsMono Nerd Font"; + font-size: 13px; + min-height: 0; +} + +window#waybar { + background: transparent; + color: #d8ffe9; +} + +/* ---- Gesamte Bar ---- */ +window#waybar > box { + margin: 8px 12px 0 12px; +} + +/* ---- Tooltip ---- */ +tooltip { + background: rgba(15, 15, 20, 0.95); + border: 1px solid #00ff88; + border-radius: 10px; +} + +tooltip label { + color: #d8ffe9; + padding: 4px; +} + +/* ---- Workspaces ---- */ +#workspaces { + background: rgba(15, 15, 20, 0.88); + border: 1px solid rgba(0, 255, 136, 0.35); + border-radius: 14px; + padding: 4px 6px; + margin: 0 8px 0 0; + box-shadow: 0 0 10px rgba(0, 255, 136, 0.08); +} + +#workspaces button { + padding: 0 12px; + margin: 0 4px; + border-radius: 10px; + color: #8be9b3; + background: transparent; + transition: all 0.2s ease; +} + +#workspaces button:hover { + background: rgba(0, 255, 136, 0.12); + color: #d8ffe9; + box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.18); +} + +#workspaces button.active { + background: linear-gradient(90deg, #00cc66, #00994d); + color: #ffffff; + box-shadow: 0 0 10px rgba(0, 255, 136, 0.25); +} + +#workspaces button.urgent { + background: rgba(255, 80, 80, 0.18); + color: #ffb3b3; +} + +/* ---- Gemeinsamer Modulstil ---- */ +#clock, +#pulseaudio, +#network, +#cpu, +#memory, +#temperature, +#custom-serverstatus, +#tray { + background: rgba(15, 15, 20, 0.88); + color: #d8ffe9; + border: 1px solid rgba(0, 255, 136, 0.28); + border-radius: 14px; + padding: 0 14px; + margin: 0 6px; + min-height: 30px; + box-shadow: 0 0 10px rgba(0, 255, 136, 0.06); +} + +/* ---- Clock etwas hervorheben ---- */ +#clock { + padding: 0 18px; + font-weight: bold; + color: #ffffff; + border: 1px solid rgba(0, 255, 136, 0.45); + box-shadow: 0 0 12px rgba(0, 255, 136, 0.12); +} + +/* ---- Hover für Module ---- */ +#pulseaudio:hover, +#network:hover, +#cpu:hover, +#memory:hover, +#temperature:hover, +#clock:hover, +#custom-serverstatus:hover, +#tray:hover { + background: rgba(25, 25, 32, 0.96); + border-color: rgba(0, 255, 136, 0.55); +} + +/* ---- Spezielle Zustände ---- */ +#network.disconnected { + color: #ff8f8f; + border-color: rgba(255, 100, 100, 0.35); +} + +#pulseaudio.muted { + color: #c7c7c7; + opacity: 0.75; +} + +/* ---- Tray ---- */ +#tray { + padding: 0 10px; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background: rgba(255, 80, 80, 0.15); + border-radius: 10px; +} + +#temperature.critical { + color: #ff5555; + border-color: rgba(255, 80, 80, 0.5); +} + +#custom-notifications { + background: rgba(15, 15, 20, 0.88); + color: #d8ffe9; + border: 1px solid rgba(0, 255, 136, 0.28); + border-radius: 14px; + padding: 0 14px; + margin: 0 6px; + min-height: 30px; + box-shadow: 0 0 10px rgba(0, 255, 136, 0.06); +} + +#custom-notifications.notification { + color: #00ff88; + border-color: rgba(0, 255, 136, 0.5); +} + +#custom-notifications.none { + color: #b8d8c5; +} + +#custom-serverstatus.online { + color: #00ff88; + border-color: rgba(0, 255, 136, 0.45); +} + +#custom-serverstatus.warning { + color: #ffd166; + border-color: rgba(255, 209, 102, 0.45); +} + +#custom-serverstatus.offline { + color: #ff8f8f; + border-color: rgba(255, 100, 100, 0.35); +} \ No newline at end of file