New backup 2026-02-17 21:15:02

This commit is contained in:
Penelope Gwen 2026-02-17 21:15:02 -08:00
parent 44e239cfa7
commit a0ddd01aa6
5 changed files with 64 additions and 77 deletions

View file

@ -1,27 +1,25 @@
(defvar reveal_volume false) (defvar reveal_volume false)
(defwidget volume [] (defwidget volume []
(revealer-on-hover (revealer-on-hover :class "volume ${reveal_volume}"
:class "volume ${reveal_volume}" :revealvar reveal_volume
:revealvar reveal_volume :revealvar-name "reveal_volume"
:revealvar-name "reveal_volume" (button :onclick 'pavucontrol-qt --tab 3'
(button :onclick 'pavucontrol-qt --tab 3' :tooltip "Pulseaudio Volume Control"
:tooltip "Pulseaudio Volume Control" :class "${(volume == 0) ? 'inactive' : 'active'} revealer-preview"
:class "${(volume == 0) ? 'inactive' : 'active'} revealer-preview"
{(volume == 0) ? "" : ((volume > 50) ? "" : "")}) {(volume == 0) ? "" : ((volume > 50) ? "" : "")})
(volume_children))) (volume_children)))
(deflisten volume :initial "50" (deflisten volume :initial "50"
"scripts/bar/volume") "scripts/bar/volume")
(defwidget volume_children [] (defwidget volume_children []
(box :class "reveal-children" (box :class "reveal-children" :orientation "h"
:orientation "h" :space-evenly false
:space-evenly false :halign "center"
:halign "center"
(scale (scale
:tooltip "volume: ${round(volume,0)}%" :tooltip "volume: ${round(volume,0)}%"
:min 0 :min 0
:max 100 :max 100
:value {volume} :value {volume}
:orientation "h" :orientation "h"
:onchange "wpctl set-volume @DEFAULT_AUDIO_SINK@ {}%;paplay 'volume.ogg'"))) :onchange "wpctl set-volume @DEFAULT_AUDIO_SINK@ {}%;paplay 'volume.ogg'")))

View file

@ -10,23 +10,19 @@
(vpn_children :array "${jq(network_manager.vpns,'.|sort_by(.name)')}"))) (vpn_children :array "${jq(network_manager.vpns,'.|sort_by(.name)')}")))
(defwidget vpn_children [array] (defwidget vpn_children [array]
(box :class "reveal-children" (box :class "reveal-children"
:orientation "h" :orientation "h"
:space-evenly false :space-evenly false
:halign "center" :halign "center"
(for vpn in array (for vpn in array
(button :onclick "nmcli connection ${( vpn.active == 'yes' ? 'down' : 'up' )} ${vpn.name}" (button :onclick "nmcli connection ${( vpn.active == 'yes' ? 'down' : 'up' )} ${vpn.name}"
:class {( vpn.active == "yes" ? 'active' : 'inactive' )} :class {( vpn.active == "yes" ? 'active' : 'inactive' )}
:tooltip "${vpn.name}" :tooltip "${vpn.name}"
"${( vpn.name =~ '^[Hh]ome.*' ? "${( vpn.name =~ '^[Hh]ome.*' ?
( vpn.name =~ '.*[Ff]ull.*' ? '' : '') : ( vpn.name =~ '.*[Ff]ull.*' ? '' : '') :
( vpn.name =~ '^pia-.*' ? ( vpn.name =~ '^pia-.*' ?
( vpn.name =~ '.*local.*' ? '' : '' ) : ( vpn.name =~ '.*local.*' ? '' : '' ) :
( vpn.name == 'SCA' ? ( vpn.name == 'SCA' ?
'' : '' :
'') ) '') )
)} ${( vpn.active == 'yes' ? '' : '' )}" )} ${( vpn.active == 'yes' ? '' : '' )}"))))
)
)
)
)

View file

@ -1,5 +1,5 @@
(defwidget windowtitle [] (defwidget windowtitle []
(label :class {jq(sway_info,'.window_info.title','r') != "" ? "active_window" : ""} (label :class {jq(sway_info,'.window_info.title','r') != "" ? "active_window" : ""}
:limit-width 40 :limit-width 40
:show-truncated true :show-truncated true
:text {jq(sway_info,'.window_info.title','r')})) :text {jq(sway_info,'.window_info.title','r')}))

View file

