Commit graph

241 commits

Author SHA1 Message Date
scorpion-26
05e7635c80 Fix CI 2023-05-04 13:53:15 +02:00
scorpion-26
ecc52a81a5 Update all deprecated Material Design icons
All Material Design icons should now use their new code points.
This unbreaks gBar with Nerd Fonts v3.0.0
2023-05-03 23:21:21 +02:00
scorpion-26
be47a62880 Properly escape the default package command
/bin/sh would remove any newlines without ""
2023-05-03 23:20:29 +02:00
scorpion-26
c101449ba6 Allow Package widget to be anywhere 2023-05-03 19:02:26 +02:00
scorpion-26
aa08206e4b Fix default packages command 2023-05-03 19:00:39 +02:00
scorpion-26
299b497748 Add package widget
Polling is done via user script and a pipe. Since it is only run every
5 minutes by default, this should be fine

Partially implements https://github.com/scorpion-26/gBar/issues/14
2023-05-03 18:40:45 +02:00
scorpion-26
3517fa5de8 Widget: Fix delayed "SetText" 2023-03-25 21:15:35 +01:00
scorpion-26
507cf222fb Audio: Add Min/Max volume
AudioMinVolume/AudioMaxVolume remap the range 0%-100% to
AudioMinVolume-AudioMaxVolume

