Only use avandu on drd, add dependency file

This commit is contained in:
Tom Willemse 2014-11-01 23:10:02 +01:00
parent df9f1f278b
commit 00f5f3ed9d
2 changed files with 47 additions and 16 deletions

View file

@ -0,0 +1,22 @@
package = "AwesomeRC"
version = "1-1"
description = {
license = "GPL-3"
}
source = {
url = "file://rc.lua"
}
dependencies = {
"luafilesystem",
"luaposix"
}
build = {
type = "builtin",
modules = {
rc = "rc.lua"
}
}

View file

@ -13,13 +13,17 @@ local menubar = require("menubar")
local lfs = require("lfs")
local posix = require("posix")
package.path =
'/home/slash/projects/avandu-lua/lua/?.lua;' .. package.path
local hostname = posix.uname("%n")
local avandu = nil
local avandu = require 'avandu'
if hostname == "drd" then
package.path =
'/home/slash/projects/avandu-lua/lua/?.lua;' .. package.path
avandu = require 'avandu'
end
local maildir_base = os.getenv("HOME") .. "/documents/mail/"
local hostname = posix.uname("%n")
function new_mail(maildir)
local count = 0
@ -81,7 +85,10 @@ end
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init("/usr/share/awesome/themes/default/theme.lua")
avandu.ttrss_url = "https://ryuslash.org/tt-rss/api/"
if avandu then
avandu.ttrss_url = "https://ryuslash.org/tt-rss/api/"
end
-- This is used later as the default terminal and editor to run.
terminal = "urxvtc"
@ -212,16 +219,18 @@ mymaillisttimer:connect_signal(
end)
mymaillisttimer:start()
myrsslist = wibox.widget.textbox()
myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " <span face=\"FontAwesome\"></span>")
myrsslisttimer = timer({ timeout = 60 })
myrsslisttimer:connect_signal(
"timeout",
function ()
myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " <span face=\"FontAwesome\"></span>")
end
)
myrsslisttimer:start()
if avandu then
myrsslist = wibox.widget.textbox()
myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " <span face=\"FontAwesome\"></span>")
myrsslisttimer = timer({ timeout = 60 })
myrsslisttimer:connect_signal(
"timeout",
function ()
myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " <span face=\"FontAwesome\"></span>")
end
)
myrsslisttimer:start()
end
function unlocked()
if awful.util.pread("gkeyring -1 --name unlocked") == "true" then
@ -282,7 +291,7 @@ for s = 1, screen.count() do
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
if s == 1 then
right_layout:add(myrsslist)
if avandu then right_layout:add(myrsslist) end
right_layout:add(mymaillist)
right_layout:add(mykeyringlist)
right_layout:add(wibox.widget.systray())