#!/usr/bin/env ruby # Require X-kutu library for all x11 functions require_relative "./src/ruby/X-kutu" # Initialize X if X.deploy >= 0 puts "Started kutu WM for X11 successfully! :)" else raise "Failed to deploy X" end # Require modules load File.join(__dir__, "./src/ruby/utils.rb") load File.join(__dir__, "./src/ruby/controller.rb") load File.join(__dir__, "./src/ruby/window.rb") load File.join(__dir__, "./src/ruby/workspace.rb") load File.join(__dir__, "./src/ruby/events.rb") # Cleanup on exit at_exit do X.cleanup puts "Exited kutu WM, sadly :(" end # Globals $monitors = {} $windows = {} $keybind_actions = {} $mousebind_actions = {} $mouse_data = {} $root = X.get_root $rect = {} # Initialize monitors load_monitors! # Run startup script run File.join(__dir__, "./src/shell/startup.sh") # Add keybinds load File.join(__dir__, "./src/ruby/bindings.rb") # Main loop loop do event = X.wait_for_event handle_event event end