https://github.com/scorpion-26/gBar/issues/13
2023-03-21 22:09:56 +01:00
scorpion-26
d6610f2594 Config: Support double values 2023-03-21 22:08:59 +01:00
scorpion-26
2fa23a2d54 Audio: Log SetVolume*** events 2023-03-21 17:49:30 +01:00
Edvin Källström
3b6bafe91a
Add a home-manager nix module (#11)
Add a home-manager module to simplify installation and config management
on nix systems. This greatly reduces the setup time and
makes it integrate better with other programs on nix, mainly Hyprland
which this module is based on.
2023-03-13 21:00:08 +01:00
scorpion-26
00caccc459
Update manual build instructions 2023-03-11 00:46:02 +01:00
scorpion-26
c2c38dcae7 Workspaces: Add config option for Hyprland IPC
ext_workspace wasn't as perfect of a replacement as I thought it was...
2023-03-11 00:24:50 +01:00
scorpion-26
78107f16fa Always activate first x monitors
The workspace of a second monitor would not be activated, so
lastActiveWorkspace of that would be nullptr. This would also happen for
the first monitor (First and second swapped)
after Hyprland boot.

Now the WS of the first monitor is fully activated by default and every
other monitor has at least lastActiveWorkspace set (Assumes, that WS
with MonID + 1 is on that monitor).
2023-03-05 20:30:43 +01:00
scorpion-26
f2bc8e00c8 Fix late update SetText 2023-03-04 22:07:25 +01:00
scorpion-26
ad92b7c12a Workspaces: Implement ext_workspace protocol
Even though it isn't faster than Hyprland IPC, it still is more flexible
and more future proof.

Closes https://github.com/scorpion-26/gBar/issues/8
2023-03-03 20:46:37 +01:00
scorpion-26
63faae741f
Include Nix logs 2023-03-03 19:38:39 +01:00
scorpion-26
d78fe91c9e
Remove Docker for Nix 2023-03-03 19:36:34 +01:00
scorpion-26
8577eff37c
Use cachix/install-nix-action 2023-03-03 19:33:38 +01:00
scorpion-26
8102cc657f
Manually checkout on Nix 2023-03-03 19:24:36 +01:00
scorpion-26
e311c246da
Bump checkout version 2023-03-03 19:20:44 +01:00
scorpion-26
41d75eeedd
Add CI 2023-03-03 19:15:49 +01:00
scorpion-26
660e690195 Cache SetText
Apparently, gtk_button_set_label is very expensive to do. Now it is
only called when necessary.

This is the culprit for the mysterious high CPU usage and not the Hyprland
IPC as said in https://github.com/scorpion-26/gBar/issues/7 and https://github.com/scorpion-26/gBar/issues/8.
2023-03-03 17:02:59 +01:00
scorpion-26
6d3f1b64f4 Buildsystem: Remove LTO by default
LTO under gcc is suboptimal due to:
    1. No thin LTO
    2. Basically requires gcc-ar for static library support. Nix systems
       apparently don't have that.

Fixes https://github.com/scorpion-26/gBar/issues/10
2023-02-27 21:02:43 +01:00
scorpion-26
c536e43cd0 Update README.md 2023-02-26 20:16:07 +01:00
Edvin Källström
8238182edb
Add nix support (#9)
add nix support via a flake.
Flake tested and builds successfully.
2023-02-26 19:59:26 +01:00
scorpion-26
d8eae96e50 Widgets: Avoid redraws by reducing gtk calls 2023-02-24 22:34:30 +01:00
scorpion-26
e1cf8f2475 PulseAudio: Optimizations
Instead of always polling audio volume, gBar subscribes to events,
causing the update to only happen on demand.
Plus we can block poll updates when there is audio change through gBar,
which results in a much smoother slider.

This change reduces (at least on my end) CPU times from 4-6% per core
to 2-4% per core.
2023-02-24 14:34:11 +01:00
scorpion-26
38116636ae Workspaces: Optimize GetStatus
We previously called DispatchIPC 18 times every 100ms
Now it is only 2 times per 100ms
2023-02-24 13:28:09 +01:00
scorpion-26
d2d66171df Buildsystem: More aggressive optimizations
- Enable LTO by default
- Enable Full optimizations by default
- Statically link to libgBar by default
2023-02-24 13:28:09 +01:00
scorpion-26
682f0a4c2f
Mention NF 2.3.0 requirement 2023-02-23 17:10:41 +01:00
scorpion-26
35a6670868 Fix issue with audio slider
Due to the fact, that we needed to manually propagate hover events from
the slider, two hover events are sent when coming from the side of the
slider. This we need to await BOTH close events until we can call the
leave function.
2023-02-22 17:23:47 +01:00
scorpion-26
3c8c93d774 Add Microphone support
This commit adds a new widget for the bar: A Microphone widget. It is
disabled by default and can can
be enabled with AudioInput: true.
Implements a flyin as well.

https://github.com/scorpion-26/gBar/issues/5 for the ping
2023-02-22 17:13:14 +01:00
scorpion-26
f5adfebfe9 PulseAudio: Improve iterator loop
We now store sthe pa_operation and check if they were done'd, cancelled or still running.
2023-02-21 22:47:30 +01:00
scorpion-26
16933c24ff Add log file
Plus refactoring out the logging.
2023-02-21 22:20:02 +01:00
scorpion-26
0e4b877654 PulseAudio: Make FlushLoop more robust
When PA_CONTEXT_READY is called multiple times, PulseAudio::FlusLoop() would get stuck to to integer underflow.
Now there are multiple things preventing that.

Possible fix for https://github.com/scorpion-26/gBar/issues/7
2023-02-21 21:19:22 +01:00
scorpion-26
60b9355e88 System: Don't crash when dbus isn't installed. 2023-02-21 11:39:39 +01:00
scorpion-26
991864775b
Mention AUR in README 2023-02-21 11:27:40 +01:00
scorpion-26
3d2129ca4e Build: Remove ../lib rpath 2023-02-21 10:05:13 +01:00
scorpion-26
a12cb9af5d AudioSlider: Add option for scroll speed
There seems to be a floating point error somewhere though, since
sometimes it goes up by AudioScrollSpeed - 1 instead of
AudioScrollSpeed...

For the ping https://github.com/scorpion-26/gBar/issues/5
2023-02-20 23:04:37 +01:00
scorpion-26
906a1259c3 Add Net sanity checking
This disables network if the tx_bytes file is not found on Init()
2023-02-12 20:45:05 +01:00
scorpion-26
35b7065879 Implement Workspace scroll
Scrolling the workspace widgets now scroll through the workspaces. The
exact behaviour is governed by
'WorkspaceScrollOnMonitor'(either 'm[+/-]1' or 'e[+/-]1'). The direction
can be inverted with 'WorkspaceScrollInvert'.

For the ping: https://github.com/scorpion-26/gBar/issues/5
2023-02-12 14:57:32 +01:00
scorpion-26
c29d752cb8 EventBox: Fix fault callback parameter. 2023-02-12 14:56:59 +01:00
scorpion-26
b4dfaa62b1 EventBox: Add scroll event 2023-02-12 14:28:46 +01:00
scorpion-26
6f3f398ead Bump faulty meson version hint 2023-02-10 17:30:02 +01:00
scorpion-26
e5d160018a
Mention Network widget 2023-02-10 17:26:59 +01:00
scorpion-26
3134c82245 Add a Network Widget
This new widget visualizes the up and download speeds for a
specified network adapter. It is on by default, but can be disabled.
2023-02-10 17:20:26 +01:00
scorpion-26
c901b59ab4 Add missing files
I accidently forgot to add them when commiting 883037029f
2023-02-10 17:14:57 +01:00
scorpion-26
f916b00de7 Fix bogus comment removal
The previous substr call would remove everything but the comment, which
    is not what we want.
2023-02-10 17:10:35 +01:00
scorpion-26
883037029f Refactor CSS out of Window.cpp
It has nothing to do with *windows* and obviously doesn't belong there.
Plus I don't know whether I may need static access to the provider.
2023-02-09 16:16:18 +01:00