From 8eda746645a606742f59c71a8f07787d112a2932 Mon Sep 17 00:00:00 2001 From: hhhh hgfh Date: Sun, 12 Oct 2025 18:27:49 +0300 Subject: [PATCH] feat: add waybar settings --- waybar/.catppuccin.yaml | 26 ++++++++ waybar/config.jsonc | 132 ++++++++++++++++++++++++++++++++++++++++ waybar/style.css | 109 +++++++++++++++++++++++++++++++++ 3 files changed, 267 insertions(+) create mode 100644 waybar/.catppuccin.yaml create mode 100644 waybar/config.jsonc create mode 100644 waybar/style.css diff --git a/waybar/.catppuccin.yaml b/waybar/.catppuccin.yaml new file mode 100644 index 0000000..0b1a5a0 --- /dev/null +++ b/waybar/.catppuccin.yaml @@ -0,0 +1,26 @@ +# A catppuccin RC for waybar. In beta, specs may change. +app_name: waybar +binary_name: waybar +installation: + location: + macos: %appdata%/waybar/ + linux: %appdata%/waybar/ + flavours: + all: + default: + - themes/ + latte: + default: + - themes/latte.css + frappe: + default: + - themes/frappe.css + macchiato: + default: + - themes/macchiato.css + mocha: + default: + - themes/mocha.css + to: ./ + one_flavour: false + comments: "Add `@import \"$HOME/.config/waybar/.css\";` to include the file in your style.css" diff --git a/waybar/config.jsonc b/waybar/config.jsonc new file mode 100644 index 0000000..327c7fc --- /dev/null +++ b/waybar/config.jsonc @@ -0,0 +1,132 @@ +{ + "layer": "top", + "position": "top", + "height": 32, + "spacing": 0, + "modules-left": [ + "hyprland/workspaces", + "custom/lock", + "custom/reboot", + "custom/power" + ], + "modules-right": [ + "network", + "battery", + "bluetooth", + "pulseaudio", + "backlight", + "custom/temperature", + "memory", + "cpu", + "clock" + ], + "hyprland/workspaces": { + "disable-scroll": false, + "all-outputs": true, + "format": "{icon}", + "on-click": "activate", + "persistent-workspaces": { + "*":[1,2,3,4] + }, + "format-icons": { + "1": "󰣇", + "2": "󰈹", + "3": "", + "default": "" + } + }, + "custom/lock": { + "format": "", + "on-click": "hyprlock", + "tooltip": true, + "tooltip-format": "Lock" + }, + "custom/reboot": { + "format": "", + "on-click": "systemctl reboot", + "tooltip": true, + "tooltip-format": "Reload" + }, + "custom/power": { + "format": "", + "on-click": "systemctl poweroff", + "tooltip": true, + "tooltip-format": "Shutdown" + }, + "network": { + "format-wifi": " 󰤨 {essid} ", + "format-ethernet": "Wired ", + "tooltip-format": " 󰅧 {bandwidthUpBytes} 󰅢 {bandwidthDownBytes}", + "format-linked": " 󱘖 {ifname} (No IP) ", + "format-disconnected": "Disconnected ", + "format-alt": " 󰤨 {signalStrength}% ", + "interval": 1 + }, + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "format": " {icon} {capacity}% ", + "format-charging": " 󱐋{capacity}%", + "interval": 1, + "format-icons": ["󰂎", "󰁼", "󰁿", "󰂁", "󰁹"], + "tooltip": true + }, + "pulseaudio": { + "format": "{icon}{volume}% ", + "format-muted": " 󰖁 0% ", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": [ + "", + "", + "" + ] + }, + "on-click-right": "pavucontrol -t 3", + "on-click": "pactl -- set-sink-mute 0 toggle", + "tooltip": true, + "tooltip-format": "Volume: {volume}%" + }, + "custom/temperature": { + "exec": "sensors | awk '/^Package id 0:/ {print int($4)}'", + "format": "{}°C ", + "interval": 5, + "tooltip": true, + "tooltip-format": "CPU temperature: {}°C" + }, + "memory": { + "format": "{used:0.1f}G/{total:0.1f}G ", + "tooltip": true, + "tooltip-format": "memory used: {used:0.2f}G/{total:0.2f}G" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": true + }, + "clock": { + "interval": 1, + "timezone": "Asia/Chengdu", + "format": "{:%H:%M} ", + "tooltip": true, + "tooltip-format": "{:L%Y y %m m %d d, %A}" + }, + "backlight": { + "device": "intel_backlight", + "format": "{icon}{percent}% ", + "tooltip": true, + "tooltip-format": "backlight: {percent}%", + "format-icons": [ + " 󰃞 ", // 暗 - 深灰 + " 󰃝 ", // 中 - 灰 + " 󰃟 ", // 亮 - 柠檬黄 + " 󰃠 " // 最亮 - 金色 + ] + } +} diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..0837726 --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,109 @@ +* { + font-family: "CaskaydiaCove Nerd Font", "Font Awesome 6 Free", "Font Awesome 6 Free Solid"; + font-weight: bold; + font-size: 16px; + color: #dcdfe1; +} + +#waybar { + background-color: rgba(0, 0, 0, 0); + border: none; + box-shadow: none; +} + +#workspaces, +#window, +#tray{ + background-color: rgba(15,27,53,0.9); + padding: 4px 6px; + margin-top: 6px; + margin-left: 6px; + margin-right: 6px; + border-radius: 10px; + border-width: 0px; +} + +#clock, +#custom-power{ + background-color: rgba(15,27,53,0.9); + margin-top: 6px; + margin-right: 6px; + padding: 4px 2px; + border-radius: 0 10px 10px 0; + border-width: 0px; +} + +#network, +#custom-lock{ + background-color: rgba(15,27,53,0.9); + margin-top: 6px; + margin-left: 6px; + padding: 4px 2px; + border-radius: 10px 0 0 10px; + border-width: 0px; +} + +#custom-reboot, +#bluetooth, +#battery, +#pulseaudio, +#backlight, +#custom-temperature, +#memory, +#cpu{ + background-color: rgba(15,27,53,0.9); + margin-top: 6px; + padding: 4px 2px; + border-width: 0px; +} + +#custpm-temperature.critical, +#pulseaudio.muted { + color: #FF0000; + padding-top: 0; +} + +#bluetooth:hover, +#network:hover, +#backlight:hover, +#battery:hover, +#pulseaudio:hover, +#custom-temperature:hover, +#memory:hover, +#cpu:hover, +#clock:hover, +#custom-lock:hover, +#custom-reboot:hover, +#custom-power:hover, +#window:hover { + background-color: rgba(70, 75, 90, 0.9); +} + +#workspaces button:hover{ + background-color: rgba(97, 175, 239, 0.2); + padding: 2px 8px; + margin: 0 2px; + border-radius: 10px; +} + +#workspaces button.active { + background-color: #61afef; + color: #ffffff; + padding: 2px 8px; + margin: 0 2px; + border-radius: 10px; +} + +#workspaces button { + background: transparent; + border: none; + color: #888888; + padding: 2px 8px; + margin: 0 2px; + font-weight: bold; +} + +#window { + font-weight: 500; + font-style: italic; +}