diff options
| author | venomade <venomade@venomade.com> | 2026-02-16 17:31:16 +0000 |
|---|---|---|
| committer | venomade <venomade@venomade.com> | 2026-02-16 17:31:16 +0000 |
| commit | a568a964fd6a9efba388b2b4919339c0b7dfe51d (patch) | |
| tree | 0c6adbf753de1c0b469e911668a82c6b2002f5f8 /.config/luastatus/wireless.lua | |
| parent | 9d2c3f898a97de16b986d4e494f31e6c6f3d176a (diff) | |
Asahi is just not perfectly usable yet. Moved stuff, went nix.
Diffstat (limited to '.config/luastatus/wireless.lua')
| -rw-r--r-- | .config/luastatus/wireless.lua | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/.config/luastatus/wireless.lua b/.config/luastatus/wireless.lua deleted file mode 100644 index e3d53d7..0000000 --- a/.config/luastatus/wireless.lua +++ /dev/null @@ -1,70 +0,0 @@ -local MIN_DBM, MAX_DBM = -90, -20 -local COLOR_DIM = '#709080' - -local function clamp(x, lo, hi) - if x < lo then return lo end - if x > hi then return hi end - return x -end - -local function make_wifi_level(dbm) - dbm = clamp(dbm, MIN_DBM, MAX_DBM) - - -- Normalize to [0, 1] - local t = (dbm - MIN_DBM) / (MAX_DBM - MIN_DBM) - - local level - if t < 0.25 then - level = '' - elseif t < 0.50 then - level = '' - elseif t < 0.75 then - level = '' - else - level = '' - end - - return { - full_text = level, - color = COLOR_DIM, - } -end - -widget = { - plugin = 'network-linux', - opts = { - wireless = true, - timeout = 10, - }, - cb = function(t) - if not t then - return nil - end - local r = {} - for iface, params in pairs(t) do - if params.wireless then - if params.wireless.ssid then - r[#r + 1] = { - full_text = params.wireless.ssid, - color = COLOR_DIM, - } - end - if params.wireless.signal_dbm then - r[#r + 1] = make_wifi_level(params.wireless.signal_dbm) - end - elseif iface ~= 'lo' and (params.ipv4 or params.ipv6) then - r[#r + 1] = { - full_text = string.format('[%s]', iface), - color = COLOR_DIM, - } - end - end - return r - end, - event = [[ - local t = ... - if t.button == 1 then - os.execute('~/.local/bin/rofi-wifimenu &') - end - ]], -} |
