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.
20 def initialize_threads
24 def initialize_encoding
29 @log = Logger.new(STDOUT)
32 def initialize_options
33 @options = Options.new(@args)
36 def initialize_display
38 @display = X11::DisplayName.new
40 rescue X11::EmptyDisplayName => e
41 @log.warn("#{e.message}, falling back on :0")
42 @display = X11::DisplayName.new(":0")
44 rescue X11::InvalidDisplayName => e
45 @log.fatal("#{e.message}, exiting")
51 def initialize_awesome
52 @awesome = Awesome.new(@display.display)
56 at_exit { Thread.list.each {|t| t.exit } }