Skip to content

Commit 398e2f0

Browse files
committed
fix high cpu usage of waybar
1 parent effb830 commit 398e2f0

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

.config/waybar/config.jsonc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@
4444
},
4545
"custom/player#main": {
4646
"exec": "playerctl metadata --format '{{ title }}' 2>/dev/null || echo ''",
47-
"interval": 1,
47+
"interval": 5,
4848
"max-length": 50
4949
},
5050
"custom/player#prev": {
5151
"format": "",
5252
"on-click": "playerctl previous"
5353
},
5454
"custom/player#play": {
55-
"exec": "while true; do playerctl status 2>/dev/null || echo 'Stopped'; sleep 0.2; done",
55+
"exec": "playerctl status 2>/dev/null || echo 'Stopped'",
56+
"interval": 2,
5657
"on-click": "playerctl play-pause",
5758
"format": "{}"
5859
},
@@ -109,7 +110,7 @@
109110
// "format": " {:%d %m %Y  %H:%M}", //24 hour format
110111
// //"timezones": [ "Kolkata" ],
111112
// //"max-length": 200
112-
"interval": 1
113+
"interval": 60
113114
},
114115
// "clock": {
115116
// "format": " {:%H:%M:%S}",

.config/waybar/style.css

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ window#waybar {
256256
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
257257
0 0 20px alpha(@mauve, 0.5);
258258
background: linear-gradient(135deg, @mauve, @lavender);
259-
animation: pulse 1s ease-in-out infinite;
259+
/* animation: pulse 1s ease-in-out infinite; */
260260
}
261261

262262
#workspaces button.active {
@@ -265,15 +265,15 @@ window#waybar {
265265
box-shadow: 0 4px 16px alpha(@mauve, 0.6),
266266
inset 0 1px 0 rgba(255, 255, 255, 0.2);
267267
font-size: 15px;
268-
animation: float 2s ease-in-out infinite;
268+
/* animation: float 2s ease-in-out infinite; */
269269
}
270270

271271
#workspaces button.focused {
272272
color: @crust;
273273
background: linear-gradient(135deg, @yellow 0%, @peach 50%, @red 100%);
274274
box-shadow: 0 4px 16px alpha(@yellow, 0.6);
275275
font-size: 14px;
276-
animation: rainbow 3s linear infinite;
276+
/* animation: rainbow 3s linear infinite; */
277277
}
278278

279279
#mode {
@@ -379,7 +379,7 @@ window#waybar {
379379
inset 0 -2px 0 rgba(0, 0, 0, 0.2);
380380
margin: 4px 6px;
381381
border: 1px solid alpha(@red, 0.8);
382-
animation: pulse 1.5s ease-in-out infinite;
382+
/* animation: pulse 1.5s ease-in-out infinite; */
383383
}
384384

385385
/* Launcher button specific hover with enhanced effects */
@@ -559,7 +559,7 @@ window#waybar {
559559
background: linear-gradient(135deg, alpha(@sapphire, 0.3), alpha(@blue, 0.3));
560560
border: 1px solid alpha(@sapphire, 0.5);
561561
box-shadow: 0 0 15px alpha(@sapphire, 0.6);
562-
animation: pulse 3s ease-in-out infinite;
562+
/* animation: pulse 3s ease-in-out infinite; */
563563
}
564564

565565
/* Time group: Date + Clock (Non-clickable - smaller) */
@@ -657,7 +657,7 @@ window#waybar {
657657
background: linear-gradient(135deg, alpha(@green, 0.3), alpha(@teal, 0.3));
658658
border: 1px solid alpha(@green, 0.5);
659659
box-shadow: 0 0 15px alpha(@green, 0.6);
660-
animation: pulse 2s ease-in-out infinite;
660+
/* animation: pulse 2s ease-in-out infinite; */
661661
}
662662

663663
#custom-player.play.paused {
@@ -754,7 +754,7 @@ window#waybar {
754754
color: @red;
755755
background: linear-gradient(135deg, alpha(@red, 0.4), alpha(@maroon, 0.4));
756756
border: 1px solid alpha(@red, 0.5);
757-
animation: blink 0.5s ease-in-out infinite;
757+
/* animation: blink 0.5s ease-in-out infinite; */
758758
font-size: 15px;
759759
}
760760

@@ -765,7 +765,7 @@ window#waybar {
765765
color: @red;
766766
background: linear-gradient(135deg, alpha(@red, 0.2), alpha(@maroon, 0.2));
767767
border: 1px solid alpha(@red, 0.4);
768-
animation: blink 1s ease-in-out infinite;
768+
/* animation: blink 1s ease-in-out infinite; */
769769
}
770770

771771

@@ -774,7 +774,7 @@ window#waybar {
774774
background: linear-gradient(135deg, alpha(@overlay0, 0.2), alpha(@surface2, 0.2));
775775
border: 1px solid alpha(@overlay0, 0.3);
776776
opacity: 0.6;
777-
animation: pulse 2s ease-in-out infinite;
777+
/* animation: pulse 2s ease-in-out infinite; */
778778
}
779779

780780
/* Battery */
@@ -792,22 +792,22 @@ window#waybar {
792792
background: linear-gradient(135deg, alpha(@teal, 0.3), alpha(@green, 0.3));
793793
border: 1px solid alpha(@teal, 0.5);
794794
box-shadow: 0 0 15px alpha(@teal, 0.7);
795-
animation: pulse 2s ease-in-out infinite;
795+
/* animation: pulse 2s ease-in-out infinite; */
796796
}
797797

798798
#battery.warning:not(.charging) {
799799
color: @yellow;
800800
background: linear-gradient(135deg, alpha(@yellow, 0.3), alpha(@peach, 0.3));
801801
border: 1px solid alpha(@yellow, 0.5);
802802
box-shadow: 0 0 15px alpha(@yellow, 0.6);
803-
animation: pulse 3s ease-in-out infinite;
803+
/* animation: pulse 3s ease-in-out infinite; */
804804
}
805805

806806
#battery.critical:not(.charging) {
807807
color: @red;
808808
background: linear-gradient(135deg, alpha(@red, 0.3), alpha(@maroon, 0.3));
809809
border: 1px solid alpha(@red, 0.5);
810-
animation: blink 0.8s ease-in-out infinite;
810+
/* animation: blink 0.8s ease-in-out infinite; */
811811
}
812812

813813
/* Action Buttons - consolidated common properties */
@@ -849,12 +849,12 @@ window#waybar {
849849

850850
#tray>.active {
851851
color: @mauve;
852-
animation: pulse 2s ease-in-out infinite;
852+
/* animation: pulse 2s ease-in-out infinite; */
853853
}
854854

855855
#tray>.needs-attention {
856856
color: @red;
857-
animation: blink 1s ease-in-out infinite;
857+
/* animation: blink 1s ease-in-out infinite; */
858858
}
859859

860860
/* Window Title - consolidated styling */

0 commit comments

Comments
 (0)