diff --git a/de/home/.config/eww/eww.scss b/de/home/.config/eww/eww.scss index 5939924..c2866b8 100644 --- a/de/home/.config/eww/eww.scss +++ b/de/home/.config/eww/eww.scss @@ -49,7 +49,8 @@ circular-progress { border-radius: 8px; margin: 0px 2px; } -.reveal_children>box { +.reveal_children>box, +.reveal_children>button { border-left: 2px solid $color1; } .rightgroup>label, @@ -82,7 +83,8 @@ label { transition-property: background-color; transition-duration: .25s; } -.workspaces .focused { +.workspaces .focused, +.active { background-color: $color1; } .workspaces button:first-child { diff --git a/de/home/.config/eww/eww.yuck b/de/home/.config/eww/eww.yuck index 85d724f..6707e16 100644 --- a/de/home/.config/eww/eww.yuck +++ b/de/home/.config/eww/eww.yuck @@ -43,14 +43,6 @@ :class {inhibit_active ? "active" : ""} {inhibit_active ? "" : ""})) -(defpoll vpn_active :initial false - :interval "5s" - "scripts/vpn-status") -(defwidget vpn [] - (button :onclick 'notify-send "test"' - :class {vpn_active ? "active" : ""} - {vpn_active ? "" : ""})) - (defwidget systemtray [] (systray :class "systray" @@ -76,6 +68,40 @@ :duration {duration ?: "500ms"} (children :nth 1)))))) +(defpoll vpn_active :initial false + :interval "5s" + "scripts/vpn-status") + +(defvar reveal_vpn false) +(defwidget vpn [] + (revealer-on-hover + :revealvar reveal_vpn + :revealvar-name "reveal_vpn" + (button :onclick 'notify-send "test"' + :class {vpn_active ? "active" : ""} + {vpn_active ? "" : ""}) + (vpn_children))) + +(defpoll home_vpn_active :initial false + :interval "5s" + "scripts/vpn-status Home") + +(defpoll proton_vpn_active :initial false + :interval "5s" + "scripts/vpn-status Proton") + +(defwidget vpn_children [] + (box :class "reveal_children" + :orientation "h" + :space-evenly false + :halign "center" + (button :onclick 'notify-send "test home"' + :class {home_vpn_active ? "active" : ""} + {home_vpn_active ? "" : ""}) + (button :onclick 'notify-send "test proton"' + :class {proton_vpn_active ? "active" : ""} + {proton_vpn_active ? "" : ""}))) + (defvar reveal_sysmem false) (defwidget sysmem [] (revealer-on-hover diff --git a/de/home/.config/eww/scripts/vpn-status b/de/home/.config/eww/scripts/vpn-status index 3f07096..0d77b97 100755 --- a/de/home/.config/eww/scripts/vpn-status +++ b/de/home/.config/eww/scripts/vpn-status @@ -3,8 +3,14 @@ nm_active=`nmcli con show --active` vpn_active='false' -if echo "${nm_active}" | grep -q 'vpn' || echo "${nm_active}" | grep -q 'wireguard';then - vpn_active='true' +if [ -z ${1} ];then + if echo "${nm_active}" | grep -q 'vpn' || echo "${nm_active}" | grep -q 'wireguard';then + vpn_active='true' + fi +else + if echo "${nm_active}" | grep -q "${1}";then + vpn_active='true' + fi fi printf '%s' "${vpn_active}"