mirror of
https://github.com/rad4day/Waybar.git
synced 2025-09-18 16:32:32 +02:00
feat: init repo
This commit is contained in:
30
src/main.cpp
Normal file
30
src/main.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <gtkmm.h>
|
||||
#include <wayland-client.hpp>
|
||||
#include <gdk/gdkwayland.h>
|
||||
#include <csignal>
|
||||
#include "client.hpp"
|
||||
|
||||
namespace waybar {
|
||||
static Client* client;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
try {
|
||||
waybar::Client c(argc, argv);
|
||||
waybar::client = &c;
|
||||
std::signal(SIGUSR1, [] (int signal) {
|
||||
for (auto& bar : waybar::client->bars) {
|
||||
bar.toggle();
|
||||
}
|
||||
});
|
||||
|
||||
return c.main(argc, argv);
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
return 1;
|
||||
} catch (const Glib::Exception& e) {
|
||||
std::cerr << e.what().c_str() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user