Commit Graph

17 Commits

Author SHA1 Message Date
Jonathan Herlin 2a3ebc12de fix: cpu_load pushed twice to the vector 2023-01-05 01:10:04 +01:00
Simon Plakolb 5e9bbe5c76 modules: Revert button to label 2022-11-24 13:08:16 +01:00
Simon Plakolb 2b735f44bc modules: Set tooltip on button
Mouse-over tooltips set on the label only appear once the mouse hovers
over exactly the label. Other apps (e.g. firefox) show the tooltip once
the pointer hovers the button. Not solely its label. With this commit we
get the same behaviour.
2022-10-12 10:25:30 +02:00
Simon Plakolb b8322c4b4b button: Add AButton class
The AButton class is designed as full a substitute to ALabel. The
GtkButton attribute 'button_' is initialized with a label. This
label can the be referenced by the subsequent inheritors of AButton
instead of the GtkLabel attribute 'label_' of ALabel.
For convenience a GtkLabel* 'label_' attribute is added to AButton.

If the button cannot be clicked it is disabled, effectively acting
like its label predecessor.

GtkButton seems to catch one-click mouse events regardless of the
flags set on it. Therefore, 'signal_pressed' is connected to a
function creating a fake GdkEventButton* and calling 'handleToggle'
(for details on this possible bug in GTK see:
https://stackoverflow.com/questions/45334911 )

In accordance with other GtkButtons (i.e. the sway/workspace ones)
set_relief(Gtk::RELIEF_NONE) is called on the 'button_' instance.
2022-10-12 10:25:29 +02:00
Alex 7ab9a560ae fix: lint 2022-05-23 13:47:14 +02:00
Ed Ralston 7abcbe80e5
Prevent segfault in getCpuFrequency
When parseCpuFrequencies returns an empty vector, getCpuFrequency
would attempt to dereference an invalid iterator.

Return early from getCpuFrequency when parseCpuFrequencies returns an
empty vector.

Resolves a segfault when waybar is run within a VM on apple silicon.
2022-05-19 20:01:57 -04:00
Alex f2fcadbf62 refactor: lint 2022-04-06 08:37:19 +02:00
Brent George 3c18c43b9a limit cpu load figure to 2 points 2022-02-22 16:33:33 -07:00
Darkclainer 6e5a0bc80a Add cpu usage for every core 2021-09-19 14:02:25 +03:00
Alex 67c7302938
Revert "Add CPU usage for every core" 2021-09-18 13:50:16 +02:00
Darkclainer 4bf577e89b Add CPU usage for every core 2021-09-17 21:18:21 +03:00
Tobias Bengfort 7b4b5e55a2 support format-icon for cpu und memory 2021-08-23 07:30:19 +02:00
Alex 600afaf530
Merge pull request #1037 from Moonlight-Angel/cpu-frequency
Add cpu min/max/avg frequencies
2021-03-25 12:09:42 +01:00
Antonin Reitz a49b12b66b Fix CPU load values 2021-03-12 20:58:51 +01:00
Genesis 08ea5ebe1f
Add cpu frequency 2021-02-25 09:14:51 +01:00
Ole Martin Handeland 4229e9b2ca Implemented format-{state} for cpu/disk/memory 2020-10-12 02:05:26 +02:00
Jan Beich 4e567d0483 cpu: port parseCpuinfo to BSDs 2020-05-19 10:43:42 +00:00
Renamed from src/modules/cpu.cpp (Browse further)