Commit Graph

2817 Commits (09873f0ed9b45b2be72b7083c13cdd1604b4e274)

Author SHA1 Message Date
Calvin Lee 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
Alexis Rouillard 8eb614f69e
Merge pull request #2438 from khaneliman/hyprland-workspace-array
hyprland persistent workspace support new config declaration
2023-09-01 09:10:23 +02:00
Alexis Rouillard 347dd1c799
Merge pull request #2431 from zjeffer/fix/persistent-workspace-icon
hyprland/workspaces: Add "empty" icon and class
2023-09-01 09:09:32 +02:00
Alexis Rouillard 82b7e4ea01
Merge pull request #2414 from KosmX/add_release_v2
Release button event second attempt
2023-09-01 09:08:23 +02:00
Alexis Rouillard d7d4a6c632
Merge pull request #2442 from PucklaJ/hyprland_persistent
Show workspaces on all outputs if persistent_workspaces value is empty
2023-09-01 09:06:41 +02:00
PucklaJ a18b41911d hyprland/workspaces: Show workspace on all outputs if an empty array is given
This behaviour is consistent with sway/workspaces and wlr/workspaces
2023-08-30 13:35:19 +02:00
Austin Horstman 52309615c1
hyprland new persistent_workspace configuration style 2023-08-29 00:11:25 -05:00
zjeffer e163dd8216 hyprland/workspaces: update manpage 2023-08-24 22:51:06 +02:00
zjeffer 06a9f98878 hyprland/workspaces: Add "empty" icon and class 2023-08-24 21:19:20 +02:00
Alexis Rouillard b665843085
Merge pull request #2429 from khaneliman/hyprland-urgent
Hyprland urgent class support
2023-08-24 17:00:40 +02:00
Austin Horstman ee4fbc58f7
hyprland add urgent ipc support 2023-08-23 12:52:29 -05:00
Austin Horstman 3081b0c576
flake lock update 2023-08-23 12:14:35 -05:00
Alexis Rouillard b7a527b122
Merge pull request #2424 from asas1asas200/feat-keyboard-bindingkey 2023-08-20 09:40:36 +02:00
asas1asas200 54a6668846 feat(keyboard-state): add binding-keys options 2023-08-20 08:33:34 +08:00
Alexis Rouillard ed0f7453c9
Merge pull request #2420 from Alexays/chore-subprojects
chore: update subprojects
2023-08-18 10:39:15 +02:00
Alex 19fe929d1f chore: update subprojects 2023-08-18 09:48:03 +02:00
KosmX 392e863e6d
Apply formatting 2023-08-16 17:33:36 +02:00
KosmX 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
KosmX 1d8331d0c5
Add release events to event map 2023-08-16 17:12:32 +02:00
KosmX 718db71638
Refactor enable click condition
This shouldn't change behaviour.
2023-08-16 17:11:44 +02:00
Alexis Rouillard 0a28b50a8c
Merge pull request #2413 from PucklaJ/bluetooth-no-controller
Add format-no-controller to bluetooth module and fix it still being visible if the format string is empty
2023-08-16 17:08:48 +02:00
PucklaJ 70bc318a01 Fix bluetooth module still being visible if format is empty 2023-08-16 16:30:59 +02:00
PucklaJ 22817089db Add no-controller format to bluetooth module 2023-08-16 15:34:06 +02:00
Alexis Rouillard aecd80702e
Merge pull request #2412 from jpalus/simpleclock-fmt-compile-fix
Fix simpleclock module compilation with recent fmt
2023-08-16 14:35:39 +02:00
Jan Palus abd7a0cf25
Fix simpleclock module compilation with recent fmt
both `format_` and `tooltip_format` are dynamically provided formats so
wrap them in `fmt::runtime()`
2023-08-16 14:32:48 +02:00
Alex e30fba0b8f chore: 0.9.22 2023-08-16 13:34:05 +02:00
Alex b5ea14c896 revert: release event 2023-08-16 13:31:24 +02:00
Alexis Rouillard 5b33a5917c
Merge pull request #2404 from eltociear/master-1
fix: typo in taskbar.cpp
2023-08-16 08:55:33 +02:00
Alexis Rouillard 66b71cc857
Merge pull request #2409 from jpalus/fmt-cast-ustring-to-string 2023-08-15 22:35:46 +02:00
Jan Palus 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
Ikko Eltociear Ashimine 57544fe694
fix: typo in taskbar.cpp
ocurred -> occurred
2023-08-15 00:45:09 +09:00
Alex e90c66a102 chore: 0.9.21 2023-08-14 15:33:52 +02:00
Alex db1d859881 fix: lint 2023-08-14 14:20:08 +02:00
Alexis Rouillard cc961d40b3
Merge pull request #2402 from frankebel/master
docs: fix Arch repository name
2023-08-14 13:28:54 +02:00
Frank Ebel 29cebaa0a7
docs: fix Arch repository name 2023-08-14 12:42:33 +02:00
Alexis Rouillard 2c7bbe9852
Merge pull request #2393 from zjeffer/hyprland/fixes
Hyprland/workspaces: use named icons instead of searching by id
2023-08-14 11:46:55 +02:00
Alexis Rouillard eb74623b7d
Merge pull request #2399 from KosmX/click_release_action
Button release action
2023-08-14 11:46:27 +02:00
Alexis Rouillard b9260575e5
Merge pull request #2401 from zjeffer/master
Updated hyprland-workspaces manpage
2023-08-14 11:23:35 +02:00
zjeffer 8cf676176d Updated hyprland-workspaces manpage 2023-08-14 11:17:49 +02:00
KosmX 3db5673e70
register key hander 2023-08-13 18:48:23 +02:00
KosmX 46f5034030
Add button release events to eventMap 2023-08-13 18:20:43 +02:00
zjeffer 6f7e7c5199 formatting 2023-08-10 20:37:42 +02:00
zjeffer 2ba11e8401 Hyprland/workspaces: use named icons instead of searching by id 2023-08-10 20:09:30 +02:00
Alexis Rouillard b084bf721e
Merge pull request #2377 from marshallmoats/master
Change default workspace format
2023-08-09 08:16:52 +02:00
Marshall Moats e40860c3e9 keep id 2023-08-08 17:17:58 -05:00
Marshall Moats 2bcd0eb09f
Change default workspace format 2023-08-02 16:02:50 -05:00
Alexis Rouillard 94c34a29c4
Merge pull request #2370 from spikespaz/nix-fix-overlay
flake: fix infrec in package overlay
2023-08-02 08:41:39 +02:00
Alexis Rouillard 7fb37c0069
Merge pull request #2373 from marshallmoats/master 2023-08-02 08:35:10 +02:00
Marshall Moats ce2ede70f2 Fix logical errors, formatting error 2023-08-01 15:55:37 -05:00
Jacob Birkett b91adc9f29 flake: fix infrec in package overlay 2023-07-31 09:37:33 -07:00