added files

This commit is contained in:
2025-07-12 11:31:54 +02:00
parent c8b5f931f9
commit 3eb06362a9
27 changed files with 1641 additions and 1 deletions

Submodule waybar/catppuccin-waybar added at ee8ed32b4f

77
waybar/config.jsonc Normal file
View File

@@ -0,0 +1,77 @@
// ~/.config/waybar/config.jsonc
{
"layer": "top",
"position": "top",
"height": 35,
"modules-left": ["hyprland/workspaces", "hyprland/window"],
"modules-center": ["clock"],
"modules-right": ["tray", "pulseaudio", "network", "cpu", "memory", "custom/tlp", "battery", "custom/power"],
"hyprland/workspaces": {
"format": "{icon}",
"on-click": "activate"
},
"hyprland/window": {
"format": "{}",
"max-length": 35
},
"clock": {
"format": "{:%I:%M %p}",
"format-alt": "{:%a, %b %d}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"cpu": {
"format": "CPU:{usage}%",
"tooltip": true
},
"memory": {
"format": "MEM:{}%"
},
"network": {
"format-wifi": "{essid} ({signalStrength}): {ipaddr}",
"format-ethernet": "{ifname}: {ipaddr}",
"format-disconnected": "Disconnected",
"tooltip-format": "{ifname} via {gwaddr}",
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-muted": " Muted",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
},
"tray": {
"icon-size": 18,
"spacing": 10
},
"custom/power": {
"format": "",
"tooltip": false,
"on-click": "~/.config/hypr/scripts/powermenu.sh"
},
"custom/tlp": {
"format": "{}",
"exec": "~/.config/waybar/scripts/tlp-profile.sh",
"return-type": "json",
"interval": 10
},
"battery": {
"states": {
"warning": 30,
"critical": 15
},
"format": "{capacity}%",
"format-charging": "{capacity}%",
"format-plugged": "{capacity}%",
"format-alt": "{time} {icon}",
"format-full": "{capacity}%",
"format-icons": ["", "", "", "", ""]
},
}

2
waybar/scripts/power.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
wlogout -p layer-shell

24
waybar/scripts/tlp-profile.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Get the current power source from tlp-stat
power_source=$(tlp-stat -s | grep -i "power source" | awk '{print $4}')
if [ "$power_source" == "AC" ]; then
# On AC power
icon=""
tooltip="TLP Profile: AC"
class="ac"
elif [ "$power_source" == "battery" ]; then
# On Battery power
icon=""
tooltip="TLP Profile: Battery"
class="bat"
else
# Fallback for unknown state
icon=""
tooltip="TLP Profile: Unknown"
class="unknown"
fi
# Output in JSON format for Waybar
printf '{"text": "%s", "tooltip": "%s", "class": "%s"}\n' "$icon" "$tooltip" "$class"

81
waybar/style.css Normal file
View File

@@ -0,0 +1,81 @@
/* ~/.config/waybar/style.css */
@import "./catppuccin-waybar/themes/mocha.css";
* {
font-family: "0xProto Nerd Font", FontAwesome, sans-serif;
font-size: 14px;
padding: 0 5px;
}
window#waybar {
background-color: alpha(@base, 0.9);
border-bottom: 3px solid @mauve;
color: @text;
}
#workspaces {
margin-bottom: 5px;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: @surface2;
}
#workspaces button.active {
color: @mauve;
border-bottom: 3px solid @pink;
}
#workspaces button:hover {
background: @surface0;
box-shadow: inherit;
text-shadow: inherit;
}
#custom-power {
color: @red;
padding: 0 10px;
}
#custom-tlp {
padding: 0 10px;
}
#custom-tlp.ac {
color: @green; /* Catppuccin Green for AC power */
}
#custom-tlp.bat {
color: @yellow; /* Catppuccin Yellow for Battery power */
}
#battery {
color: @text;
padding: 0 10px;
padding-left: 0;
}
#battery.charging, #battery.plugged {
color: @green;
}
#battery.warning {
color: @yellow;
}
#battery.critical {
color: @red;
animation-name: blink;
animation-duration: 0.8s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes blink {
to {
color: @text;
}
}