23 lines
411 B
Nim
23 lines
411 B
Nim
|
import i3bar_base
|
||
|
import i3bar_wlan
|
||
|
import std/[os,osproc]
|
||
|
import std/threadpool
|
||
|
|
||
|
|
||
|
proc await_click_info() =
|
||
|
while true:
|
||
|
let input = parseInput()
|
||
|
if input.button == 1:
|
||
|
discard execCmd("alacritty -e nmtui-connect")
|
||
|
|
||
|
proc main() =
|
||
|
if dirExists("/sys/class/net/" & wlan_nic):
|
||
|
spawn get_wifi_info()
|
||
|
spawn await_click_info()
|
||
|
sync()
|
||
|
else:
|
||
|
echo "No WLAN"
|
||
|
|
||
|
if isMainModule:
|
||
|
main()
|