You are not logged in.
Thank you doug
Offline
Much appreciated, thank you
Offline
@TheImmortalPhoenix
Can you share how you feed the gmail widget?
Offline
jnor wrote:TheImmortalPhoenix wrote:Almost the same configuration:
http://s13.postimage.org/bqu259o2r/2012_06_06_002454_1600x900_scrot.jpg
Any chance you could upload this to your deviant art collection ? I can't seem to locate it Looks very good!
I just have a similar shot in my gallery...tell me what you want and i'll provide it to you
@ ibrunton: here you go:
muttrc
account config example
colors
Xdefaults
Thanks!
For some reason I can't get the pipes in the index_format to join together vertically, even using the same font (Tamsyn).
Offline
Try copying this symbol: │
@theGunslinger: I put in my home a file named .netrc with this in it:
machine mail.google.com login example@gmail.com password ****
But i don't know how to handle multiple accounts...Maybe anyone here does know how to do...
Last edited by TheImmortalPhoenix (2012-06-09 22:59:14)
Offline
Try copying this symbol: │
Sweet, that did it. Thanks!
Offline
@theGunslinger: I put in my home a file named .netrc with this in it:
machine mail.google.com login example@gmail.com password ****
But i don't know how to handle multiple accounts...Maybe anyone here does know how to do...
I hacked a version of the gmail widget to take an argument that is the path to a netrc-type file: here. It's not entirely elegant, and there may be a way to define multiple gmail accounts in the same (default) netrc file, but I didn't look into that.
You construct the widget like this in your rc.lua:
require ("gmail.lua")
mygmail = widget ({ type = "textbox" })
vicious.register (mygmail, vicious.widgets.gmail_custom,
function (widget, args)
--formatting fuction of your choice
end, 300, { netrcfile = "/path/to/netrc_file", inbox = "/path/to/inbox_file" })
There are 3 lines in the function that write the inbox to a local file (the "inbox" argument above); if you have no use for this (I use it so I can check the subject lines of waiting messages), just comment these out:
local fout = io.open (warg.inbox)
fout:write (f:read ("*a"), "w+")
fout:close ()
Last edited by ibrunton (2012-06-09 23:27:33)
Offline
Offline
Nice! Could you share you hard drive widget?
@ibrunton: your widget doesn't work for me...i don't know why, when i restart awesome it comes back to the default settings (blue shit zenburn theme)
I'd like to create a tooltip for the battery widget that shows me the output of "acpi -V" when i go with the mouse over it...i don't know how to do...is there anyone who could make it for me please?
Offline
I'd like to create a tooltip for the battery widget that shows me the output of "acpi -V" when i go with the mouse over it...i don't know how to do...is there anyone who could make it for me please?
I wrote a battery widget, among others, that display infos on mouse over.
It looks like this:
And here be da code:
-- Battery status widget
require("precious.utils")
local path = "/sys/class/power_supply/BAT0/"
showbatinfos = nil
lock = false
pluglock = false
local function dispinfo(path)
local f, infos, status, present, brand, model, techno, serial, cycles, voltmin
local voltnow, chfd, chf, uptime, tmp, up_h, up_m, up_s, upbat_h, upbat_m, upbat
local capi = {
mouse = mouse,
screen = screen
}
-- do not try to do something if there is no battery...
present = readfile(path .. "present", "*number")
if (present == 0) then
return
end
-- get and calculate uptime
for tmp in string.gmatch(readfile("/proc/uptime", "*all"), "([%d]+).") do
up_h = math.floor(tmp / 3600)
up_m = string.format("%02d", (tmp % 3600) / 60)
up_s = tmp
break
end
if (up_h > 0) then
uptime = up_h .. "h" .. up_m
else
if (up_m < "10") then
up_m = string.format("%01d", up_m)
end
uptime = up_m .. "mn"
end
status = readfile(path .. "status", "*all")
brand = readfile(path .. "manufacturer", "*all")
model = readfile(path .. "model_name", "*all")
techno = readfile(path .. "technology", "*all")
serial = readfile(path .."serial_number", "*all")
cycles = readfile(path .. "cycle_count", "*all")
voltmin = readfile(path .. "voltage_min_design", "*number")
voltnow = readfile(path .. "voltage_now", "*number")
f = io.open(path .. "charge_full_design", "r")
if not f then
f = assert(io.open(path .. "energy_full_design", "r"))
end
chfd = f:read("*number")
f:close()
f = io.open(path .. "charge_full", "r")
if not f then
f = assert(io.open(path .. "energy_full", "r"))
end
chf = f:read("*number")
f:close()
health = string.format("%.2f", (chf / chfd) * 100)
infos = "Brand: " .. brand ..
"Model: " .. model ..
"Technology: " .. techno ..
"Serial Number: " .. serial ..
"Cycle Count: " .. cycles ..
"Health: " .. health .. "%" ..
"\nVoltage (min design): " .. voltmin ..
"\nVoltage now: " .. voltnow ..
"\n\nUptime: " .. uptime
if (status == 'Discharging\n') then
-- calculate how long it has been on battery
tmp = up_s - unplugtime
upbat_h = math.floor(tmp / 3600)
upbat_m = string.format("%02d", (tmp % 3600) / 60)
if (upbat_h > 0) then
upbat = upbat_h .. "h" .. upbat_m
else
if (upbat_m < "10") then
upbat_m = string.format("%01d", upbat_m)
end
upbat = upbat_m .. "mn"
end
infos = infos .. "\nUp on battery: " .. upbat
end
showbatinfos = naughty.notify( {
title = "Battery Informations:",
text = infos,
timeout = 0,
screen = capi.mouse.screen })
end
local function activebat(path)
local perct, res, batime_h, batime_m, batime, f, tmp
-- files we read from
local charge_full, charge_now, current_now, present, status
present = readfile(path .. "present", "*number")
if (present == 0) then
return '<span color="red">no</span>'
end
status = readfile(path .. "status", "*all")
if (status == 'Full\n') then
-- not discharging so unlock
pluglock = false
return '<span color="green">↯</span>'
end
f = io.open(path .. "charge_now", "r")
if not f then
f = assert(io.open(path .. "energy_now", "r"))
end
charge_now = f:read("*number")
f:close()
f = io.open(path .. "charge_full", "r")
if not f then
f = assert(io.open(path .. "energy_full", "r"))
end
charge_full = f:read("*number")
f:close()
perct = (charge_now/charge_full) * 100
res = string.format("%.2f", perct)
-- use a lock to avoid displaying the popup multiple times
if perct >= 15 then
lock = false
end
if perct < 15 then
res = '<span color="red">' .. res .. '</span>'
if (not lock and status == 'Discharging\n') then
lock = true
naughty.notify( {
bg = "#ff0000",
fg = "#ffffff",
title = "Battery reached a low level",
text = "You should plug in your laptop!",
timeout = 5 })
end
elseif perct < 25 then
res = '<span color="orange">' .. res .. '</span>'
elseif perct < 35 then
res = '<span color="yellow">' .. res .. '</span>'
else
res = '<span color="green">' .. res .. '</span>'
end
if (status == 'Discharging\n') then
-- stuff for up on battery
if (not pluglock) then
for tmp in string.gmatch(readfile("/proc/uptime", "*all"), "([%d]+).") do
unplugtime = tmp
break
end
pluglock = true
end
-- get remaining time
f = io.open(path .. "current_now", "r")
if not f then
f = assert(io.open(path .. "power_now", "r"))
end
current_now = f:read("*number")
f:close()
batime = math.floor((charge_now / current_now) * 60)
batime_h = math.floor(batime / 60)
batime_m = string.format("%02d", batime % 60)
if (batime_h > 0) then
batime = ' (' .. batime_h .. "h" .. batime_m .. ')'
batime = ' (' .. batime_h .. "h" .. batime_m .. ')'
else
if (batime_m < "10") then
batime_m = string.format("%01d", batime_m)
end
batime = ' (' .. batime_m .. 'mn)'
end
status = '<span color="red">-</span>'
else
-- not discharging so unlock
pluglock = false
status = '<span color="green">+</span>'
batime = ''
end
res = res .. '% ' .. status .. batime
return res
end
batinfo = widget({ type = "textbox" , name = "batinfo" })
batinfo:add_signal('mouse::enter', function () dispinfo(path) end)
batinfo:add_signal('mouse::leave', function () clearinfo(showbatinfos) end)
-- Assign a hook to update info
activebat_timer = timer({timeout = 1})
activebat_timer:add_signal("timeout", function ()
batinfo.text = "BAT: " .. activebat(path) .. " |" end)
activebat_timer:start()
I requires some clean up but I haven't had time for it yet.
So for you, the relevant part is this:
batinfo:add_signal('mouse::enter', function () dispinfo(path) end)
batinfo:add_signal('mouse::leave', function () clearinfo(showbatinfos) end)
You just need to write your own dispinfo function that would call "acpi -V". Something like this:
local function dispinfo()
local f, infos
local capi = {
mouse = mouse,
screen = screen
}
f = io.popen("acpi -V")
infos = f:read("*all")
f:close()
showbatinfo = naughty.notify( {
title = "Battery infos (acpi -V)",
text = infos,
timeout = 0,
screen = capi.mouse.screen })
end
I hope it helps.
By the way, if you need some inspiration, have a look at my widget's repository.
Offline
Thank you so much Rolinh, tomorrow i'll give it a look
Offline
analog wrote:Nice! Could you share you hard drive widget?
Thanks, here it is
fmtstart = '<span color="'..beautiful.fg_focus..'">'
fmtend = '</span>'
-- File System
filewidgetp = widget({ type = "textbox" })
vicious.register(filewidgetp, vicious.widgets.fs, fmtstart..' Hd: '..fmtend.."${/ used_p}%", 180)
filewidget = widget({ type = "textbox" })
vicious.register(filewidget, vicious.widgets.fs, "(${/ used_gb}GB)", 180)
Offline
@ Rolinh...i've downloaded your widgets and put them in /usr/share/awesome/lib/precious; now how can i insert them in my rc.lua?
Offline
remove "require("precious.utils")" (think its not necessary), paste it in your rc.lua, add batinfo to your wibox or assign it to an existing one. (didnt tested)
Offline
This conversation should maybe be split off as it is getting a bit off-topic.
However, here is how you should proceed if you plan to use my widget:
- navigate to $HOME/.config/awesome
- clone the precious repository using this command: git clone git://gw-computing.net/precious.git
- add this somewhere into your rc.lua: require("precious.battery")
However, I need to spend some time working on my widgets in order to make them more generic so anyone can include them easily into their awesome wm's configuration. So this means you maybe want to tweak it a bit. In this case, don't hesitate to ask if you have any questions.
Last edited by Rolinh (2012-06-11 20:02:59)
Offline
filewidgetp = widget({ type = "textbox" })
vicious.register(filewidgetp, vicious.widgets.fs, fmtstart..' Hd: '..fmtend.."${/ used_p}%", 180)
filewidget = widget({ type = "textbox" })
vicious.register(filewidget, vicious.widgets.fs, "(${/ used_gb}GB)", 180)
Hey there, you can use one widget for this with format string:" fmtstart..' Hd: '..fmtend.."${/ used_p}% (${/ used_gb}GB)"
Or alternatively enable caching of this widget type so it is executed only once for all fs widgets on all screens:
vicious.cache(vicious.widgets.fs)
You need to install an RTFM interface.
Offline
Offline
Looks great
Do you have a link to your background image?
Offline
Here you go: http://wallbase.cc/wallpaper/154264
Offline
Thanks again for support Rolinh... i modified and cut some unnecessary lines...my widgets are quite perfect now...here it is a screen (just to be IT )
hey TheImmortalPhoenix!
can you please share the complete code of your battery widget( with the modified tooltip) please? or can you tell how to access your dropbox? when i click your link i get the sign-up-dialog.
greetz flexo
Fight war not wars, destroy power not people!
Offline
I'm very happy with this setup. I've relied on a few ideas expressed in this forum, so thank you all. I have also removed the system tray in lieu of custom Synergy, Skype, and Wifi icons. Also, I use the run_or_raise command to launch (minimize) skype and launch an n-curses version of Wicd. Also, bringing up the menu allows you to switch to an HDMI setup and mirror or expand the screen.
Last edited by mtrokic (2012-06-16 17:26:31)
Offline
@mtrokic
how did you change the skype-systray-icon??
Last edited by flexo3001 (2012-06-16 21:37:30)
Fight war not wars, destroy power not people!
Offline
@mtrokic awesome setup, can you share how you handled the wifi widget?
Svaka cast
Offline
I'm very happy with this setup. I've relied on a few ideas expressed in this forum, so thank you all. I have also removed the system tray in lieu of custom Synergy, Skype, and Wifi icons. Also, I use the run_or_raise command to launch (minimize) skype and launch an n-curses version of Wicd. Also, bringing up the menu allows you to switch to an HDMI setup and mirror or expand the screen.
I never understood how RunOnRaise works...could you explain it to me please? And could you share your config lines about skype and wicd? thanks!
Offline
Hello everyone. The last three posts asked me to share my skype / wicd icon setup. As I mentioned, these use the run_or_raise command. @TheImmortalPhoenix, this basically does the following: using a key-combination or a mouse click on an icon, you can launch a program (hence run), or, if it is already running, by using the same key-combination or mouse click on said icon, it will hide the program if it's visible, and if it's not visible, it will make it visible (hence raise). In other words, it's similar to minimizing, but with the ability to start a client (program) if it's not running already. You can read more information at http://awesome.naquadah.org/wiki/Run_or_raise. What this allows you to do is to completely remove the system tray widget and replace it with custom icons. Which leads me to answer @flexo3001 and @theGunslinger.
What I did with Skype and Wicd is as follows. I created custom Skype and Wicd widgets which look something like this.
-- Skypewidget
skypewidget = widget({ type = "textbox" })
local function skypeInfo ()
local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o skype")
local pid = fpid:read("*n")
fpid:close()
if pid == nil then
skypewidget.bg_image = image("/home/mtrokic/.config/awesome/icons/skype.png")
else
skypewidget.bg_image = image("/home/mtrokic/.config/awesome/icons/skype_active.png")
end
end
skypeInfo()
skypetimer = timer({ timeout = 5 })
skypetimer:add_signal("timeout", function() skypewidget.text = skypeInfo() end)
skypetimer:start()
skypewidget:buttons(awful.util.table.join(
awful.button({ }, 1, function () run_or_raise("skype", { class = "Skype" }) end)
))
What the above widget does is as follows. Every five seconds the widget uses the first few lines of code to poll running processes to see if Skype is running. If it is not, the widget just produces a white Skype icon which I took from the AwokenWhite Icon set. If it is running, then it produces a golden Skype icon which I basically obtained by overlaying the white Skype icon with a golden fill in Gimp. Moreover, as you can see in the last lines, I can launch Skype by simply clicking on its icon.
A similar setup works with Wicd. Every five seconds the widget polls to see if I am connected to the internet. If I am not, it returns white icons. If I am, it returns golden icons. Similarly, clicking on the wifi icon launches a terminal with the n-curses Wicd.
-- Network
netwidget = widget({type = "textbox" })
function netInfo ()
local fconnect = io.popen("grep nameserver /etc/resolv.conf")
local fdevice = io.popen("grep dhcpcd /etc/resolv.conf | awk '{print $6}'")
local connect = fconnect:read()
local device = fdevice:read()
fconnect:close()
fdevice:close()
if connect == nil then
netwidget.bg_image = image("/home/mtrokic/.config/awesome/icons/network_offline.png")
else
if device == "eth0" then
netwidget.bg_image = image("/home/mtrokic/.config/awesome/icons/network_wired.png")
elseif device == "wlan0" then
netwidget.bg_image = image("/home/mtrokic/.config/awesome/icons/network_wireless.png")
else
netwidget.bg_image = image("/home/mtrokic/.config/awesome/icons/network_offline.png")
end
end
end
netInfo()
nettimer = timer({ timeout = 5 })
nettimer:add_signal("timeout", function() netwidget.text = netInfo() end)
nettimer:start()
netwidget:buttons(awful.util.table.join( awful.button({ }, 1,
function () awful.util.spawn("urxvt -e wicd-curses") end)
))
I hope this answers your questions. If you want access to all my config files, you can visit my website underneath my alias and go to the Linux page. From there you can download a TAR file of my entire awesome setup.
Last edited by mtrokic (2012-06-16 23:39:08)
Offline