1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-10-22 12:31:23 +00:00

vertex: added wifi infobubble

This commit is contained in:
copycat-killer 2017-02-03 15:09:56 +01:00
parent d8ad21fba4
commit 771ef5cd0a

View file

@ -28,7 +28,9 @@ theme.bg_urgent = "#006B8E"
theme.border_width = 4
theme.border_normal = "#252525"
theme.border_focus = "#7CA2EE"
theme.menu_height = 36
theme.tooltip_border_color = theme.fg_focus
theme.tooltip_border_width = theme.border_width
theme.menu_height = 24
theme.menu_width = 140
theme.taglist_squares_sel = theme.icon_dir .. "/square_sel.png"
theme.taglist_squares_unsel = theme.icon_dir .. "/square_unsel.png"
@ -104,7 +106,7 @@ theme.titlebar_maximized_button_focus_active = theme.default_dir.."/titlebar/
awful.util.tagnames = { "", "", "", "", "", "", "", "", "" }
-- Generate Awesome icon
theme.awesome_icon = theme_assets.awesome_icon(theme.menu_height, theme.fg_normal, theme.bg_normal)
theme.awesome_icon = theme_assets.awesome_icon(36, theme.fg_normal, theme.bg_normal)
local markup = lain.util.markup
@ -124,10 +126,17 @@ lain.widgets.calendar({
-- Battery
local baticon = wibox.widget.imagebox(theme.bat000)
local battooltip = awful.tooltip({ objects = { baticon } })
--battooltip:set_shape(gears.shape.rounded_rect)
local battooltip = awful.tooltip({
objects = { baticon },
margin_leftright = 15,
margin_topbottom = 12
})
battooltip.wibox.fg = theme.fg_normal
battooltip.textbox.font = "Roboto 18"
battooltip.textbox.font = theme.font
battooltip.timeout = 0
battooltip:set_shape(function(cr, width, height)
gears.shape.infobubble(cr, width, height, corner_radius, arrow_size, width - 35)
end)
local bat = lain.widgets.bat({
settings = function()
local index, perc = "bat", tonumber(bat_now.perc) or 0
@ -151,7 +160,7 @@ local bat = lain.widgets.bat({
end
baticon:set_image(theme[index])
battooltip:set_markup(string.format("%s%%, %s", bat_now.perc, bat_now.time))
battooltip:set_markup(string.format("\n%s%%, %s", bat_now.perc, bat_now.time))
end
})
@ -223,13 +232,26 @@ volicon:buttons(awful.util.table.join (
-- Wifi carrier and signal strength
local wificon = wibox.widget.imagebox()
local wifitooltip = awful.tooltip({
objects = { wificon },
margin_leftright = 15,
margin_topbottom = 15
})
wifitooltip.wibox.fg = theme.fg_normal
wifitooltip.textbox.font = theme.font
wifitooltip.timeout = 0
wifitooltip:set_shape(function(cr, width, height)
gears.shape.infobubble(cr, width, height, corner_radius, arrow_size, width - 120)
end)
local mywifisig = lain.widgets.abase({
cmd = "awk 'NR==3 {printf(\"%d-%.0f\",$2, $3*10/7)}' /proc/net/wireless",
cmd = { awful.util.shell, "-c", "awk 'NR==3 {printf(\"%d-%.0f\\n\",$2, $3*10/7)}' /proc/net/wireless; iw dev wlan0 link" },
settings = function()
local carrier, perc = output:match("(%d)-(.*)")
local carrier, perc = output:match("(%d)-(%d+)")
local tiptext = output:gsub("(%d)-(%d+)", ""):gsub("%s+$", "")
if carrier == "1" then
wificon:set_image(theme.wifidisc)
wifitooltip:set_markup("No carrier")
else
perc = tonumber(perc)
if perc <= 5 then
@ -243,6 +265,7 @@ local mywifisig = lain.widgets.abase({
else
wificon:set_image(theme.wififull)
end
wifitooltip:set_markup(tiptext)
end
end
})
@ -298,7 +321,7 @@ local barcolor2 = gears.color({
function theme.at_screen_connect(s)
-- Quake application
s.quake = lain.util.quake({ app = awful.util.terminal })
s.quake = lain.util.quake({ app = awful.util.terminal, border = theme.border_width })
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then