Skip to content

Commit

Permalink
Fix merge conflict with #2930
Browse files Browse the repository at this point in the history
  • Loading branch information
alttabber committed Feb 28, 2024
2 parents 9ea4704 + 3a33c0b commit d9abc08
Show file tree
Hide file tree
Showing 69 changed files with 1,328 additions and 1,398 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CheckOptions:
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
- { key: readability-identifier-naming.VariableCase, value: camelBack }
- { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ }
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
Expand Down
65 changes: 65 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
bug:
- "(crash|bug|error|coredump|freeze|segfault|issue|problem)"

enhancement:
- "(feature|enhancement|improvement|request|suggestion)"

hyprland:
- "(hyprland)"

network:
- "(network|wifi|ethernet)"

bluetooth:
- "(bluetooth|bluez)"

sway:
- "(sway)"

cpu:
- "(cpu)"

memory:
- "(memory|ram)"

disk:
- "(disk|storage)"

battery:
- "(upower|battery)"

sni:
- "(sni|tray)"

dwl:
- "(dwl)"

custom:
- "(custom|module|extension|plugin|script)"

mpd:
- "(mpd|music)"

audio:
- "(pulseaudio|alsa|jack|audio|pirewire|wireplumber)"

temperature:
- "(temperature|thermal|hwmon)"

clock:
- "(clock|time|date)"

gamemode:
- "(gamemode|game|gaming)"

inhibitor:
- "(inhibitor|idle|lock|suspend|hibernate|logout)"

cava:
- "(cava|audio-visualizer)"

backlight:
- "(backlight|brightness)"

keyboard:
- "(keyboard|keymap|layout|shortcut)"
18 changes: 11 additions & 7 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: clang-format

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-format-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.16.2
name: clang-format
with:
source: '.'
extensions: 'hpp,h,cpp,c'
clangFormatVersion: 16
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.16.2
name: clang-format
with:
source: "."
extensions: "hpp,h,cpp,c"
clangFormatVersion: 16
10 changes: 9 additions & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: clang-tidy

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-tidy-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -13,7 +17,11 @@ jobs:
run: |
meson -Dcpp_std=c++20 build # necessary to generate compile_commands.json
ninja -C build # necessary to find certain .h files (xdg, wayland, etc.)
- uses: cpp-linter/cpp-linter-action@v2.7.5
- uses: actions/setup-python@v5
with:
python-version: '3.10' # to be kept in sync with cpp-linter-action
update-environment: true # the python dist installed by the action needs LD_LIBRARY_PATH to work
- uses: cpp-linter/cpp-linter-action@v2.9.1
name: clang-tidy
id: clang-tidy-check
env:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: freebsd

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-freebsd-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
clang:
# Run actions in a FreeBSD VM on the macos-12 runner
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Issue Labeler"
on:
issues:
types: [opened, edited]

permissions:
issues: write
contents: read

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3.4
with:
configuration-path: .github/labeler.yml
enable-versioned-regex: 0
include-title: 1
repo-token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: linux

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
Expand All @@ -14,9 +18,6 @@ jobs:
- opensuse
- gentoo
cpp_std: [c++20]
include:
- distro: fedora
cpp_std: c++20

runs-on: ubuntu-latest
container:
Expand Down
52 changes: 44 additions & 8 deletions Dockerfiles/debian
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,47 @@
FROM debian:sid

