Enhanced waybar

Switched back from tlp to asusd
This commit is contained in:
GaspardCulis 2023-10-19 13:32:23 +02:00
parent 4f545de7ef
commit 234db0eb0d
3 changed files with 149 additions and 89 deletions

View file

@ -6,17 +6,18 @@
"passthrough": false, "passthrough": false,
"gtk-layer-shell": true, "gtk-layer-shell": true,
"height": 50, "height": 50,
"modules-left": ["clock","custom/weather","wlr/workspaces"], "modules-left": ["clock","custom/weather","hyprland/workspaces"],
"modules-center": ["hyprland/window"], "modules-center": ["hyprland/window"],
"modules-right": ["network", "bluetooth", "temperature","custom/power_profile","battery","pulseaudio","pulseaudio#microphone","tray"], "modules-right": ["network", "bluetooth", "memory", "cpu", "temperature","custom/power_profile","battery","pulseaudio","pulseaudio#microphone","tray"],
"hyprland/window": { "hyprland/window": {
"format": "{}" "format": "{}"
}, },
"wlr/workspaces": { "hyprland/workspaces": {
"disable-scroll": true, "disable-scroll": true,
"all-outputs": true, "all-outputs": true,
"on-click": "activate", "on-click": "activate",
/*
"persistent_workspaces": { "persistent_workspaces": {
"1": [], "1": [],
"2": [], "2": [],
@ -28,14 +29,16 @@
"8": [], "8": [],
"9": [], "9": [],
"10": [] "10": []
} }*/
}, },
"custom/power_profile":{ "custom/power_profile":{
//shows the current power profile and switches to next on click //shows the current power profile and switches to next on click
"exec": "asusctl profile -p | sed s:'Active profile is'::", "exec": "~/.config/waybar/scripts/powerprofile.sh",
"return-type": "json",
"interval": 30, "interval": 30,
"format": "󰈐{}", "tooltip": false,
"format": "󰈐 {}",
"on-click": "asusctl profile -n; pkill -SIGRTMIN+8 waybar", "on-click": "asusctl profile -n; pkill -SIGRTMIN+8 waybar",
"signal": 8 "signal": 8
}, },
@ -107,14 +110,16 @@
"on-click": "pamixer --default-source -t", "on-click": "pamixer --default-source -t",
"on-scroll-up": "pamixer --default-source -i 5", "on-scroll-up": "pamixer --default-source -i 5",
"on-scroll-down": "pamixer --default-source -d 5", "on-scroll-down": "pamixer --default-source -d 5",
"scroll-step": 5 "scroll-step": 5,
"tooltip": false
}, },
"temperature": { "temperature": {
"thermal-zone": 0, "thermal-zone": 0,
"critical-threshold": 80, "critical-threshold": 80,
"format": "{temperatureC}°C ", "format": "{temperatureC}°C ",
"format-critical": "{temperatureC}°C " "format-critical": "{temperatureC}°C ",
"tooltip": false
}, },
"network": { "network": {
@ -127,6 +132,26 @@
"format-alt": "{ifname}:{essid} {ipaddr}/{cidr}" "format-alt": "{ifname}:{essid} {ipaddr}/{cidr}"
}, },
"cpu": {
"interval": 1,
"format": "󰻠 {usage:>2}%",
"format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"],
"states": {
"critical": 90,
"warning": 50
},
},
"memory": {
"interval": 1,
"format": "󰍛 {used:0.1f}G/{total:0.1f}G",
"states": {
"critical": 90,
"warning": 50
},
"tooltip": false
},
"bluetooth": { "bluetooth": {
"format": " {status}", "format": " {status}",
"format-disabled": "", // an empty format will hide the module "format-disabled": "", // an empty format will hide the module

View file

@ -0,0 +1,3 @@
#!/bin/bash
profile=$(asusctl profile -p | sed s:'Active profile is '::)
echo "{\"text\": \"$profile\", \"class\": \"$profile\"}"

View file

@ -28,24 +28,19 @@ tooltip {
#workspaces button.active { #workspaces button.active {
color: #a6adc8; color: #a6adc8;
} background: #3F84E5;
#workspaces button.focused {
color: #a6adc8;
background: #eba0ac;
border-radius: 10px; border-radius: 10px;
} }
#workspaces button.urgent { #workspaces button.urgent {
color: #11111b; color: #11111b;
background: #a6e3a1; background: #FC6471;
border-radius: 10px; border-radius: 10px;
} }
#workspaces button:hover { #workspaces button:hover:not(.active) {
background: #11111b; background: #1e1e2e;
color: #cdd6f4; color: #cdd6f4;
border-radius: 10px;
} }
#custom-power_profile, #custom-power_profile,
@ -59,6 +54,8 @@ tooltip {
#temperature, #temperature,
#workspaces, #workspaces,
#tray, #tray,
#memory,
#cpu,
#backlight { #backlight {
background: #1e1e2e; background: #1e1e2e;
opacity: 0.8; opacity: 0.8;
@ -68,12 +65,39 @@ tooltip {
border: 1px solid #181825; border: 1px solid #181825;
} }
#temperature { #memory {
border-radius: 10px 0px 0px 10px; border-radius: 10px 0px 0px 10px;
border-right: 0px;
}
#memory.warning {
color: #EDAE49;
}
#memory.critical {
color: #FC6471;
}
#cpu {
border-left: 0px;
border-right: 0px;
}
#cpu.warning {
color: #EDAE49;
}
#cpu.critical {
color: #FC6471;
}
#temperature {
border-left: 0px;
border-right: 0px;
} }
#temperature.critical { #temperature.critical {
color: #eba0ac; color: #FC6471;
} }
#backlight { #backlight {
@ -99,6 +123,14 @@ tooltip {
border-right: 0px; border-right: 0px;
} }
#custom-power_profile.Performance {
color: #FC6471;
}
#custom-power_profile.Balanced {
color: #EDAE49;
}
#window { #window {
border-radius: 10px; border-radius: 10px;
margin-left: 60px; margin-left: 60px;
@ -129,6 +161,7 @@ tooltip {
color: #89b4fa; color: #89b4fa;
border-left: 0px; border-left: 0px;
border-right: 0px; border-right: 0px;
border-radius: 10px 0px 0px 10px;
} }
#pulseaudio.microphone { #pulseaudio.microphone {
@ -148,7 +181,6 @@ tooltip {
#custom-weather { #custom-weather {
border-radius: 0px 10px 10px 0px; border-radius: 0px 10px 10px 0px;
border-right: 0px; border-left: 0px;
margin-left: 0px; margin-left: 0px;
} }