beautiful: merge awful.beautiful, stop registering system

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-13 11:53:41 +01:00
parent 863f9a78a8
commit 2e97991a90
10 changed files with 15 additions and 50 deletions

View File

@ -9,6 +9,9 @@ theme_path = "@AWESOME_THEMES_PATH@/default/theme"
-- Uncommment this for a lighter theme -- Uncommment this for a lighter theme
-- theme_path = "@AWESOME_THEMES_PATH@/sky/theme" -- theme_path = "@AWESOME_THEMES_PATH@/sky/theme"
-- Actually load theme
beautiful.init(theme_path)
-- This is used later as the default terminal and editor to run. -- This is used later as the default terminal and editor to run.
terminal = "xterm" terminal = "xterm"
editor = os.getenv("EDITOR") or "nano" editor = os.getenv("EDITOR") or "nano"
@ -64,16 +67,6 @@ apptags =
use_titlebar = false use_titlebar = false
-- }}} -- }}}
-- {{{ Initialization
-- Initialize theme (colors).
beautiful.init(theme_path)
-- Register theme in awful.
-- This allows to not pass plenty of arguments to each function
-- to inform it about colors we want it to draw.
awful.beautiful.register(beautiful)
-- }}}
-- {{{ Tags -- {{{ Tags
-- Define tags table. -- Define tags table.
tags = {} tags = {}

View File

@ -1,33 +0,0 @@
---------------------------------------------------------------------------
-- @author Julien Danjou &lt;julien@danjou.info&gt;
-- @copyright 2008 Julien Danjou
-- @release @AWESOME_VERSION@
---------------------------------------------------------------------------
local package = package
--- Beautiful module for awful
module("awful.beautiful")
-- Exported variable handling theme.
theme = {}
--- Register the beautiful theme if beautiful is used.
-- That allows various awful functions (and maybe other module using the
-- awful.beautiful.get() method) to use colors theme as defined in beautiful.
-- @param The beautiful theme.
function register(btheme)
if btheme then
theme = btheme
else
theme = {}
end
end
--- Get the current registered theme.
-- @return The current theme table.
function get()
return package.loaded.awful.beautiful.theme
end
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -4,7 +4,6 @@
-- @release @AWESOME_VERSION@ -- @release @AWESOME_VERSION@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
local beautiful = require("awful.beautiful")
local client = require("awful.client") local client = require("awful.client")
local completion = require("awful.completion") local completion = require("awful.completion")
local hooks = require("awful.hooks") local hooks = require("awful.hooks")

View File

@ -16,7 +16,7 @@ local button = button
local capi = { screen = screen, mouse = mouse, client = client } local capi = { screen = screen, mouse = mouse, client = client }
local util = require("awful.util") local util = require("awful.util")
local tags = require("awful.tag") local tags = require("awful.tag")
local awbeautiful = require("awful.beautiful") local awbeautiful = require("beautiful")
--- Menu module for awful --- Menu module for awful
module("awful.menu") module("awful.menu")

View File

@ -14,7 +14,7 @@ local capi =
keygrabber = keygrabber keygrabber = keygrabber
} }
local util = require("awful.util") local util = require("awful.util")
local beautiful = require("awful.beautiful") local beautiful = require("beautiful")
--- Prompt module for awful --- Prompt module for awful
module("awful.prompt") module("awful.prompt")

View File

@ -15,7 +15,7 @@ local capi =
button = button, button = button,
client = client, client = client,
} }
local beautiful = require("awful.beautiful") local beautiful = require("beautiful")
local hooks = require("awful.hooks") local hooks = require("awful.hooks")
local util = require("awful.util") local util = require("awful.util")
local widget = require("awful.widget") local widget = require("awful.widget")

View File

@ -18,7 +18,7 @@ local capi =
} }
local util = require("awful.util") local util = require("awful.util")
local hooks = require("awful.hooks") local hooks = require("awful.hooks")
local beautiful = require("awful.beautiful") local beautiful = require("beautiful")
local menu = require("awful.menu") local menu = require("awful.menu")
--- Widget module for awful --- Widget module for awful

View File

@ -87,6 +87,12 @@ function init(path)
end end
end end
--- Get the current theme.
-- @return The current theme table.
function get()
return package.loaded[module_name]
end
setmetatable(package.loaded[module_name], package.loaded[module_name]) setmetatable(package.loaded[module_name], package.loaded[module_name])
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -25,7 +25,7 @@
local wibox = wibox local wibox = wibox
local widget = widget local widget = widget
local awful = require("awful") local awful = require("awful")
local beautiful = require("awful.beautiful") local beautiful = require("beautiful")
local image = image local image = image
local capi = { screen = screen, mouse = mouse, keygrabber = keygrabber } local capi = { screen = screen, mouse = mouse, keygrabber = keygrabber }

View File

@ -26,7 +26,7 @@ local string = string
local widget = widget local widget = widget
local button = button local button = button
local capi = { screen = screen } local capi = { screen = screen }
local bt = require("awful.beautiful") local bt = require("beautiful")
local beautiful = bt.get() local beautiful = bt.get()
--- Notification library --- Notification library