From 00f5f3ed9df79c86a266f3c8e2e0388f84216287 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 1 Nov 2014 23:10:02 +0100 Subject: Only use avandu on drd, add dependency file --- awesome/.config/awesome/awesomerc-1-1.rockspec | 22 ++++++++++++++ awesome/.config/awesome/rc.lua | 41 ++++++++++++++++---------- 2 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 awesome/.config/awesome/awesomerc-1-1.rockspec diff --git a/awesome/.config/awesome/awesomerc-1-1.rockspec b/awesome/.config/awesome/awesomerc-1-1.rockspec new file mode 100644 index 0000000..019d9a3 --- /dev/null +++ b/awesome/.config/awesome/awesomerc-1-1.rockspec @@ -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" + } +} diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index a25629b..182927c 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -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 + +if hostname == "drd" then + package.path = + '/home/slash/projects/avandu-lua/lua/?.lua;' .. package.path -local avandu = require 'avandu' + 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 '?') .. " ") -myrsslisttimer = timer({ timeout = 60 }) -myrsslisttimer:connect_signal( - "timeout", - function () - myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " ") - end -) -myrsslisttimer:start() +if avandu then + myrsslist = wibox.widget.textbox() + myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " ") + myrsslisttimer = timer({ timeout = 60 }) + myrsslisttimer:connect_signal( + "timeout", + function () + myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " ") + 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()) -- cgit v1.2.3-54-g00ecf