RUN apt update && \
apt install -y \
build-essential meson ninja-build git pkg-config libinput10 libpugixml-dev libinput-dev \
wayland-protocols libwayland-client0 libwayland-cursor0 libwayland-dev \
libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libxkbcommon-dev libudev-dev libpixman-1-dev \
libgtkmm-3.0-dev libjsoncpp-dev scdoc libdbusmenu-gtk3-dev libnl-3-dev libnl-genl-3-dev \
libpulse-dev libmpdclient-dev gobject-introspection libgirepository1.0-dev libxkbcommon-dev \
libxkbregistry-dev libxkbregistry0 libplayerctl-dev sudo python3-venv python3-pip && \
apt clean
apt install --no-install-recommends --no-install-suggests -y \
build-essential \
catch2 \
cmake \
git \
gobject-introspection \
libdbusmenu-gtk3-dev \
libegl1-mesa-dev \
libfmt-dev \
libgbm-dev \
libgirepository1.0-dev \
libgles2-mesa-dev \
libgtk-layer-shell-dev \
libgtkmm-3.0-dev \
libhowardhinnant-date-dev \
libiniparser-dev \
libinput-dev \
libjack-jackd2-dev \
libjsoncpp-dev \
libmpdclient-dev \
libnl-3-dev \
libnl-genl-3-dev \
libpixman-1-dev \
libplayerctl-dev \
libpugixml-dev \
libpulse-dev \
libsndio-dev \
libspdlog-dev \
libudev-dev \
libupower-glib-dev \
libwayland-dev \
libwireplumber-0.4-dev \
libxkbcommon-dev \
libxkbregistry-dev \
locales \
meson \
ninja-build \
pkg-config \
python3-pip \
python3-venv \
scdoc \
sudo \
wayland-protocols \
&& apt clean
2 changes: 2 additions & 0 deletions include/AModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace waybar {

class AModule : public IModule {
public:
static constexpr const char *MODULE_CLASS = "module";

virtual ~AModule();
auto update() -> void override;
virtual auto refresh(int) -> void{};
Expand Down
32 changes: 10 additions & 22 deletions include/bar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,18 @@ class BarIpcClient;
}
#endif // HAVE_SWAY

class BarSurface {
protected:
BarSurface() = default;

public:
virtual void setExclusiveZone(bool enable) = 0;
virtual void setLayer(bar_layer layer) = 0;
virtual void setMargins(const struct bar_margins &margins) = 0;
virtual void setPassThrough(bool enable) = 0;
virtual void setPosition(const std::string_view &position) = 0;
virtual void setSize(uint32_t width, uint32_t height) = 0;
virtual void commit(){};

virtual ~BarSurface() = default;
};

class Bar {
public:
using bar_mode_map = std::map<std::string_view, struct bar_mode>;
using bar_mode_map = std::map<std::string, struct bar_mode>;
static const bar_mode_map PRESET_MODES;
static const std::string_view MODE_DEFAULT;
static const std::string_view MODE_INVISIBLE;
static const std::string MODE_DEFAULT;
static const std::string MODE_INVISIBLE;

Bar(struct waybar_output *w_output, const Json::Value &);
Bar(const Bar &) = delete;
~Bar();

void setMode(const std::string_view &);
void setMode(const std::string &mode);
void setVisible(bool visible);
void toggle();
void handleSignal(int);
Expand All @@ -89,8 +73,9 @@ class Bar {
Json::Value config;
struct wl_surface *surface;
bool visible = true;
bool vertical = false;
Gtk::Window window;
Gtk::Orientation orientation = Gtk::ORIENTATION_HORIZONTAL;
Gtk::PositionType position = Gtk::POS_TOP;

int x_global;
int y_global;
Expand All @@ -106,6 +91,8 @@ class Bar {
void setupAltFormatKeyForModule(const std::string &module_name);
void setupAltFormatKeyForModuleList(const char *module_list_name);
void setMode(const bar_mode &);
void setPassThrough(bool passthrough);
void setPosition(Gtk::PositionType position);
void onConfigure(GdkEventConfigure *ev);
void configureGlobalOffset(int width, int height);
void onOutputGeometryChanged();
Expand All @@ -115,8 +102,9 @@ class Bar {
std::string last_mode_{MODE_DEFAULT};

struct bar_margins margins_;
uint32_t width_, height_;
bool passthrough_;

std::unique_ptr<BarSurface> surface_impl_;
Gtk::Box left_;
Gtk::Box center_;
Gtk::Box right_;
Expand Down
2 changes: 0 additions & 2 deletions include/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "util/css_reload_helper.hpp"
#include "util/portal.hpp"

struct zwlr_layer_shell_v1;
struct zwp_idle_inhibitor_v1;
struct zwp_idle_inhibit_manager_v1;

Expand All @@ -26,7 +25,6 @@ class Client {
Glib::RefPtr<Gdk::Display> gdk_display;
struct wl_display *wl_display = nullptr;
struct wl_registry *registry = nullptr;
struct zwlr_layer_shell_v1 *layer_shell = nullptr;
struct zxdg_output_manager_v1 *xdg_output_manager = nullptr;
struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr;
std::vector<std::unique_ptr<Bar>> bars;
Expand Down
Loading

0 comments on commit d9abc08

Please sign in to comment.