@ -1,6 +1,7 @@
(deflisten active_window_name :initial "" (deflisten active_window_name :initial ""
:interval "60s" :interval "60s"
"scripts/bar/activewindow") "scripts/bar/activewindow")
(defwidget windowtitle [] (defwidget windowtitle []
(label :class {active_window_name != "" ? "active_window" : ""} (label :class {active_window_name != "" ? "active_window" : ""}
:text {active_window_name})) :text {active_window_name}))

View file

@ -1,47 +1,39 @@
(defvar wsreveal false) (defvar wsreveal false)
(defwidget workspaces [array] (defwidget workspaces [array]
(eventbox (eventbox :onhover "${EWW_CMD} update wsreveal=true"
:onhover "${EWW_CMD} update wsreveal=true" :onhoverlost "${EWW_CMD} update wsreveal=false"
:onhoverlost "${EWW_CMD} update wsreveal=false" (box :class "workspaces ${((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == 'Work') ? 'profile-work' : ((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == '20') ? 'profile-school' : ((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == '10') ? 'profile-development' : ((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == '0') ? 'profile-personal' : ''))))}"
(box :class "workspaces ${((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == 'Work') ? 'profile-work' : ((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == '20') ? 'profile-school' : ((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == '10') ? 'profile-development' : ((jq(sway_info,'workspace_info[] | select(.is_focused) | .profile_name','r') == '0') ? 'profile-personal' : ''))))}" :orientation "h"
:orientation "h" :space-evenly false
:space-evenly false :halign "start"
:halign "start" (revealer
:class "ws-left"
(revealer :reveal wsreveal
:class "ws-left" :transition "slideleft"
:reveal wsreveal :duration "500ms"
:transition "slideleft" (box
:duration "500ms" (for entry in array
(box (literal :visible {((entry.position == 'l') && !entry.is_focused) ? true : false}
(for entry in array :content {((entry.position == 'l') && !entry.is_focused) ? "(workspace :ws entry :side 'left')" : "(box :visible false)"}))))
(literal (box :class "ws-center ${wsreveal}"
:visible {((entry.position == 'l') && !entry.is_focused) ? true : false} (for entry in array
:content {((entry.position == 'l') && !entry.is_focused) ? "(workspace :ws entry :side 'left')" : "(box :visible false)"})))) (literal :visible {entry.is_focused ? true : false}
(box :content {entry.is_focused ? "(workspace :ws entry :side 'center' :lastws ${jq(array,'.[-1].num')})" : "(box :visible false)"})))
:class "ws-center ${wsreveal}" (revealer :class "ws-right"
(for entry in array :reveal wsreveal
(literal :transition "slideright"
:visible {entry.is_focused ? true : false} :duration "500ms"
:content {entry.is_focused ? "(workspace :ws entry :side 'center' :lastws ${jq(array,'.[-1].num')})" : "(box :visible false)"}))) (box
(revealer (for entry in array
:class "ws-right" (literal :visible {((entry.position == 'r') && !entry.is_focused) ? true : false}
:reveal wsreveal :content {((entry.position == 'r') && !entry.is_focused) ? "(workspace :ws entry :side 'right')" : "(box :visible false)"})))))))
:transition "slideright"
:duration "500ms"
(box
(for entry in array
(literal
:visible {((entry.position == 'r') && !entry.is_focused) ? true : false}
:content {((entry.position == 'r') && !entry.is_focused) ? "(workspace :ws entry :side 'right')" : "(box :visible false)"})))))))
(defwidget workspace [ws side ?lastws ?firstws] (defwidget workspace [ws side ?lastws ?firstws]
(button :onclick `swaymsg workspace "${ws.name}"` (button :onclick `swaymsg workspace "${ws.name}"`
:tooltip "${ws.profile_name} ( ${jq(captures(ws.num, '[0-9]$'),'.[].[]','r')} )" :tooltip "${ws.profile_name} ( ${jq(captures(ws.num, '[0-9]$'),'.[].[]','r')} )"
:class '${side} ${ws.num == lastws ? "last-workspace" : (ws.num == firstws ? "first-workspace" : "middle-workspace")} profile-${jq(ws,'.profile_name','r')}' :class '${side} ${ws.num == lastws ? "last-workspace" : (ws.num == firstws ? "first-workspace" : "middle-workspace")} profile-${jq(ws,'.profile_name','r')}'
(box (box
'${replace(ws.name,".*:","")}' '${replace(ws.name,".*:","")}'
(label (label :class "workspace-number"
:class "workspace-number" :text {jq(captures(ws.num, '[0-9]$'),'.[].[]','r')}))))
:text {jq(captures(ws.num, '[0-9]$'),'.[].[]','r')}))))