Commit Graph

923 Commits

Author SHA1 Message Date
bbb7fb0c82 refactor: don't use a group's box directly in bar 2023-10-14 13:23:11 -03:00
c59264d6b4 fix: clang < 16 can't emplace back struct with no constructor 2023-10-12 17:30:32 -03:00
ee652677a6 feat: ignore windows with empty classes or titles (if any rule uses title) 2023-10-11 11:40:49 -03:00
c995bafa7a feat: add option to ignore workspaces based on regex 2023-10-11 10:59:33 -03:00
387e54498e docs: document new regex collection class 2023-10-09 14:46:57 -03:00
fad43d4b16 feat: listen to windowtitle IPC event condiationally to update window rules 2023-10-09 14:42:53 -03:00
8d057e6f96 refactor: separate regex rule matching and caching in separate class 2023-10-09 13:53:00 -03:00
c16e791cdc Adding options to allow disk outputs to always be in a specific unit 2023-10-08 16:24:50 +01:00
1eb0777799 add function to cava module to hide on silence 2023-10-07 12:50:24 +02:00
258ab8b147 refactor: take window representation directly from old workspace on movewindow event 2023-09-22 21:12:42 -03:00
adbc9d95de feat: optional default icon for 0-match classes
Co-authored-by: Gabriel Fox <Inbox@GabrielFox.Dev>
2023-09-22 19:16:59 -03:00
b9d5912a4f feat: rewrite window classes
feat: cache window class rewrite resolution

Co-authored-by: Gabriel Fox <Inbox@GabrielFox.Dev>
2023-09-22 19:16:53 -03:00
3e2761e81f feat: dynamically assign windows to workspaces
Co-authored-by: Gabriel Fox <Inbox@GabrielFox.Dev>
2023-09-22 19:12:50 -03:00
bf371f70d1 add waitingWorker() to Custom 2023-09-18 14:56:14 -07:00
7c28ffc856 add indefinite sleep() function to SleeperThread 2023-09-18 14:55:50 -07:00
8d7341da6e cpu module: Reuse getLoad of load module 2023-09-13 21:56:37 +02:00
d1602e383c cpu module: Reuse getCpuUsage of cpu_usage module 2023-09-13 21:56:36 +02:00
c45f6681b3 cpu module: Reuse getCpuFrequency of cpu_frequency module 2023-09-13 21:56:35 +02:00
dce6a98f38 Added changes made to the cpu module 2023-09-13 21:56:34 +02:00
982ffde002 Use labels instead of buttons 2023-09-13 21:56:33 +02:00
888adb57ec Introduce cpu_usage module 2023-09-13 21:56:32 +02:00
c36fe3a004 Introduce cpu_frequency module 2023-09-13 21:56:31 +02:00
729564cc27 Introduced separate load module
The module provides the three system load averages. This is an
improvement compared what you can do with the cpu module: cpu
only provides the one minute sample and the state of the cpu module is
derived from the cpu usage which messes up the formating of the load
average. Also, at least on modern Linux systems, the load of a system
takes much more than the cpu utilization into account and it should
therefore live in a separate module.
2023-09-13 21:56:30 +02:00
fc67558717 Merge branch 'master' into darkmode 2023-09-11 09:25:45 +02:00
79cf33b9f1 refactor: enumparser create implementation file 2023-09-09 17:59:40 -05:00
b8630968b2 refactor: move capitalize string helper 2023-09-09 13:23:17 -05:00
2fee12d930 fix: enumparser capitalize everything to avoid issues 2023-09-09 12:14:52 -05:00
3ae2fe3272 refactor: PR review cleanup 2023-09-09 12:08:30 -05:00
2b8c92e8fd refactor: enum utility allow overriding 2023-09-09 11:18:12 -05:00
8ce64ea784 refactor: make parsing sort-by more lenient 2023-09-09 10:04:49 -05:00
8ea2626de8 refactor: sort-by enum hyprland 2023-09-09 10:04:48 -05:00
cbc12e5443 feat: hyprland workspaces add sort-by 2023-09-08 22:49:15 -05:00
587bd0cd62 refactor: cleanup hyprland workspaces constructor 2023-09-08 22:24:05 -05:00
9bb2c01a44 clean up client.cpp 2023-09-07 13:43:59 +00:00
09873f0ed9 search for dark or light mode stylesheet
summary:
-------
This commit adds xdg-desktop-portal support to waybar. If a portal
supporting `org.freedesktop.portal.Settings` exists, then it will be
queried for the current colorscheme. This colorscheme will then be used
to prefer a `style-light.css` or `style-dark.css` over the basic
`style.css`.

