63 lines
734 B
Ruby
Executable File
63 lines
734 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
require_relative "./src/X-kutu"
|
|
|
|
# Initialize X
|
|
|
|
if X.deploy < 0
|
|
raise "Failed to deploy X"
|
|
else
|
|
puts "Started kutu WM for X11"
|
|
end
|
|
|
|
|
|
# Require modules
|
|
|
|
require_relative "./src/utils"
|
|
require_relative "./src/node"
|
|
require_relative "./src/workspace"
|
|
require_relative "./src/events"
|
|
|
|
|
|
# Cleanup on exit
|
|
|
|
at_exit { X.cleanup }
|
|
|
|
|
|
# Globals
|
|
|
|
$monitors = {}
|
|
$workspaces = {}
|
|
$windows = {}
|
|
|
|
$keybind_actions = {}
|
|
$mousebind_actions = {}
|
|
|
|
$mouse_data = {}
|
|
|
|
$root = X.get_root
|
|
$rect = {}
|
|
|
|
|
|
# Initialize monitors
|
|
|
|
refresh_monitors!
|
|
|
|
|
|
# Add keybinds
|
|
|
|
load "./src/bindings.rb"
|
|
|
|
|
|
# Initialize workspaces
|
|
|
|
$workspaces[:main] = Workspace.new(:main)
|
|
|
|
|
|
# Main loop
|
|
|
|
loop do
|
|
event = X.wait_for_event
|
|
handle_event event
|
|
end
|