Krolyxon
Commit f835448

Branches

Refs →

dotfiles-x11f835448

waybar: add gpumode module

Author
krolxon
Date
2025-08-06 21:34 +0530
Parent
221967f
Commit
f835448ed5a780e1cc2a6c25728eacc43a1ec96c

+32 −26

3 files changed

  1. M .config/waybar/config.jsonc +6 −0
  2. A .config/waybar/scripts/gpu_mode.sh +19 −0
  3. M .config/waybar/style.css +7 −26
M .config/waybar/config.jsonc View
@@ -14,6 +14,7 @@
1414 "hyprland/window"
1515 ],
1616 "modules-right": [
17+ "custom/gpumode",
1718 "tray",
1819 "pulseaudio",
1920 "battery",
@@ -80,6 +81,11 @@
8081 "interval": 1,
8182 "tooltip": false
8283 },
84+ "custom/gpumode": {
85+ "exec": "~/.config/waybar/scripts/gpu_mode.sh",
86+ "format": "{}",
87+ "interval": "once",
88+ },
8389 "cpu": {
8490 "format": " {usage:2}%",
8591 "interval": 1,
A .config/waybar/scripts/gpu_mode.sh View
@@ -0,0 +1,19 @@
1+#!/bin/bash
2+mode=$(envycontrol -q | awk '{print $NF}')
3+
4+case "$mode" in
5+ integrated)
6+ icon=""
7+ ;;
8+ hybrid)
9+ icon=""
10+ ;;
11+ nvidia)
12+ icon=""
13+ ;;
14+ *)
15+ icon=""
16+ ;;
17+esac
18+
19+echo "$icon $mode"
M .config/waybar/style.css View
@@ -4,7 +4,6 @@
44 * Maintainer: rubyowo
55 *
66 */
7−
87 @define-color base #1e1e2e;
98 @define-color mantle #181825;
109 @define-color crust #11111b;
@@ -36,18 +35,8 @@
3635 @define-color flamingo #f2cdcd;
3736 @define-color rosewater #f5e0dc;
3837
39−
40−
41−
42−/* * { */
43− /* `otf-font-awesome` is required to be installed for icons */
44−/* font-family: JetBrains Mono Nerd Font, FontAwesome; */
45−/* font-size: 13px; */
46−/* font-weight: bold; */
47−/* } */
48−
4938 * {
50−font-family: "JetBrainsMono Nerd Font";
39+font-family: "JetBrainsMono Nerd Font", "FontAwesome";
5140 font-weight: bold;
5241 min-height: 0;
5342 /* 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"';
5645 padding: 0.03125rem;
5746 }
5847
59−/* window#waybar { */
60−/* background-color: rgba(0, 0, 0, 0); */
61−/* color: #e3e3e3; */
62−/* transition-property: background-color; */
63−/* transition-duration: .5s; */
64−/* border: none; */
65−/* border-radius: 0; */
66−/* } */
67−
6848 window#waybar {
6949 transition-property: background-color;
7050 transition-duration: 0.5s;
@@ -101,7 +81,7 @@ window#waybar.hidden {
10181 border: none;
10282 border-radius: 0;
10383
104− color: #d8dee9;
84+ color: @text;
10585 transition: all 0.2s ease;
10686 text-shadow: none;
10787
@@ -126,7 +106,7 @@ window#waybar.hidden {
126106 #workspaces button:hover {
127107 transition-duration: .2s;
128108 color: @base;
129− box-shadow: inset 0 -3px #e3e3e3;
109+ box-shadow: inherit;
130110 /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
131111 text-shadow: inherit;
132112 }
@@ -164,6 +144,7 @@ window#waybar.hidden {
164144
165145 #clock,
166146 #custom-date,
147+#custom-gpumode,
167148 #battery,
168149 #backlight,
169150 #cpu,
@@ -196,7 +177,7 @@ window#waybar.hidden {
196177 }
197178
198179 #window {
199− color: #e3e3e3
180+ color: @text
200181 }
201182
202183 #clock {
@@ -261,7 +242,7 @@ label:focus {
261242 }
262243
263244 #pulseaudio {
264− color: #d8dee9;
245+ color: @text;
265246 }
266247
267248
@@ -274,7 +255,7 @@ label:focus {
274255 }
275256
276257 #tray {
277− color: #eceff4;
258+ color: @subtext0;
278259
279260 }
280261