technical details:
-----------------
Appearance is provided by several libraries, such as libhandy (mobile)
and libadwaita. However, waybar links to neither of these libraries. As
the amount of code required to communicate with xdg-desktop portal as a
client is rather minimal, I believe doing so is better than linking to
an additional library.

The Gio library for communicating with dbus is rather messy, Instead of
the `Portal` class containing a `Gio::Dbus::Proxy`, it extends it which
simplifies signal handling.

`Portal` then exposes its own signal, which can be listened to by waybar
to update CSS.

For a reference implementation, please see another one of my projects:
https://github.com/4e554c4c/darkman.nvim/blob/main/portal.go

test plan:
---------
If no desktop portal which provides `Settings` exists, then waybar
continues with the log line
```
[2023-09-06 14:14:37.754] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
```

Furthermore, if `style-light.css` or `style-dark.css` do not exist, then
`style.css` will still be searched for.

Waybar has been tested with both light and dark startup. E.g. if the
appearance is dark on startup the log lines
```
[2023-09-06 14:27:45.379] [info] Discovered appearance 'dark'
[2023-09-06 14:27:45.379] [debug] Try expanding: $XDG_CONFIG_HOME/waybar/style-dark.css
[2023-09-06 14:27:45.379] [debug] Found config file: $XDG_CONFIG_HOME/waybar/style-dark.css
[2023-09-06 14:27:45.379] [info] Using CSS file /home/pounce/.config/waybar/style-dark.css
```
will be observed.
If the color then changes to light during the operation of waybar, it
will change css files:
```
[2023-09-06 14:28:17.173] [info] Received new appearance 'dark'
[2023-09-06 14:28:17.173] [debug] Try expanding: $XDG_CONFIG_HOME/waybar/style-light.css
[2023-09-06 14:28:17.173] [debug] Found config file: $XDG_CONFIG_HOME/waybar/style-light.css
[2023-09-06 14:28:17.173] [info] Using CSS file /home/pounce/.config/waybar/style-light.css
```

Finally, tested resetting waybar and toggling style (works, and style is
only changed once).

fixes: Alexays/Waybar#1973
2023-09-06 15:19:56 +00:00
04b39ea64e hyprland/workspaces: implement 'active_only' option and visible class 2023-09-05 18:22:54 +02:00
9c49f46b01 hyprland/workspaces: react on renameworkspace event 2023-09-05 17:13:25 +02:00
2d27e484c7 Merge pull request #2417 from Cherser-s/sni-click-coordinate-fix
sni: fix passing relative coordinates to dbus methods
2023-09-04 22:01:04 +02:00
ce076927f3 chore: cpplint fixes hyprland headers 2023-09-02 23:56:04 -05:00
82b7e4ea01 Merge pull request #2414 from KosmX/add_release_v2
Release button event second attempt
2023-09-01 09:08:23 +02:00
65dfabc430 sni: fix passing relative coordinates to dbus methods
Doesn't correctly handle the case with both margin and width/height being set at the same time.
2023-08-25 20:37:16 +03:00
936937ec78 store margins and global window offset in the bar object 2023-08-25 20:37:14 +03:00
ee4fbc58f7 hyprland add urgent ipc support 2023-08-23 12:52:29 -05:00
54a6668846 feat(keyboard-state): add binding-keys options 2023-08-20 08:33:34 +08:00
2ff347f9a8 Add handleRelease method to release events
This commit shouldn't change the handleToggle behaviour,
it shouldn't break anything.
2023-08-16 17:14:49 +02:00
1d8331d0c5 Add release events to event map 2023-08-16 17:12:32 +02:00
22817089db Add no-controller format to bluetooth module 2023-08-16 15:34:06 +02:00
b5ea14c896 revert: release event 2023-08-16 13:31:24 +02:00
c8237437d2 Explicitly cast ustring to string when passing to fmt
don't rely on implicit conversion which is no longer present in fmt
10.1.0

Fixes #2403
2023-08-15 20:57:07 +02:00
db1d859881 fix: lint 2023-08-14 14:20:08 +02:00