From 39286050b61b414ac00ce63c86caa5cddcd48e74 Mon Sep 17 00:00:00 2001 From: tomoron Date: Thu, 24 Oct 2024 02:23:20 +0200 Subject: [PATCH] waybar config is now aproximatively the same as polybar. ready set waybar's config file declaratively in nix-home. add playerctl --- dotfiles/config/waybar/config | 73 +++++++++++++++++++++----------- dotfiles/config/waybar/style.css | 4 ++ home.nix | 3 +- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/dotfiles/config/waybar/config b/dotfiles/config/waybar/config index 6d8c67b..d22ff31 100644 --- a/dotfiles/config/waybar/config +++ b/dotfiles/config/waybar/config @@ -6,37 +6,29 @@ // Choose the order of the modules "margin-left":5, "margin-right":5, - "output":"eDP-1", "modules-left": ["hyprland/workspaces", "custom/music"], "modules-center": ["hyprland/window"], - "modules-right": ["pulseaudio", "network", "cpu", "memory", "battery", "clock"], + "modules-right": ["custom/fans", "custom/dgpu", "disk", "pulseaudio", "network", "cpu", "temperature", "custom/pipe", "memory", "battery", "clock"], "hyprland/workspaces": { "disable-scroll": true, "all-outputs": false, - "format": "{icon}", - "format-icons": { - "1:1": "1", - "2:2": "2", - "3:3": "3", - "4:4": "4", - "5:5": "5", - "6:6": "6", - } + "format": "{id}" }, - "clock": { - "interval" : 1, - "format-alt": "{:%Y-%m-%d}", - "format" : "{:%H:%M:%S}" + "clock": { "interval" : 1, + "format-alt": " {:%Y-%m-%d}", + "format" : " {:%H:%M:%S}" }, "cpu": { - "format": "{usage}%  |" + "format": "  {usage}% |", + "interval":5 }, "memory": { - "format": "{}%  |" + "format": "  {}% |", + "interval":5 }, "battery": { @@ -47,7 +39,7 @@ "critical": 15 }, "format-time": " {H}:{m}", - "format": "{icon}{capacity}%{time}|", + "format": " {icon} {capacity}%{time} |", // "format-good": "", // An empty format will hide the module // "format-full": "", "format-icons": [" ", " ", " ", " ", " "], @@ -55,14 +47,15 @@ }, "network": { // "interface": "wlp2s0", // (Optional) To force the use of this interface - "format-wifi": "{essid} ({signalStrength}%)  |", - "format-ethernet": "{ifname}: {ipaddr}/{cidr}  |", - "format-disconnected": "Disconnected ⚠|" + "format-wifi": " {icon} {essid} |", + "format-ethernet": "  {ifname}: {ipaddr}/{cidr} |", + "format-disconnected": " ⚠ Disconnected |", + "format-icons":["󰤟 ", "󰤢 ", "󰤥 ", "󰤨 "] }, "pulseaudio": { //"scroll-step": 1, - "format": "{volume}% {icon}|", - "format-bluetooth": "{volume}% {icon}|", + "format": " {icon}{volume}% |", + "format-bluetooth": "  {icon} {volume}% |", "format-muted": "", "format-icons": { "headphones": " ", @@ -71,8 +64,40 @@ "phone": " ", "portable": " ", "car": " ", - "default": [" ", " "] + "default": [" ", " ", " "] }, "on-click": "pavucontrol" }, + "temperature":{ + "thermal-zone":0, + "critical-threshold":80, + "interval":5, + "format":" {icon} {temperatureC}°C ", + "format-icons": ["", "", "", "", ""] + }, + "disk":{ + "format":" 󰋊 {percentage_used}% |" + }, + "custom/pipe":{ + "format":"|" + }, + + "custom/music":{ + "exec-if" : "playerctl metadata 2>&1 >/dev/null", + "exec" : "playerctl metadata --format ' {{ artist }} - {{title}}'", + "interval" : 1, + "interval-if" : 5 + }, + "custom/dgpu":{ + "exec-if" : "test \"$(supergfxctl -g)\" = \"Hybrid\"", + "exec" : "echo \"  on |\"", + "interval-if" : 10, + "interval":100 + }, + "custom/fans":{ + "exec-if" : "test \"$(cat /sys/class/hwmon/hwmon6/fan1_input)\" -gt 0 -o \"$(cat /sys/class/hwmon/hwmon6/fan2_input)\" -gt 0", + "exec" : "echo \" \" \"$(cat /sys/class/hwmon/hwmon6/fan1_input).$(cat /sys/class/hwmon/hwmon6/fan2_input) |\"", + "interval" : 1, + "interval-if" : 1 + } } diff --git a/dotfiles/config/waybar/style.css b/dotfiles/config/waybar/style.css index e523554..3d98bff 100644 --- a/dotfiles/config/waybar/style.css +++ b/dotfiles/config/waybar/style.css @@ -74,3 +74,7 @@ window#waybar { color: #f53c3c; font-weight:bold; } + +#temperature.critical { + color: #ff2222; +} diff --git a/home.nix b/home.nix index 85260fb..2ce8b3c 100644 --- a/home.nix +++ b/home.nix @@ -6,7 +6,7 @@ # By: tomoron +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2024/10/17 18:15:38 by tomoron #+# #+# # -# Updated: 2024/10/24 01:22:24 by tomoron ### ########.fr # +# Updated: 2024/10/24 02:09:16 by tomoron ### ########.fr # # # # **************************************************************************** # @@ -43,6 +43,7 @@ wofi waybar brightnessctl + playerctl swaybg ];