New Setup 📦
This commit is contained in:
parent
d16174b447
commit
415dbd08a1
10194 changed files with 1368647 additions and 4 deletions
40
home/.config/awesome/ui/sidebar/wifi.lua
Normal file
40
home/.config/awesome/ui/sidebar/wifi.lua
Normal file
|
@ -0,0 +1,40 @@
|
|||
-- ## Wifi ##
|
||||
-- ~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require ("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
-- Icon
|
||||
local icon = wibox.widget.textbox()
|
||||
icon.font = "Roboto Medium 24"
|
||||
icon.align = 'center'
|
||||
|
||||
-- Wifi Name
|
||||
local wifi = wibox.widget.textbox()
|
||||
wifi.font = "Roboto Medium 16"
|
||||
wifi.align = 'center'
|
||||
wifi.markup = "Connecting.." -- In case it's still fetching wifi name
|
||||
|
||||
awesome.connect_signal("signal::wifi", function(connected, ssid)
|
||||
if connected then
|
||||
ssid = tostring(ssid)
|
||||
ssid = ssid:match("(.-)[:]")
|
||||
icon.markup = "<span foreground='"..beautiful.green.."'></span>"
|
||||
wifi.markup = ssid
|
||||
else
|
||||
icon.markup = "<span foreground='"..beautiful.red.."'></span>"
|
||||
wifi.markup = "Not Connected ;-;"
|
||||
end
|
||||
end)
|
||||
|
||||
return wibox.widget {
|
||||
icon,
|
||||
wifi,
|
||||
spacing = dpi(10),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue