Temp, no gather in firefox

This commit is contained in:
Thomas Forgione 2025-11-13 09:05:14 +01:00
parent 52683079ef
commit 7bed37eb36
4 changed files with 23 additions and 3 deletions

View File

@ -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

View File

@ -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
)

View File

@ -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
}

View File

@ -99,10 +99,14 @@ button:hover {
padding: 0 10px;
}
#custom-cpu {
#custom-temp {
color: @red;
}
#custom-cpu {
color: @green;
}
#custom-mem {
color: @blue;
}