You are not logged in.

#1 2014-01-05 23:30:24

xTouchMe
Member
Registered: 2013-05-05
Posts: 6

Awesome WM - Weird vicious battery reading

Just recently vicious is somehow reading the battery status wrong
Although, I'm currently running on battery, this is its output

syagC2w.png

Reading off /sys/class/power_supply gives:

$ cat /sys/class/power_supply/BAT1/status
Discharging

Here's the snippet for the battery widget I'm using

vicious.register(batwidget, vicious.widgets.bat, function(batwidget, args)
	local batico = ""
	local batbar = ""

	if args[1] == "↯" then
		batico = "<span color='"..col_icon.."'>⮎</span>"
		batbar = "<span color='"..col_bar_light.."'>AC Line</span>"
	else
		batbar = "<span color='"..col_bar_light.."'>"..args[2].."%</span>"

		if args[1] == "+" then
			batico = "<span color='"..col_icon.."'>⮒</span>"
		elseif args[1] == "-" then
			if args[2] > 49 then
				batico = "<span color='"..col_icon.."'>⮏</span>"
			elseif args[2] < 50 and args[2] > 25 then
				batico = "<span color='"..col_icon.."'>⮑</span>"
			else
				batico = "<span color='"..col_icon.."'>⮐</span>"
			end
		else
			batico = "<span color='"..col_icon.."'>⮎</span>" --This is the line that gets executed and not the one on top
		end
	end

	return batico..' '..batbar
end, 3, "BAT1")

I'm absolutely baffled as to why this happened
I would appreciate any help for this smile

Offline

Board footer

Powered by FluxBB