From 7bed37eb365394213562a243018013a05708ca78 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Thu, 13 Nov 2025 09:05:14 +0100 Subject: [PATCH] Temp, no gather in firefox --- hyprland.conf | 2 +- hyprscript | 11 +++++++++++ waybar/config | 7 ++++++- waybar/style.css | 6 +++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/hyprland.conf b/hyprland.conf index a66627e..8586ac6 100644 --- a/hyprland.conf +++ b/hyprland.conf @@ -239,7 +239,7 @@ bind = $mainMod CTRL, R, exec, $hyprscript reload bind = $mainMod SHIFT, Q, exec, hyprctl dispatch exit bind = $mainMod, Z, exec, $social -bind = $mainMod, E, exec, firefox "-P" "Yuzzit" "https://mail.google.com/mail/u/0/" "https://app.slack.com/client/T03UFFGJK/D07KS0S1LDT" "https://app.gather.town/app/bZRkf3gh7MIximOa/ytopenspace" "https://yip.atlassian.net/wiki/spaces/Y/overview" "https://yip.atlassian.net/" +bind = $mainMod, E, exec, firefox "-P" "Yuzzit" "https://app.slack.com/client/T03UFFGJK/D07KS0S1LDT" "https://yip.atlassian.net/wiki/spaces/Y/overview" "https://yip.atlassian.net/" bind = $mainMod, C, exec, alacritty -e numbat bind = $mainMod, P, exec, pavucontrol diff --git a/hyprscript b/hyprscript index 0f89a24..52361a3 100755 --- a/hyprscript +++ b/hyprscript @@ -200,18 +200,28 @@ def monitor_stats(): cpu_values = [0] * 10 mem_values = [0] * 10 + temp_values = [0] * 10 + + min_temp = 45 + max_temp = 90 while True: cpu_percent = psutil.cpu_percent(interval=2) mem_percent = psutil.virtual_memory().percent battery = psutil.sensors_battery() + temps = psutil.sensors_temperatures(fahrenheit=False).get('k10temp') + temp = max([x.current for x in temps if x.label != 'Tctl']) + + temp_percent = 100 * min(max([temp - min_temp, 0]) / (max_temp - min_temp), 1) for i in range(len(cpu_values) - 1): cpu_values[i] = cpu_values[i+1] mem_values[i] = mem_values[i+1] + temp_values[i] = temp_values[i+1] cpu_values[-1] = cpu_percent mem_values[-1] = mem_percent + temp_values[-1] = temp_percent if battery is None: battery_json = '{"text": "", "class": "hidden"}' @@ -235,6 +245,7 @@ def monitor_stats(): f.write( ' ' + ''.join([to_bar(x) for x in cpu_values]) + ' ' + "% 5.1f" % cpu_percent + '%\n' + ' ' + ''.join([to_bar(x) for x in mem_values]) + ' ' + "% 5.1f" % mem_percent + '%\n' + + '  ' + ''.join([to_bar(x) for x in temp_values]) + ' ' + "% 5.1f" % temp + '°\n' + battery_json ) diff --git a/waybar/config b/waybar/config index 4b75fa1..b8febec 100644 --- a/waybar/config +++ b/waybar/config @@ -17,6 +17,7 @@ ], "modules-right": [ "hyprland/workspaces", + "custom/temp", "custom/cpu", "custom/mem", "custom/battery", @@ -158,8 +159,12 @@ "exec": "sed '2q;d' ~/.config/hypr/.stat.txt", "restart-interval": 2 }, - "custom/battery": { + "custom/temp": { "exec": "sed '3q;d' ~/.config/hypr/.stat.txt", + "restart-interval": 2 + }, + "custom/battery": { + "exec": "sed '4q;d' ~/.config/hypr/.stat.txt", "return-type": "json", "restart-interval": 2 } diff --git a/waybar/style.css b/waybar/style.css index e3eaed2..550b7b1 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -99,8 +99,12 @@ button:hover { padding: 0 10px; } +#custom-temp { + color: @red; +} + #custom-cpu { - color: @red; + color: @green; } #custom-mem {