Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/v3.22/community' > /etc/apk/repositories
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/v3.22/main' >> /etc/apk/repositories
- run: apk --no-cache add git g++ binutils pkgconf meson ninja musl-dev gtkmm4-dev vala gobject-introspection gobject-introspection-dev pulseaudio-dev pipewire-dev wireplumber-dev libdbusmenu-glib-dev alsa-lib-dev yyjson-dev linux-pam-dev util-linux-login openssl-dev
- run: apk --no-cache add git g++ binutils pkgconf meson ninja musl-dev gtkmm4-dev vala gobject-introspection gobject-introspection-dev ddcutil pulseaudio-dev pipewire-dev wireplumber-dev libdbusmenu-glib-dev alsa-lib-dev yyjson-dev linux-pam-dev util-linux-login openssl-dev
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories
- run: apk --no-cache add wayland-protocols wayfire-dev gtk4-layer-shell-dev gtk4-layer-shell
Expand Down
6 changes: 6 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ libpulse = dependency('libpulse', required: get_option('volume-widget'))
libgvc = subproject('gvc', default_options: ['static=true'], required: get_option('volume-widget'))
pipewire = dependency('libpipewire-0.3', required: get_option('wp-mixer-widget'))
wireplumber = dependency('wireplumber-0.5', required: get_option('wp-mixer-widget'))
ddcutil = dependency('libddcutil-5', required: get_option('ddcutil'))
ddcutil = dependency('ddcutil', required: get_option('ddcutil'))
dbusmenu_gtk = dependency('dbusmenu-glib-0.4')
xkbregistry = dependency('xkbregistry')
json = subproject('wf-json').get_variable('wfjson')
Expand Down Expand Up @@ -57,6 +59,10 @@ if wireplumber.found()
add_project_arguments('-DHAVE_WIREPLUMBER=1', language: 'cpp')
endif

if ddcutil.found()
add_project_arguments('-DHAVE_DDCUTIL=1', language: 'cpp')
endif

needs_libinotify = ['freebsd', 'dragonfly'].contains(host_machine.system())
libinotify = dependency('libinotify', required: needs_libinotify)

Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ option(
value: 'auto',
description: 'Build wireplumber mixer widget',
)
option(
'ddcutil',
type: 'feature',
value: 'auto',
description: 'Build external monitor support for backlight widget'
)
option(
'wayland-logout',
type: 'boolean',
Expand Down
38 changes: 38 additions & 0 deletions metadata/panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,44 @@
</option>
</group>
<group>
<group>
<_short>Backlight</_short>
<option name="light_popup_on_change" type="bool">
<_short>Popup on change</_short>
<default>true</default>
</option>
<option name="light_popup_timeout" type="double">
<_short>Popup timeout</_short>
<default>2.5</default>
<min>0</min>
</option>
<option name="light_slider_length" type="int">
<_short>Slider length</_short>
<default>300</default>
<min>1</min>
</option>
<option name="light_scroll_sensitivity" type="double">
<_short>Scroll sensitivity</_short>
<default>1</default>
</option>
<option name="light_invert_scroll" type="bool">
<_short>Invert scroll</_short>
<_long>
Inverts which scroll direction raises and lowers display brightness
</_long>
<default>false</default>
</option>
<option name="light_spacing" type="int">
<_short>Spacing between controls</_short>
<default>8</default>
<min>0</min>
</option>
<option name="light_icon_size" type="int">
<_short>Light icon size</_short>
<default>0</default>
<min>0</min>
</option>
</group>
<_short>Notifications</_short>
<option name="notifications_autohide_timeout" type="double">
<_short>Notifications Display Timeout</_short>
Expand Down
9 changes: 9 additions & 0 deletions src/panel/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ widget_sources = [
'widgets/tray/host.cpp',
'widgets/tray/dbusmenu.cpp',
'widgets/workspace-switcher.cpp',
'widgets/backlight/backlight.cpp',
'widgets/backlight/sysfs.cpp',
]

deps = [
Expand All @@ -35,6 +37,13 @@ deps = [
json,
]

if ddcutil.found()
widget_sources += 'widgets/backlight/ddcutil.cpp'
deps += ddcutil
else
message('Libddcutil not found, light widget will not support external monitors.')
endif

if libpulse.found()
widget_sources += [
'widgets/volume.cpp',
Expand Down
13 changes: 12 additions & 1 deletion src/panel/panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#ifdef HAVE_WIREPLUMBER
#include "widgets/wp-mixer/wp-mixer.hpp"
#endif
#include "widgets/backlight/backlight.hpp"
#include "widgets/window-list/window-list.hpp"
#include "widgets/notifications/notification-center.hpp"
#include "widgets/tray/tray.hpp"
Expand Down Expand Up @@ -188,6 +189,15 @@ class WayfirePanel::impl
#endif
}

if (name == "backlight")
{
return Widget(new WayfireBacklight(output));
#ifndef HAVE_DDCUTIL
std::cout << "Built without DDC/CI support, backlight widget "
" doesn’t support external monitors." << std::endl;
#endif
}

if (name == "window-list")
{
return Widget(new WayfireWindowList(output));
Expand Down Expand Up @@ -533,7 +543,8 @@ void WayfirePanelApp::on_activate()
{"panel/wp_icon_size", ".wp-mixer"},
{"panel/wp_popup_icon_size", ".mute-toggle, .default-button"},
{"panel/notifications_icon_size", ".notification-center "},
{"panel/tray_icon_size", ".tray-button"}
{"panel/tray_icon_size", ".tray-button"},
{"panel/light_icon_size", ".light"}
};
for (auto pair : icon_sizes_args)
{
Expand Down
Loading
Loading