nVidia Optimus activity icon added.

Several Wine applications leave *.exe processes which hold the
optirun/primusrun process and the nVidia card stays ON.
This commit is contained in:
Kolan Sh 2016-09-25 17:46:35 +03:00
parent aac2863441
commit a88e255d6d
4 changed files with 26 additions and 0 deletions

24
rc.lua
View File

@ -216,6 +216,28 @@ gmail_mail.timer:connect_signal("timeout",
gmail_mail.timer:start() gmail_mail.timer:start()
gmail_mail:buttons(mailicon:buttons()) gmail_mail:buttons(mailicon:buttons())
-- nVidia Optimus
local optimus_icon = wibox.widget.imagebox()
optimus_icon:set_image(beautiful.widget_optimus_off)
optimus_icon.timer = timer{timeout=3}
optimus_icon.timer:connect_signal("timeout",
function ()
local f = io.open("/proc/acpi/bbswitch", "r")
local l = nil
if f ~= nil then
l = f:read()
if string.sub (l, 14) == "ON" then
optimus_icon:set_image(beautiful.widget_optimus_on)
else
optimus_icon:set_image(beautiful.widget_optimus_off)
end
f:close()
else
optimus_icon:set_image(beautiful.widget_optimus_off)
end
end)
optimus_icon.timer:start()
-- Wi-Fi / Ethernet widgets -- Wi-Fi / Ethernet widgets
local wifi_widget_down = wibox.widget.textbox() local wifi_widget_down = wibox.widget.textbox()
local wifi_widget_up = wibox.widget.textbox() local wifi_widget_up = wibox.widget.textbox()
@ -281,6 +303,8 @@ for s = 1, screen.count() do
right_layout:add(mem) right_layout:add(mem)
right_layout:add(diskicon) right_layout:add(diskicon)
right_layout:add(disk) right_layout:add(disk)
right_layout:add(optimus_icon)
right_layout:add(spacer)
right_layout:add(baticon) right_layout:add(baticon)
right_layout:add(batpct) right_layout:add(batpct)
right_layout:add(icon_wifi) right_layout:add(icon_wifi)

View File

@ -125,6 +125,8 @@ theme.widget_pac = awful.util.getdir("config") .. "/themes/default/widgets/pac.p
theme.widget_pacnew = awful.util.getdir("config") .. "/themes/default/widgets/pacnew.png" theme.widget_pacnew = awful.util.getdir("config") .. "/themes/default/widgets/pacnew.png"
theme.widget_mail = awful.util.getdir("config") .. "/themes/default/widgets/mail.png" theme.widget_mail = awful.util.getdir("config") .. "/themes/default/widgets/mail.png"
theme.widget_mailnew = awful.util.getdir("config") .. "/themes/default/widgets/mailnew.png" theme.widget_mailnew = awful.util.getdir("config") .. "/themes/default/widgets/mailnew.png"
theme.widget_optimus_off = awful.util.getdir("config") .. "/themes/default/widgets/optimus_off.png"
theme.widget_optimus_on = awful.util.getdir("config") .. "/themes/default/widgets/optimus_on.png"
theme.widget_temp = awful.util.getdir("config") .. "/themes/default/widgets/temp.png" theme.widget_temp = awful.util.getdir("config") .. "/themes/default/widgets/temp.png"
theme.widget_tempwarn = awful.util.getdir("config") .. "/themes/default/widgets/tempwarm.png" theme.widget_tempwarn = awful.util.getdir("config") .. "/themes/default/widgets/tempwarm.png"
theme.widget_temphot = awful.util.getdir("config") .. "/themes/default/widgets/temphot.png" theme.widget_temphot = awful.util.getdir("config") .. "/themes/default/widgets/temphot.png"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB