A modern logout/shutdown dialog for Linux desktop environments, built with Rust and GTK4. This application provides a clean interface for system power management operations.
✨ Modern UI Framework: Built with relm4 and GTK4 🔧 Configurable: KDL-based configuration for easy customization ⌨️ Keyboard Support: Configurable keybindings for all actions 🖱️ Mouse Friendly: Hover-to-focus and click interactions 🏷️ Layer Shell: Uses gtk4-layer-shell for proper overlay display 🎨 Themeable: CSS-based styling support
- Lock - Lock the current session
- Logout - Terminate user session
- Shutdown - Power off the system
- Reboot - Restart the system
- Suspend - Suspend to RAM
- Hibernate - Suspend to disk
# Install dependencies (Debian/Ubuntu)
sudo apt install libgtk-4-dev libglib2.0-dev pkg-config
# Install dependencies (Arch Linux)
sudo pacman -S gtk4 glib2 pkg-config
# Clone and build
git clone https://github.com/dwapp/rwlogout.git
cd rwlogout
cargo build --release
# Build with Nix
nix build
# Or run directly
nix run
# Enter development shell (Nix)
nix develop
# Or use traditional method
nix-shell -p glib.dev pkg-config zlib cargo pango gdk-pixbuf gtk4 gtk4-layer-shell
The application is configured via the layout.kdl
file using the KDL format:
// Layout configuration for rwlogout
button "lock" {
action "loginctl lock-session"
text "Lock"
keybind "l"
}
button "shutdown" {
action "systemctl poweroff"
text "Shutdown"
keybind "s"
}
// Add more buttons as needed...
label
: Internal identifier for the buttonaction
: System command to executetext
: Display text shown on the buttonkeybind
: Single character keyboard shortcut
Commands support environment variable expansion:
$USER
- Current username- Standard shell environment variables
# Run directly
cargo run
# Or run the built binary
./target/release/rwlogout
- L - Lock screen
- E - Logout
- S - Shutdown
- R - Reboot
- U - Suspend
- H - Hibernate
- Escape - Exit application
- Click - Execute the button's action
- Hover - Automatically focus the button
- Background Click - Exit application
The application uses a modern Rust architecture:
- relm4: Reactive GUI framework built on GTK4
- KDL: Human-friendly configuration format
- gtk4-layer-shell: Wayland layer shell support for overlay display
- Dynamic UI: Buttons generated from configuration file
src/
├── main.rs # Main application and UI logic
├── config.rs # Configuration parsing and command execution
└── style.css # UI styling
layout.kdl # Button configuration
The application supports CSS-based theming via src/style.css
. You can customize:
- Button appearance and colors
- Layout spacing and sizing
- Hover and focus effects
- Font and typography
The application uses gtk4-layer-shell for proper integration with Wayland compositors. It will:
- Display as an overlay on all screens
- Grab keyboard focus when shown
- Handle layer shell protocols correctly
On X11 systems, it falls back to standard fullscreen window behavior.
The application follows the Model-View-Update (MVU) pattern via relm4:
- Model: Application state and configuration
- View: Declarative UI definition
- Update: Message handling for user interactions
- Dynamic UI Generation: Buttons are created based on configuration
- Message-Driven: All interactions go through the message system
- Automatic Cleanup: Application exits after executing commands
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- wlogout - Original inspiration
- wleave - Alternative Wayland logout menu
- pwrmenu - Power menu for window managers
- rlogout - Rust-based logout utility
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with relm4 reactive GUI framework
- Uses KDL for configuration
- Inspired by the original wlogout project
This project serves as both a practical utility and a learning exercise for Rust and modern GTK4 development.