add workspace indicators

This commit is contained in:
2025-12-09 22:53:29 +01:00
parent 25c73f67a7
commit d53dfa27f1
8 changed files with 501 additions and 132 deletions

View File

@@ -1,5 +1,7 @@
#include "app.hpp"
#include <exception>
#include <iostream>
#include <sigc++/sigc++.h>
App::App() {
@@ -15,11 +17,18 @@ App::App() {
auto monitor = std::dynamic_pointer_cast<Gdk::Monitor>(
monitors->get_object(i));
if (monitor) {
auto hyprlanMonitor = this->hyprlandService.getMonitorById(i);
HyprlandService::Monitor* hyprlandMonitor = nullptr;
try {
hyprlandMonitor = this->hyprlandService.getMonitorByIndex(i);
} catch (const std::exception &ex) {
std::cerr << "[App] Failed to fetch Hyprland monitor: " << ex.what() << std::endl;
continue;
}
auto bar = new Bar(monitor->gobj(), this->hyprlandService, hyprlandMonitor->id);
this->hyprlandService.printMonitor(*hyprlandMonitor); // Debugging output
auto bar = new Bar(monitor->gobj(), hyprlanMonitor);
this->hyprlandService.printMonitor(*hyprlanMonitor); // Debugging output
bar->set_application(app);
bar->show();
bars.push_back(bar);