From 3eb14d7c76107b352c3223e9233ca9af4be70010 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 28 Apr 2009 16:21:50 +0200 Subject: [PATCH] luaa: move version and release to awesome module Signed-off-by: Julien Danjou --- awesomerc.lua.in | 2 +- common/tokenize.gperf | 1 + lib/naughty.lua.in | 5 ++--- luaa.c | 14 ++++++-------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 8d999066..f12ad822 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -90,7 +90,7 @@ end -- Create a textbox widget mytextbox = widget({ type = "textbox", align = "right" }) -- Set the default text in textbox -mytextbox.text = " " .. AWESOME_RELEASE .. " " +mytextbox.text = " " .. awesome.release .. " " -- Create a laucher widget and a main menu myawesomemenu = { diff --git a/common/tokenize.gperf b/common/tokenize.gperf index fe16a36a..19270443 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -103,6 +103,7 @@ type urgent valign visible +version vertical widgets width diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index c353388f..45ec3b5a 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -16,12 +16,11 @@ local string = string local widget = widget local button = require("awful.button") local util = require("awful.util") -local capi = { screen = screen } +local capi = { screen = screen, awesome = awesome } local bt = require("beautiful") local screen = screen local awful = awful local dbus = dbus -local AWESOME_VERSION = AWESOME_VERSION --- Notification library module("naughty") @@ -469,7 +468,7 @@ if awful.hooks.dbus then end elseif data.member == "GetServerInfo" or data.member == "GetServerInformation" then -- name of notification app, name of vender, version - return "s", "naughty", "s", "awesome", "s", AWESOME_VERSION:match("%d.%d") + return "s", "naughty", "s", "awesome", "s", capi.awesome.version:match("%d.%d") end end) diff --git a/luaa.c b/luaa.c index aea5a077..32903f9e 100644 --- a/luaa.c +++ b/luaa.c @@ -593,6 +593,12 @@ luaA_awesome_index(lua_State *L) case A_TK_BG: luaA_pushxcolor(L, &globalconf.colors.bg); break; + case A_TK_VERSION: + lua_pushliteral(L, AWESOME_VERSION); + break; + case A_TK_RELEASE: + lua_pushliteral(L, AWESOME_RELEASE); + break; default: return 0; } @@ -715,14 +721,6 @@ luaA_init(xdgHandle* xdg) /* Export keys */ luaA_openlib(L, "key", awesome_key_methods, awesome_key_meta); - lua_pushliteral(L, "AWESOME_VERSION"); - lua_pushstring(L, AWESOME_VERSION); - lua_settable(L, LUA_GLOBALSINDEX); - - lua_pushliteral(L, "AWESOME_RELEASE"); - lua_pushstring(L, AWESOME_RELEASE); - lua_settable(L, LUA_GLOBALSINDEX); - /* init hooks */ globalconf.hooks.manage = LUA_REFNIL; globalconf.hooks.unmanage = LUA_REFNIL;