You are not logged in.

#851 2012-06-09 19:19:31

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

Thank you doug smile

Offline

#852 2012-06-09 20:29:07

jnor
Member
Registered: 2012-03-21
Posts: 13

Re: Share your Awesome(WM) desktop!

Much appreciated, thank you

Offline

#853 2012-06-09 22:23:57

theGunslinger
Member
Registered: 2011-05-20
Posts: 300

Re: Share your Awesome(WM) desktop!

@TheImmortalPhoenix
Can you share how you feed the gmail widget?

Offline

#854 2012-06-09 22:28:39

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:
jnor wrote:
TheImmortalPhoenix wrote:

Any chance you could upload this to your deviant art collection ? I can't seem to locate it big_smile Looks very good!

I just have a similar shot in my gallery...tell me what you want and i'll provide it to you wink

@ 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

#855 2012-06-09 22:58:40

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

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

#856 2012-06-09 23:13:04

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

Try copying this symbol: │

Sweet, that did it.  Thanks!

Offline

#857 2012-06-09 23:21:07

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

@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

#858 2012-06-10 20:00:01

analog
Member
Registered: 2012-04-14
Posts: 15

Re: Share your Awesome(WM) desktop!

tZTd1ag

Offline

#859 2012-06-10 22:04:50

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

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

#860 2012-06-10 22:58:50

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

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:
batinfo_unplugged.png
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. wink

By the way, if you need some inspiration, have a look at my widget's repository. wink

Offline

#861 2012-06-11 01:13:47

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

Thank you so much Rolinh, tomorrow i'll give it a look smile

Offline

#862 2012-06-11 06:55:25

analog
Member
Registered: 2012-04-14
Posts: 15

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix 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

#863 2012-06-11 19:04:17

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

@ 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

#864 2012-06-11 19:13:37

intrntbrn
Member
From: Germany
Registered: 2011-12-01
Posts: 66

Re: Share your Awesome(WM) desktop!

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

#865 2012-06-11 20:01:49

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Share your Awesome(WM) desktop!

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. wink

Last edited by Rolinh (2012-06-11 20:02:59)

Offline

#866 2012-06-11 21:56:56

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 835
Website

Re: Share your Awesome(WM) desktop!

analog wrote:

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

#867 2012-06-11 22:24:51

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

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 tongue)

tZTlieA

Last edited by TheImmortalPhoenix (2012-06-11 22:25:55)

Offline

#868 2012-06-12 06:16:26

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Share your Awesome(WM) desktop!

Looks great smile
Do you have a link to your background image?

Offline

#869 2012-06-12 12:43:59

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

Offline

#870 2012-06-13 17:49:44

flexo3001
Member
From: berlin
Registered: 2012-01-13
Posts: 95

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

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 tongue)

http://ompldr.org/tZTlieA

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

#871 2012-06-16 16:26:36

mtrokic
Member
From: Montreal
Registered: 2009-10-24
Posts: 56
Website

Re: Share your Awesome(WM) desktop!

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.

tZWQxbg

tZWQxcg

tZWQyaQ

Last edited by mtrokic (2012-06-16 17:26:31)

Offline

#872 2012-06-16 21:35:48

flexo3001
Member
From: berlin
Registered: 2012-01-13
Posts: 95

Re: Share your Awesome(WM) desktop!

@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

#873 2012-06-16 22:16:33

theGunslinger
Member
Registered: 2011-05-20
Posts: 300

Re: Share your Awesome(WM) desktop!

@mtrokic awesome setup, can you share how you handled the wifi widget?

Svaka cast smile

Offline

#874 2012-06-16 22:22:04

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: Share your Awesome(WM) desktop!

mtrokic wrote:

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

#875 2012-06-16 23:37:09

mtrokic
Member
From: Montreal
Registered: 2009-10-24
Posts: 56
Website

Re: Share your Awesome(WM) desktop!

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

Board footer

Powered by FluxBB