diff --git a/src/main.cpp b/src/main.cpp index 54bcbc9..66042de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,47 +30,48 @@ std::vector split(std::string s, char delimiter) int main(int argc, char *argv[]) { - // dmenu::DEVec apps = dmenu::get_dmenu_app_data(); - // for (auto &app : *apps.get()) - // { - // std::cout << std::format("---\nName: {}\nID: {}\nIcon: {}\nExec: {}\nDisp: {}\n---\n", app.id, app.name, app.iconPath(), app.exec, app.display ? "yes" : "no"); - // } - - QGuiApplication app(argc, argv); - QCoreApplication::setApplicationName("waycast"); - - // Enable system theme support - app.setDesktopSettingsAware(true); - - QQmlApplicationEngine engine; - - // Register the AppListModel type with QML - qmlRegisterType("WayCast", 1, 0, "AppListModel"); - - // Set up layer shell before creating any windows - QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() - { QCoreApplication::exit(-1); }); - - engine.loadFromModule("WayCast", "Main"); - - // Get the root objects and configure layer shell - auto rootObjects = engine.rootObjects(); - if (!rootObjects.isEmpty()) + dmenu::DEVec apps = dmenu::get_dmenu_app_data(); + for (auto &app : *apps.get()) { - QWindow *window = qobject_cast(rootObjects.first()); - if (window) - { - LayerShellQt::Window *layerWindow = LayerShellQt::Window::get(window); - if (layerWindow) - { - layerWindow->setLayer(LayerShellQt::Window::LayerTop); - layerWindow->setAnchors({}); - layerWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityOnDemand); - - // Now show the window after layer shell is configured - window->show(); - } - } + std::cout << app.iconPath() << std::endl; + // std::cout << std::format("---\nName: {}\nID: {}\nIcon: {}\nExec: {}\nDisp: {}\n---\n", app.id, app.name, app.iconPath(), app.exec, app.display ? "yes" : "no"); } - return app.exec(); + + // QGuiApplication app(argc, argv); + // QCoreApplication::setApplicationName("waycast"); + + // // Enable system theme support + // app.setDesktopSettingsAware(true); + + // QQmlApplicationEngine engine; + + // // Register the AppListModel type with QML + // qmlRegisterType("WayCast", 1, 0, "AppListModel"); + + // // Set up layer shell before creating any windows + // QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() + // { QCoreApplication::exit(-1); }); + + // engine.loadFromModule("WayCast", "Main"); + + // // Get the root objects and configure layer shell + // auto rootObjects = engine.rootObjects(); + // if (!rootObjects.isEmpty()) + // { + // QWindow *window = qobject_cast(rootObjects.first()); + // if (window) + // { + // LayerShellQt::Window *layerWindow = LayerShellQt::Window::get(window); + // if (layerWindow) + // { + // layerWindow->setLayer(LayerShellQt::Window::LayerTop); + // layerWindow->setAnchors({}); + // layerWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityOnDemand); + + // // Now show the window after layer shell is configured + // window->show(); + // } + // } + // } + // return app.exec(); }