1 # Copyright 2008 Dag Odenhall <dag.odenhall@gmail.com>
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
19 # Communicate with awesome
21 # awesome = Awesome.new
22 # awesome.widget_tell(0, widget_id, "Hello, world")
23 # awesome = Awesome.new(1)
24 # awesome.tag_view(0, 3)
25 # Awesome.new.client_zoom
27 attr_accessor :screen, :display
29 def initialize(display=0)
33 def method_missing(uicb, screen=0, *args)
34 data = "#{screen} #{uicb} #{args.join(' ')}\n"
42 @socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0)
43 @socket.connect(Socket.sockaddr_un("#{ENV["HOME"]}/.awesome_ctl.#@display"))