Commit graph

163 commits

Author SHA1 Message Date
scorpion-26
aee06ab49d SNI: Properly unsubscribe from item reload signal
I think not unsubscribing is the root cause of the mysterious calling of
ItemPropertyChanged from random names/object paths.
2023-08-24 00:09:05 +02:00
scorpion-26
383f25dbe1 SNI: Fix pixmap
g_variant_iter_n_children apparently returns 1 instead of 3 (array =
child, but I don't know).
I inverted the statement, because for empty property, it hasn't any
children.
2023-08-23 23:18:50 +02:00
scorpion-26
15ed9bfc66 SNI: Disallow watcher replacement
Should help against losing the name constantly, if another bar is
opened.
2023-08-23 15:29:13 +02:00
scorpion-26
ff22c08f01 Disable Nvidia on nvml init failure
https://github.com/scorpion-26/gBar/issues/39
2023-08-23 15:08:33 +02:00
Shivanshu Kant Prasad
49dbf074be
Bug Fix: NixOS Missing Semicolon in module.nix (#41)
Nix build was broken due to a missing semicolon.
2023-08-23 13:40:33 +02:00
scorpion-26
a15bb1e17e SNI: Gracefully handle empty IconPixmap
An empty pixmap caused extreme flickering.
https://github.com/scorpion-26/gBar/issues/38
2023-08-22 22:30:38 +02:00
scorpion-26
b246e9fad4 Log failure code for Nvidia polling 2023-08-22 22:10:25 +02:00
scorpion-26
ec478dec9c SNI: Fix crash with ToolTip of type String
TeamViewer exposes ToolTip as String (which is not compliant to the spec).
This caused gBar to crash, since we assume, that the tooltip variant is
always a container (struct), which glibc doesn't like.

We now fallback to g_variant_get_string if it is not according to spec

Fixes https://github.com/scorpion-26/gBar/issues/37
2023-08-22 15:17:18 +02:00
scorpion-26
1a25dbdec6 Add config for numbers instead of sliders
Currently doesn't affect the audio flyin.
Implementation for https://github.com/scorpion-26/gBar/issues/35
2023-08-21 18:22:29 +02:00
SnowPuppy429
c2c7395687
Fixed a typo in README.md
Changed "costum" to "custom"
2023-08-21 17:28:40 +02:00
scorpion-26
ed71da316e Only use workspace manager when not using IPC
Since we always init Wayland, we would previously have both
zext_workspace_manager_v1 and Hyprland IPC which is terrible
2023-08-08 17:52:35 +02:00
scorpion-26
ef925ef174 Retry hypr socket operations.
Don't immediately ASSERT when the hyprland socket operations fail.
Instead, retry them a few times and then return gracefully instead of
crashing.

https://github.com/scorpion-26/gBar/issues/32
2023-08-08 16:32:14 +02:00
scorpion-26
3bac707bf5 Fix compiler warnings 2023-07-28 19:11:13 +02:00
scorpion-26
4a52bb744a SNI: Flush before querying item properties
Some apps have a tendency to deadlock after registration (notably
KeePassXC). Now we flush before querying the item properties, so any
pending answer should have left the bus, hopefully avoiding the deadlock
2023-07-28 18:58:00 +02:00
scorpion-26
a7862a4242 SNI: Remove callback for erased items
Should fix DBusNameVanished spam as found in https://github.com/scorpion-26/gBar/issues/29
2023-07-28 18:56:51 +02:00
scorpion-26
ef8652f046 Don't ignore WS 9
Fixes https://github.com/scorpion-26/gBar/issues/28
2023-07-28 00:19:55 +02:00
scorpion-26
09ec1bfab6 SNI: Sort items
Reloading/adding new items causes jumps in the item order. Sorting
should stabilize the order
2023-07-26 14:04:36 +02:00
scorpion-26
884d3f1324 SNI: Only reload a given senderName once
Fix for: https://github.com/scorpion-26/gBar/issues/26
2023-07-26 14:03:52 +02:00
scorpion-26
39cf17c30f SNI: Use our object path for ItemPropertyChanged
ItemPropertyChanged is called multiple times per actual icon change.
senderName is the same, objectPath is the same, but our registered name
for the callback differs.
We can't use the provided name for item searching, since that *can*
differ from the one we registered with (Looking at you, Discord. Discord
registers with org.kde.StatusNotifierItem-*, but calls back with :*.*)
Since then the object path will sometimes be wrong for the name, we just
use the one from the icon we originally registered with. This causes
multiple icons to reload though

Potential fix for https://github.com/scorpion-26/gBar/issues/26
2023-07-26 13:37:11 +02:00
scorpion-26
fe7b02b10c SNI: Honor XDG_DATA_DIRS as icon directory
Also don't crash in Utils::FindFileWithName when directory doesn't exist

Potential fix for https://github.com/scorpion-26/gBar/issues/25
2023-07-25 01:47:17 +02:00
scorpion-26
73b5335024
Update README.md
- Mention breaking style.css changes.
- Link-ify "open an issue"
2023-07-23 18:10:24 +02:00
scorpion-26
c12bef29d2 BluetoothDevices: Honor Location 2023-07-23 17:56:24 +02:00
Edvin Källström
f7ff25f605
Nix: fix invalid default value and extend documentation (#24)
Previous default value of date creates null option in gBar config and
crashed the bar, removes null as accepted option in SNIIcon* options as
that also crashes the bar. I also felt like documentation lacked so
wrote this.
2023-07-23 12:15:37 +02:00
Edvin Källström
bb765c6468
Add parsed nix config (#23)
Add a way to write the gBar configuration in the nix language, like many
other home manager modules, this spares, atleast nix users, from the
trouble of using a new config language and integrates it nicer into
existing home manager configs.
2023-07-21 21:09:56 +02:00
scorpion-26
abd3774c7d Fix SNI angle for top bar 2023-07-21 01:29:25 +02:00
scorpion-26
42a0710551 Fix SNIPaddingTop for sideways bar 2023-07-21 01:24:25 +02:00
scorpion-26
f78758c4ee SNI: Allow bar rotation
Texture was also rewritten, so it doesn't need the SNIPaddingTop hack as much
anymore
2023-07-21 01:08:38 +02:00
scorpion-26
6e8e7f3f9e Fix typo in config 2023-07-19 03:01:56 +02:00
scorpion-26
4cbada766e Fix margins for the audio flyin 2023-07-19 01:49:31 +02:00
scorpion-26
c5d458b3f7
Update README.md
- Fixed typo
- Update the entry for the tmp files
- Added the scope of this project
2023-07-19 01:46:04 +02:00
scorpion-26
138aa9318b Add a "Location" config.
Partially implements https://github.com/scorpion-26/gBar/issues/20
2023-07-19 01:13:57 +02:00
scorpion-26
b0c13801f6 Add GetHeight for Window 2023-07-19 01:13:57 +02:00
scorpion-26
4a9ac0ff5b Add angle property to widgets
This allows us to rotate various widgets.
2023-07-19 01:13:57 +02:00
scorpion-26
e4be65a348 Fix stupid comparison bug
Previously, dim.width < dim.height would never return true, since it is
already checked by dim.height >= dim.width.
2023-07-19 01:13:57 +02:00
scorpion-26
ba366729fe Add margin to Transform 2023-07-19 01:13:57 +02:00
scorpion-26
342ff57ba7 Add char to config 2023-07-19 01:13:57 +02:00
scorpion-26
43dd0777a8 Remove tmp files on SIGINT
This allows the use of Ctrl-C without leaving stale files behind which
need to be deleted
2023-07-14 19:46:27 +02:00
scorpion-26
fcf4d75ea0 Only allow one instance of the bluetooth widget
This works analogous to the audio flyin
Fixes https://github.com/scorpion-26/gBar/issues/21
2023-07-14 19:37:21 +02:00
scorpion-26
18f3e123ed SNI: Allow IconPath to be empty
Fixes network-manager-applet
2023-07-04 12:21:19 +02:00
scorpion-26
7567465454 Refactor Wayland code out 2023-06-15 13:25:19 +02:00
scorpion-26
f2dc5a806c Log workspace dispatching 2023-06-15 00:23:02 +02:00
scorpion-26
1f56e6ba15 Greatly reduce clipping when CenterTime is set
Giving each main box element (left, center, right) caused the window to
resize and clip out of the monitor when
e.g. the right part was larger than the 1/3 of the window.

Now we have a size for the center widget and try to manually center a box with
that size by setting the left widget's size accordingly. This allows the
right widget to have more room, so it can go right up to the center widget without issues.
2023-06-10 23:50:09 +02:00
scorpion-26
a34ffd8334 Add Window::GetWidth() 2023-06-10 23:49:13 +02:00
scorpion-26
6815d8e017 Initialise GTK early 2023-06-10 23:49:13 +02:00
scorpion-26
2a66f1d64c Format BluetoothDevices.cpp 2023-06-10 23:49:13 +02:00
scorpion-26
180e472551
Mention pamixer in README 2023-06-01 23:13:51 +02:00
faulTTY
9aa310fd07
Make datetime format configurable (#18)
Co-authored-by: Sciu-Crak <sciu-crak@crak-tower.ironyworld>
Co-authored-by: FaulTTY <faultty@localhost>
2023-05-26 08:57:02 +02:00
scorpion-26
77924b5097 Add confirmation to power PowerWidget
For it to actually do something, we need to click twice within 2s. The
clicked button also changes color for visual indication on what was
pressed

See https://github.com/scorpion-26/gBar/issues/17
2023-05-23 22:40:03 +02:00
scorpion-26
41f6dde6ec Remove css.map
It is a headache to maintain and not needed
2023-05-23 22:33:50 +02:00
scorpion-26
c51fadbc79 Consider capacity for battery sensor 2023-05-10 13:08:17 +02:00