Fix typos
This commit is contained in:
+26
-29
@@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
# require x-kutu library for all x11 functions
|
# Require X-kutu library for all x11 functions
|
||||||
|
|
||||||
require_relative "../src/ruby/x-kutu"
|
require_relative "../src/ruby/X-kutu"
|
||||||
|
|
||||||
|
|
||||||
# require dependencies
|
# Require dependencies
|
||||||
|
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'socket'
|
require 'socket'
|
||||||
|
|
||||||
|
|
||||||
# initialize x
|
# Initialize X
|
||||||
|
|
||||||
if x.deploy >= 0
|
if X.deploy >= 0
|
||||||
puts "started kutu wm for x11 successfully! :)"
|
puts "Started kutu WM for X11 successfully! :)"
|
||||||
else
|
else
|
||||||
raise "failed to deploy x, try running using xinit or startx."
|
raise "Failed to deploy X, try running using xinit or startx."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# require submodules
|
# Require submodules
|
||||||
|
|
||||||
require_relative "../src/ruby/utils"
|
require_relative "../src/ruby/utils"
|
||||||
require_relative "../src/ruby/controller"
|
require_relative "../src/ruby/controller"
|
||||||
@@ -28,19 +28,17 @@ require_relative "../src/ruby/window"
|
|||||||
require_relative "../src/ruby/workspace"
|
require_relative "../src/ruby/workspace"
|
||||||
require_relative "../src/ruby/events"
|
require_relative "../src/ruby/events"
|
||||||
require_relative "../src/ruby/commands"
|
require_relative "../src/ruby/commands"
|
||||||
require_relative "../src/ruby/factory"
|
|
||||||
require_relative "../src/ruby/config"
|
|
||||||
|
|
||||||
|
|
||||||
# cleanup on exit
|
# Cleanup on exit
|
||||||
|
|
||||||
at_exit do
|
at_exit do
|
||||||
x.cleanup
|
X.cleanup
|
||||||
puts "exited kutu wm, sadly :("
|
puts "Exited kutu WM, sadly :("
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# globals
|
# Globals
|
||||||
|
|
||||||
$monitors = {}
|
$monitors = {}
|
||||||
$windows = {}
|
$windows = {}
|
||||||
@@ -52,42 +50,41 @@ $mousebind_actions = {}
|
|||||||
|
|
||||||
$mouse_data = {}
|
$mouse_data = {}
|
||||||
|
|
||||||
$root = x.get_root
|
$root = X.get_root
|
||||||
$rect = {}
|
$rect = {}
|
||||||
|
|
||||||
|
|
||||||
# initialize monitors
|
# Initialize monitors
|
||||||
|
|
||||||
load_monitors!
|
load_monitors!
|
||||||
|
|
||||||
|
|
||||||
# load config
|
# Run startup script
|
||||||
|
|
||||||
load_config!
|
load_config!
|
||||||
|
|
||||||
|
# Setup unix socket
|
||||||
|
|
||||||
# setup unix socket
|
SOCK_PATH = "/tmp/kutu.sock"
|
||||||
|
File.delete SOCK_PATH if File.exist? SOCK_PATH
|
||||||
|
|
||||||
sock_path = "/tmp/kutu.sock"
|
$socket = Socket.new :UNIX, :DGRAM
|
||||||
file.delete sock_path if file.exist? sock_path
|
$socket.bind Socket.pack_sockaddr_un(SOCK_PATH)
|
||||||
|
|
||||||
$socket = socket.new :unix, :dgram
|
|
||||||
$socket.bind socket.pack_sockaddr_un(sock_path)
|
|
||||||
|
|
||||||
|
|
||||||
# main loop
|
# Main loop
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
sleep 0.001
|
sleep 0.001
|
||||||
|
|
||||||
if io.select([$socket], nil, nil, 0)
|
if IO.select([$socket], nil, nil, 0)
|
||||||
command, sender = $socket.recvfrom 1024
|
command, sender = $socket.recvfrom 1024
|
||||||
reply = handle_command command
|
reply = handle_command command
|
||||||
$socket.send json.generate(reply), 0, sender
|
$socket.send JSON.generate(reply), 0, sender
|
||||||
end
|
end
|
||||||
|
|
||||||
event_pointer = x.next_event
|
event_pointer = X.next_event
|
||||||
handle_event x.translate_event(event_pointer) if !event_pointer.null?
|
handle_event X.translate_event(event_pointer) if !event_pointer.null?
|
||||||
|
|
||||||
x.flush
|
X.flush
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user