1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Copyright (C) 2026 ac5307
// SPDX-License-Identifier: GPL-3.0-or-later
//! **Roguauto** is a lightweight and configurable power-menu daemon for Wayland, written in Rust.
//!
//! The application runs as a persistent per-user daemon and displays a native
//! [`wlr-layer-shell`](https://wayland.app/protocols/wlr-layer-shell-unstable-v1)
//! overlay when requested through its local ipc interface.
//!
//! # App features
//!
//! - Lock, suspend, hibernate, reboot, shut down, and log out.
//! - Native Wayland rendering without GTK or inheritance from the system theme.
//! - A fully application-controlled visual style.
//! - TOML configuration with filesystem-based hot reloading.
//! - Keyboard and pointer navigation.
//! - A persistent system D-Bus connection to systemd-logind.
//! - A simple Unix-domain-socket daemon interface.
//!
//! # Compatibility
//!
//! The compositor must support the `wlr-layer-shell` protocol.
//!
//! The application was developed and tested primarily on [Niri](https://github.com/niri-wm/niri).
//! Other compositors implementing `wlr-layer-shell`, including
//! Hyprland, Sway, Labwc, KWin, etc, are expected to work.
//!
//! GNOME Shell does not currently expose `wlr-layer-shell`, so it's not supported.
//!
//! Power operations additionally require **Linux**, a working system D-Bus,
//! and systemd-logind. Some actions may require authorization through
//! PolicyKit.
//!
//! # Usage
//!
//! The daemon is started with:
//!
//! ```text
//! rogu daemon [-c <file> | --config <file>]
//! ```
//!
//! A second invocation controls the running daemon:
//!
//! ```text
//! rogu show
//! rogu hide
//! rogu toggle
//! rogu quit
//! ```
//!
//! # Architecture
//!
//! The main thread runs a Calloop event loop responsible for:
//!
//! - Wayland and Smithay Client Toolkit events,
//! - keyboard and pointer input,
//! - shared-memory buffer management,
//! - rendering,
//! - configuration reload notifications.
//!
//! A Tokio runtime handles asynchronous work such as:
//!
//! - systemd-logind calls through [`zbus`],
//! - daemon IPC,
//! - other background I/O.
//!
//! Results from asynchronous tasks are returned to the main thread
//! through a Calloop channel. Wayland objects remain confined to the
//! Calloop thread.
//!
//! # Rendering
//!
//! The menu is rendered using shared-memory buffers with [`Tiny Skia`](tiny_skia).
//! [`Cosmic Text`](cosmic_text) performs text shaping and glyph rasterization, while
//! embedded SVG assets provide scalable action icons.
//!
//! The renderer does not use GTK and therefore does not inherit the
//! user's GTK theme. Colors, dimensions, typography, spacing, and corner
//! radii are controlled by the application's configuration.
use ;
const NAMESPACE: &str = env!;