Clean the config code.

awesome-3.5
Kolan Sh 2014-08-15 22:09:19 +04:00
parent 6433c95d6a
commit 271a7c9977
6 changed files with 0 additions and 190 deletions

View File

@ -1,50 +0,0 @@
-- {{{ init environment
local wakka = {}
local capi = {
mouse = mouse,
screen = screen
}
-- {{{ display
-- formats the lines for the notify
local function display()
local lines = "<u>Bitcoin:</u>\n"
local tick = "<u>MtGox:</u>\n"
local f = io.popen("bitcoind getbalance", "r")
local t = io.popen("curl -q -s https://mtgox.com/code/data/ticker.php", "r")
local s = f:read('*all')
local g = t:read('*all')
line = lines .. "\n" .. s .. "\n"
ticker = tick .. "\n" .. g .. "\n"
f:close()
t:close()
-- return line, ticker
return string.format('%s%s',line, ticker)
end
--local function ticker()
-- local ticker = "<u>Ticker:</u>\n"
-- local t = io.popen("curl -q -s https://mtgox.com/code/data/ticker.php", "r")
-- local q = t:read('*all')
-- line1 = ticker .. "\n" .. q .. "\n"
-- t:close()
-- return line1
--end
-- }}}
-- }}}
function wakka.addToWidget(mywidget)
mywidget:add_signal('mouse::enter', function ()
run_display = display()
usage = naughty.notify({
text = string.format('<span font_desc="%s">%s</span>', "monospace", run_display),
timeout = 0,
hover_timeout = 0.5,
screen = capi.mouse.screen
})
end)
mywidget:add_signal('mouse::leave', function () naughty.destroy(usage) end)
end
return wakka

View File

@ -1,33 +0,0 @@
-- {{{ init environment
local wakka = {}
local capi = {
mouse = mouse,
screen = screen
}
-- {{{ display
-- formats the lines for the notify
local function display()
local lines = "<u>Namecoin:</u>\n"
local f = io.popen("namecoind getbalance", "r")
local s = f:read('*all')
line = lines .. "\n" .. s .. "\n"
f:close()
return line
end
-- }}}
-- }}}
function wakka.addToWidget(mywidget)
mywidget:add_signal('mouse::enter', function ()
usage = naughty.notify({
text = string.format('<span font_desc="%s">%s</span>', "monospace", display()),
timeout = 0,
hover_timeout = 0.5,
screen = capi.mouse.screen
})
end)
mywidget:add_signal('mouse::leave', function () naughty.destroy(usage) end)
end
return wakka

View File

@ -1,34 +0,0 @@
-- {{{ init environment
local wakka = {}
local capi = {
mouse = mouse,
screen = screen
}
-- {{{ display
-- formats the lines for the notify
local function display()
local lines = "<u>Pacman Updates:</u>\n"
local f = io.popen("sudo emerge -uavDN world", "r")
local s = f:read('*all')
line = "Total:" s
print(line)
f:close()
return line
end
-- }}}
-- }}}
function wakka.addToWidget(mywidget)
mywidget:add_signal('mouse::enter', function ()
usage = naughty.notify({
text = string.format('<span font_desc="%s">%s</span>', "monospace", display()),
timeout = 0,
hover_timeout = 0.5,
screen = capi.mouse.screen
})
end)
mywidget:add_signal('mouse::leave', function () naughty.destroy(usage) end)
end
return wakka

View File

@ -1,33 +0,0 @@
-- {{{ init environment
local wakka = {}
local capi = {
mouse = mouse,
screen = screen
}
-- {{{ display
-- formats the lines for the notify
local function display()
local lines = "<u>AUR Updates:</u>\n"
local f = io.popen("archey", "r")
local s = f:read('*all')
line = lines .. "\n" .. s .. "\n"
f:close()
return line
end
-- }}}
-- }}}
function wakka.addToWidget(mywidget)
mywidget:add_signal('mouse::enter', function ()
usage = naughty.notify({
text = string.format('<span font_desc="%s">%s</span>', "monospace", display()),
timeout = 0,
hover_timeout = 0.5,
screen = capi.mouse.screen
})
end)
mywidget:add_signal('mouse::leave', function () naughty.destroy(usage) end)
end
return wakka

View File

@ -1,36 +0,0 @@
import pycurl
import cStringIO
exchange_url ='https://mtgox.com/code/data/ticker.php'
item_number = 6
final = []
def cut_the_crap(stuff):
i = 0
while i < item_number:
firstquote = stuff.find('"')
secondquote = stuff.find('"',firstquote+1)
keeper = stuff[firstquote+1:secondquote]
stuff = stuff[secondquote+1:]
final.append(keeper)
i = i + 1
return final
buf = cStringIO.StringIO()
c = pycurl.Curl()
c.setopt(c.URL, exchange_url)
c.setopt(c.WRITEFUNCTION, buf.write)
c.perform()
latest = buf.getvalue()
cut_the_crap(latest)
last = final[0] + ':$' + final[1] + ' '
bid = final[2] + ':$' + final[3] + ' '
ask = final[4] + ':$' + final[5]
print last
print bid
print ask
buf.close()

4
wi.lua
View File

@ -85,10 +85,6 @@ vicious.register(cpu, vicious.widgets.cpu, '<span color="#677ecc"> $1%</span>',
----< Disk Usage >----------------------------------------------------
--
diskwidget = wibox.widget.textbox()
diskwidget:set_text("test")
disk = require("diskusage")
disk.addToWidget(diskwidget, 75, 90, false)
diskicon = wibox.widget.imagebox()
diskicon:set_image(beautiful.widget_disk)
disk = wibox.widget.textbox()