New backup 2025-03-03 23:00:01

This commit is contained in:
Penelope Gwen 2025-03-03 23:00:01 -08:00
parent 9c2d1122d4
commit ab2783c58e
3 changed files with 46 additions and 12 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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}"