A comprehensive session management service for Hyprland with UWSM integration, designed for the Omarchy ecosystem.
Hyprsechy is a Rust-based daemon that automatically captures and restores Hyprland window sessions. It tracks workspace layouts, window positions, and application states, providing seamless session restoration across system restarts or Hyprland reloads.
- Automatic Session Capture: Real-time monitoring of workspace and window changes
- Session Restoration: Interactive TUI for restoring previous sessions on startup
- UWSM Integration: Full compatibility with Universal Wayland Session Manager
- Walker Integration: Desktop entry discovery and application launching
- Systemd Service: Runs as a user service with proper lifecycle management
- Workspace layout preservation
- Window positioning and sizing
- Application command tracking
- Monitor configuration support
- Multi-workspace session handling
- Daemon Commands: CLI interface for session operations
- Restore TUI: Interactive terminal interface for session restoration
- Desktop Integration: Launcher-accessible TUI applications
- Hyprland window manager
- Rust toolchain (for building from source)
- UWSM (Universal Wayland Session Manager)
- systemd user services support
git clone https://github.com/ngodn/hyprsechy
cd hyprsechy
./install.shThe install script will:
- Build the project with Cargo
- Install binaries to
~/.local/bin/ - Set up systemd user service
- Create configuration directories
- Register TUI applications
- Auto-detect user environment settings
cargo build --release
cp target/release/hyprsechy ~/.local/bin/
cp target/release/hyprsechy-restore ~/.local/bin/# Check service status
systemctl --user status hyprsechy.service
# Start/stop service
systemctl --user start hyprsechy.service
systemctl --user stop hyprsechy.service
# View logs
journalctl --user -u hyprsechy.service -f# Save current session manually
hyprsechy save
# List saved sessions
hyprsechy list
# Restore session (CLI)
hyprsechy restore
# Interactive restore TUI
hyprsechy-restoreConfiguration file: ~/.config/hyprsechy/config.toml
User environment: ~/.config/hyprsechy/user-env.toml
Session data: ~/.local/share/hyprsechy/session.json
Main Daemon (src/main.rs)
- Service lifecycle management
- Session loading and TUI launching
- Command-line interface
Session Manager (src/session.rs)
- Workspace and window state capture
- Application restoration logic
- UWSM app integration
Hyprland Integration (src/hyprland.rs)
- IPC socket communication
- Event listening and command dispatch
- Window and workspace queries
UWSM Integration (src/uwsm.rs)
- Application launching and tracking
- Systemd unit management
- Desktop entry processing
Restore TUI (src/restore_tui.rs)
- Interactive session restoration
- Terminal-based user interface
- Session preview and selection
Configuration (src/config.rs)
- TOML-based configuration management
- Default settings and validation
Walker Integration (src/walker.rs)
- Desktop entry discovery
- Application metadata extraction
Types (src/types.rs)
- Core data structures
- Session state definitions
Error Handling (src/error.rs)
- Structured error types
- Error context and reporting
Installation Scripts
install.sh: Complete installation and setupuninstall.sh: Clean removal with backup options
TUI Management
scripts/hyprsechy-tui-install: Register TUI applicationsscripts/hyprsechy-tui-remove: Unregister TUI applicationsscripts/launch-restore-tui.sh: Environment-aware TUI launcher
SystemD user service (hyprsechy.service) provides:
- Automatic startup with Hyprland session
- Proper environment variable handling
- Restart on failure with backoff
- Integration with Wayland session lifecycle
Sessions are stored in JSON format containing:
- Workspaces: Layout, windows, and monitor assignments
- Windows: Position, size, class, title, and commands
- UWSM Apps: Application state for restoration
- Monitor Configuration: Display setup and scaling
- Metadata: Timestamps and session identification
- Desktop entry pattern compatibility
- TUI window class conventions (TUI.float, TUI.tile)
- Launcher integration via desktop files
- Consistent user experience patterns
- Automatic app detection via systemd
- Proper service lifecycle management
- Desktop entry-based launching
- Environment variable inheritance
- Real-time event monitoring
- Workspace and window management
- Monitor configuration tracking
- Dynamic environment adaptation
Registered desktop applications for launcher access:
Hyprsechy Session Restore
- Interactive session restoration
- Session preview and selection
- Floating window interface
Hyprsechy Config (Future)
- Configuration management interface
- Settings adjustment and validation
cargo build --releasecargo testsrc/: Rust source codescripts/: Shell scripts for installation and TUI managementtarget/: Build artifacts (gitignored)
Service Not Starting
- Check Hyprland is running:
echo $HYPRLAND_INSTANCE_SIGNATURE - Verify binary installation:
which hyprsechy - Check service logs:
journalctl --user -u hyprsechy.service
TUI Not Launching
- Ensure proper environment variables in launch script
- Check terminal availability in user-env.toml
- Verify hyprsechy-restore binary exists
Session Restoration Issues
- Validate session.json format
- Check application availability
- Review UWSM integration logs
Service logs provide detailed information about:
- Session capture and save operations
- TUI launch attempts and completion
- Application restoration status
- Error conditions and recovery
./uninstall.shThe uninstall script provides options for:
- Keep Everything: Preserve configuration and data
- Backup and Remove: Create compressed backup before removal
- Complete Removal: Remove all files and data
MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Configuration TUI interface
- Session management improvements
- Additional application integration
- Performance optimizations
- Extended monitor support

