1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-12-22 11:12:31 +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_width = 4
theme.border_normal = "#252525" theme.border_normal = "#252525"
theme.border_focus = "#7CA2EE" 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.menu_width = 140
theme.taglist_squares_sel = theme.icon_dir .. "/square_sel.png" theme.taglist_squares_sel = theme.icon_dir .. "/square_sel.png"
theme.taglist_squares_unsel = theme.icon_dir .. "/square_unsel.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 = { "", "", "", "", "", "", "", "", "" } awful.util.tagnames = { "", "", "", "", "", "", "", "", "" }
-- Generate Awesome icon -- 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 local markup = lain.util.markup
@ -124,10 +126,17 @@ lain.widgets.calendar({
-- Battery -- Battery
local baticon = wibox.widget.imagebox(theme.bat000) local baticon = wibox.widget.imagebox(theme.bat000)
local battooltip = awful.tooltip({ objects = { baticon } }) local battooltip = awful.tooltip({
--battooltip:set_shape(gears.shape.rounded_rect) objects = { baticon },
margin_leftright = 15,
margin_topbottom = 12
})
battooltip.wibox.fg = theme.fg_normal 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({ local bat = lain.widgets.bat({
settings = function() settings = function()
local index, perc = "bat", tonumber(bat_now.perc) or 0 local index, perc = "bat", tonumber(bat_now.perc) or 0
@ -151,7 +160,7 @@ local bat = lain.widgets.bat({
end end
baticon:set_image(theme[index]) 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 end
}) })
@ -223,13 +232,26 @@ volicon:buttons(awful.util.table.join (
-- Wifi carrier and signal strength -- Wifi carrier and signal strength
local wificon = wibox.widget.imagebox() 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({ 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() 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 if carrier == "1" then
wificon:set_image(theme.wifidisc) wificon:set_image(theme.wifidisc)
wifitooltip:set_markup("No carrier")
else else
perc = tonumber(perc) perc = tonumber(perc)
if perc <= 5 then if perc <= 5 then
@ -243,6 +265,7 @@ local mywifisig = lain.widgets.abase({
else else
wificon:set_image(theme.wififull) wificon:set_image(theme.wififull)
end end
wifitooltip:set_markup(tiptext)
end end
end end
}) })
@ -298,7 +321,7 @@ local barcolor2 = gears.color({
function theme.at_screen_connect(s) function theme.at_screen_connect(s)
-- Quake application -- 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 wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then if type(wallpaper) == "function" then