Files
hyprdots/config/eww/eww.yuck
2025-05-05 00:03:38 +02:00

101 lines
2.8 KiB
Plaintext

;(include "./windows/netWindow.yuck")
(defpoll ipaddress :initial "getting info..."
:interval "30s"
`./scripts/netinfo.sh 3`)
(defpoll interface :initial "getting info..."
:interval "30s"
`./scripts/netinfo.sh 1`)
(defpoll nameserver :initial "getting info..."
:interval "30s"
`cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}'`)
(deflisten hostname :initial "getting info..."
`cat /etc/hostname`)
; netWindow
; ----------------------------------
; | content |
; | -------------------- |
; | | topContent | |
; | ||infobox hostname|| |
; | | | |
; | -------------------- |
; | | centerContent | |
; | | IF | IP | DNS | |
; | | | |
; | -------------------- |
; | |
; ----------------------------------
(defwidget topcontent []
(box :orientation "h" :class "topcontent"
:halign "center"
:valign "start"
(infobox :name "Hostname:" :info hostname)
))
(defwidget content []
(box :orientation "v" :class "content"
:halign "end"
(topcontent)
(centercontent)
(bottomcontent)))
(defwidget centercontent []
(box :orientation "h" :class "centercontent"
:halign "end"
:valign "start"
(infobox :name "Interface:" :info interface)
(infobox :name "IP Address:" :info ipaddress)
(infobox :name "DNS Server:" :info nameserver)
))
(defwidget bottomcontent []
(box :orientation "h" :class "bottomcontent"
:halign "end"
:valign "end"
(nmsettings)
))
(defwidget infobox [name info]
(box :orientation "v" :class "infobox"
:halign "center"
:valign "center"
(infolabel :text name)
(infolabel :text info)))
(defwidget nmsettings []
(box :orientation "horizontal" :class "buttons"
:halign "end"
:valign "end"
(button :onclick "pypr toggle network && hyprctl dispatch bringactivetotop"
"Open Connection Editor")))
(defwidget infolabel [text]
(label :text text :class "infolabel"
:halign "center"
:valign "center"))
(defwidget lowercontent[]
(box :orientation "h" :class "lowercontent"
:halign "center"
:valign "center"))
(defwindow network
:class network_window
:monitor 1
:geometry (geometry :x "20px"
:y "50px"
:width "560px"
:height "85%"
:anchor "right center")
:stacking "fg"
;:reserve (struts :distance "10px" :side "top") ;;only for x11
;:windowtype "dock" ;;only for x11
;:wm-ignore false ;;only for x11
(content))