waybar: add gpumode module

This commit is contained in:
krolxon 2025-08-06 21:34:11 +05:30
parent 221967f368
commit f835448ed5
3 changed files with 32 additions and 26 deletions

View File

@ -14,6 +14,7 @@
"hyprland/window" "hyprland/window"
], ],
"modules-right": [ "modules-right": [
"custom/gpumode",
"tray", "tray",
"pulseaudio", "pulseaudio",
"battery", "battery",
@ -80,6 +81,11 @@
"interval": 1, "interval": 1,
"tooltip": false "tooltip": false
}, },
"custom/gpumode": {
"exec": "~/.config/waybar/scripts/gpu_mode.sh",
"format": "{}",
"interval": "once",
},
"cpu": { "cpu": {
"format": " {usage:2}%", "format": " {usage:2}%",
"interval": 1, "interval": 1,

View File

@ -0,0 +1,19 @@
#!/bin/bash
mode=$(envycontrol -q | awk '{print $NF}')
case "$mode" in
integrated)
icon=""
;;
hybrid)
icon=""
;;
nvidia)
icon=""
;;
*)
icon=""
;;
esac
echo "$icon $mode"

View File

@ -4,7 +4,6 @@
* Maintainer: rubyowo * Maintainer: rubyowo
* *
*/ */
@define-color base #1e1e2e; @define-color base #1e1e2e;
@define-color mantle #181825; @define-color mantle #181825;
@define-color crust #11111b; @define-color crust #11111b;
@ -36,18 +35,8 @@
@define-color flamingo #f2cdcd; @define-color flamingo #f2cdcd;
@define-color rosewater #f5e0dc; @define-color rosewater #f5e0dc;
/* * { */
/* `otf-font-awesome` is required to be installed for icons */
/* font-family: JetBrains Mono Nerd Font, FontAwesome; */
/* font-size: 13px; */
/* font-weight: bold; */
/* } */
* { * {
font-family: "JetBrainsMono Nerd Font"; font-family: "JetBrainsMono Nerd Font", "FontAwesome";
font-weight: bold; font-weight: bold;
min-height: 0; min-height: 0;
/* set font-size to 100% if font scaling is set to 1.00 using nwg-look */ /* set font-size to 100% if font scaling is set to 1.00 using nwg-look */
@ -56,15 +45,6 @@ font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"';
padding: 0.03125rem; padding: 0.03125rem;
} }
/* window#waybar { */
/* background-color: rgba(0, 0, 0, 0); */
/* color: #e3e3e3; */
/* transition-property: background-color; */
/* transition-duration: .5s; */
/* border: none; */
/* border-radius: 0; */
/* } */
window#waybar { window#waybar {
transition-property: background-color; transition-property: background-color;
transition-duration: 0.5s; transition-duration: 0.5s;
@ -101,7 +81,7 @@ window#waybar.hidden {
border: none; border: none;
border-radius: 0; border-radius: 0;
color: #d8dee9; color: @text;
transition: all 0.2s ease; transition: all 0.2s ease;
text-shadow: none; text-shadow: none;
@ -126,7 +106,7 @@ window#waybar.hidden {
#workspaces button:hover { #workspaces button:hover {
transition-duration: .2s; transition-duration: .2s;
color: @base; color: @base;
box-shadow: inset 0 -3px #e3e3e3; box-shadow: inherit;
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
text-shadow: inherit; text-shadow: inherit;
} }
@ -164,6 +144,7 @@ window#waybar.hidden {
#clock, #clock,
#custom-date, #custom-date,
#custom-gpumode,
#battery, #battery,
#backlight, #backlight,
#cpu, #cpu,
@ -196,7 +177,7 @@ window#waybar.hidden {
} }
#window { #window {
color: #e3e3e3 color: @text
} }
#clock { #clock {
@ -261,7 +242,7 @@ label:focus {
} }
#pulseaudio { #pulseaudio {
color: #d8dee9; color: @text;
} }
@ -274,7 +255,7 @@ label:focus {
} }
#tray { #tray {
color: #eceff4; color: @subtext0;
} }