Merge branch 'main' of ssh://git.pogmom.me:1022/pogmommy/dotfiles

This commit is contained in:
Penelope Gwen 2026-01-05 13:17:59 -08:00
commit 12e1c22f24
9 changed files with 82 additions and 57 deletions

View file

@ -77,7 +77,8 @@
;rightgroup ;rightgroup
(include "modules/bar/idle_inhibit.yuck") (include "modules/bar/idle_inhibit.yuck")
(include "modules/bar/volume.yuck") (include "modules/bar/volume.yuck")
(include "variables/bar/network.yuck") ;(include "variables/bar/network.yuck")
(include "variables/bar/network-manager.yuck")
(include "modules/bar/network.yuck") (include "modules/bar/network.yuck")
(include "modules/bar/vpn.yuck") (include "modules/bar/vpn.yuck")
(include "variables/bar/bluetooth.yuck") (include "variables/bar/bluetooth.yuck")

View file

@ -5,18 +5,22 @@
:revealvar reveal_network :revealvar reveal_network
:revealvar-name "reveal_network" :revealvar-name "reveal_network"
(button :onclick 'nm-connection-editor' (button :onclick 'nm-connection-editor'
:class "revealer-preview ${network_status.wifi || network_status.wired ? 'active' : 'inactive'}" :tooltip "${jq(network_manager.interfaces, '.[] | "\\(.connection) (\\(.device)) \\n"', 'r')}"
:class "revealer-preview ${(jq(network_manager.interfaces, '[ .[] | select(.state=="connected") ] | length') > 0 ? 'active' : 'inactive')}" ;${network_status.wifi || network_status.wired ? 'active' : 'inactive'}"
"󰇧") "󰇧")
(network_children))) (network_children :array "${network_manager.interfaces}")))
(defwidget network_children [] (defwidget network_children [array]
(box :class "reveal-children" (box :class "reveal-children"
:orientation "h" :orientation "h"
:space-evenly false :space-evenly false
:halign "center" :halign "center"
(button :onclick {network_status.wifi ? 'scripts/bar/network-updown wifi down' : 'scripts/bar/network-updown wifi up'} (for interface in array
:class {network_status.wifi ? "active" : "inactive"} (button :onclick "nmcli device ${( interface.state == 'connected' ? 'down' : 'up' )} ${interface.device}"
"") :class {( interface.state == "connected" ? 'active' : 'inactive' )}
(button :onclick {network_status.wired ? 'scripts/bar/network-updown ethernet down' : 'scripts/bar/network-updown ethernet up'} :tooltip "${interface.connection} (${interface.device})"
:class {network_status.wired ? "active" : "inactive"} {( interface.type == "wifi" ? "" : ( interface.type == "ethernet" ? "󰈀" : "" ))}
"󰈀"))) )
)
)
)

View file

@ -19,7 +19,8 @@
(for entry in array (for entry in array
(button :onclick 'swaymsg [con_id=${entry.win_id}] scratchpad show' (button :onclick 'swaymsg [con_id=${entry.win_id}] scratchpad show'
:class "${(entry.visible == 'true') ? 'active' : 'inactive'}" :class "${(entry.visible == 'true') ? 'active' : 'inactive'}"
:tooltip "${entry.name}\n${entry.title}" :tooltip "${entry.title}
${entry.name}"
(image :path {entry.icon} (image :path {entry.icon}
:image-width 20 :image-width 20
:image-height 20) :image-height 20)

View file

@ -4,25 +4,27 @@
:class "${reveal_vpn} vpn" :class "${reveal_vpn} vpn"
:revealvar reveal_vpn :revealvar reveal_vpn
:revealvar-name "reveal_vpn" :revealvar-name "reveal_vpn"
(button :onclick 'notify-send "test"' (button :onclick 'notify-send "TODO"'
:class "revealer-preview ${network_status.proton || network_status.homevpn ? 'active' : 'inactive'}" :class "revealer-preview ${(jq(network_manager.vpns, '[ .[] | select(.active=="yes") ] | length') > 0 ? 'active' : 'inactive')}"
{network_status.vpn ? "" : ""}) "${(jq(network_manager.vpns, '[ .[] | select(.active=="yes") ] | length') > 0 ? '' : '')}")
(vpn_children))) (vpn_children :array "${network_manager.vpns}")))
(defwidget vpn_children [] (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"
(button :onclick 'scripts/bar/nmcli-vpn "HomeVPN"' (for vpn in array
:class {network_status.homevpn ? "active" : "inactive"} (button :onclick "nmcli connection ${( vpn.active == 'yes' ? 'down' : 'up' )} ${vpn.device}"
" ${network_status.homevpn ? "" : ""}") :class {( vpn.active == "yes" ? 'active' : 'inactive' )}
(button :onclick 'scripts/bar/nmcli-vpn "HomeVPN-Full"' :tooltip "${vpn.name}"
:class {network_status.homevpn_full ? "active" : "inactive"} "${( vpn.name =~ '^[Hh]ome.*' ?
" ${network_status.homevpn ? "" : ""}") ( vpn.name =~ '.*[Ff]ull.*' ? '' : '') :
(button :onclick 'scripts/bar/nmcli-vpn "ProtonVPN"' ( vpn.name =~ '^pia-.*' ?
:class {network_status.proton ? "active" : "inactive"} ( vpn.name =~ '.*local.*' ? '' : '' ) :
" ${network_status.homevpn ? "" : ""}") '' )
(button :onclick 'scripts/bar/nmcli-vpn "ProtonVPN-SC"' )} ${( vpn.active == 'yes' ? '' : '' )}"
:class {network_status.proton_sc ? "active" : "inactive"} )
" ${network_status.proton ? "" : ""}"))) )
)
)

View file

@ -2,45 +2,41 @@
function btstatus(){ function btstatus(){
device_mac_list=$(bluetoothctl devices Paired | awk '{print $2}') # device_mac_list=
device_json_array=() device_json_array=()
for m in ${device_mac_list};do for m in $(bluetoothctl devices Paired | awk '{print $2}');do
device_name="$(bluetoothctl info ${m} | grep 'Name: ' | sed 's/.*Name: //')" IFS=';' read -r dev_name dev_icon dev_connected <<<$(bluetoothctl info "${m}" | grep -e 'Connected\: \|Name\:\|Icon\:' | sed 's/.*: //g' | tr '\n' ';')
device_connected="$(bluetoothctl info ${m} | grep 'Connected: ' | sed 's/.*Connected: //')" # IFS='' read -rd "\n" dev_name dev_icon dev_connected <<<$(bluetoothctl info "${m}" | grep -e 'Connected\: \|Name\:\|Icon\:' | sed -n 's/.*: //p')
device_icon="$(bluetoothctl info ${m} | grep 'Icon: ' | sed 's/.*Icon: //')" # IFS="\n" read -r dev_name dev_icon dev_connected <<<$(bluetoothctl info "${m}" | grep -e 'Connected\: \|Name\:\|Icon\:' | sed -n 's/.*: //p')
case "${device_icon}" in case "${dev_icon}" in
"input-mouse") "input-mouse")
device_icon="󰍽" dev_icon="󰍽";;
;;
"phone") "phone")
device_icon="" dev_icon="";;
;;
"input-keyboard") "input-keyboard")
device_icon="" dev_icon="";;
;;
"input-gaming") "input-gaming")
device_icon="" dev_icon="";;
;;
"audio-headphones") "audio-headphones")
device_icon="" dev_icon="";;
;;
"audio-headset") "audio-headset")
device_icon="" dev_icon="";;
;;
"computer") "computer")
device_icon="" dev_icon="";;
;;
esac esac
device_json=$( jq -n --arg name "${device_name}" --arg connected "${device_connected}" --arg icon "${device_icon}" --arg address "${m}" '{name: $name, connected: $connected, icon: $icon, address: $address}') # device_json=$( jq -n --arg name "${dev_name}" --arg connected "${dev_connected}" --arg icon "${dev_icon}" --arg address "${m}" '{name: $name, connected: $connected, icon: $icon, address: $address}')
device_json_array+=("${device_json}") # device_json_array+=("${device_json}")
done # printf 'Address: %s\nName: %s\nIcon: %s\nConnected: %s\n\n' "${m}" "${dev_name}" "${dev_icon}" "${dev_connected}"
devices_json=$(printf '%s\n' "${device_json_array[@]}" | jq -s .) printf '%s;%s;%s;%s\n' "${m}" "${dev_name}" "${dev_icon}" "${dev_connected}"
echo ${devices_json} done | column -t -n 'bt_devices' -N address,name,icon,connected -s ';' -J | jq -c '.bt_devices'
# devices_json=$(printf '%s\n' "${device_json_array[@]}" | jq -s .)
# echo ${devices_json}
} }
btstatus btstatus
dbus-monitor --profile "interface='org.blueman.Applet',member='MenuChanged'" | while read -r event; do #dbus-monitor --profile "interface='org.blueman.Applet',member='MenuChanged'" | while read -r event; do
dbus-monitor --profile "interface='org.blueman.Applet',member='ToolTipTitleChanged'" | while read -r event; do
btstatus btstatus
done done

View file

@ -0,0 +1,18 @@
#!/bin/bash
function ifstatus(){
jq -cs '{"interfaces": [(.[0].devs[] | select((.type=="wifi") or (.type=="ethernet")))]} * {"vpns": [(.[1].cons[] | select((.type=="vpn") or (.type=="wireguard")))]}' <<<$( \
# nmcli --terse -f DEVICE,TYPE,STATE,CONNECTION d s | column -t -n 'devs' --table-columns device,type,state,connection -s ':' -J; \
nmcli --terse -f DEVICE,TYPE,STATE,CONNECTION d s | sed 's/\\:/###/g;s/:/\;/g;s/###/:/g' | column -t -n 'devs' --table-columns device,type,state,connection -s ';' -J; \
nmcli --terse -f NAME,TYPE,ACTIVE,DEVICE c s | column -t -n 'cons' --table-columns name,type,active,device -s ':' -J)
# [ .devices[] | select((.type=="wifi") or (.type=="ethernet")) ]
}
ifstatus
ip monitor address | {
while read -r event; do
ifstatus
done;
}

View file

@ -0,0 +1,3 @@
(deflisten network_manager
:initial '{ "devices": [], "vpns": [] }'
"scripts/bar/network-manager")

View file

@ -172,8 +172,8 @@ SetEditor=false
1920x1200 screen: Width=941 1920x1200 screen: Width=941
2 screens: Height=1119 2 screens: Height=1119
2 screens: Width=490 2 screens: Width=490
2048x1280 screen: Height=1199 2048x1280 screen: Height=1030
2048x1280 screen: Width=433 2048x1280 screen: Width=1005
3 screens: Height=672 3 screens: Height=672
3 screens: Width=1056 3 screens: Width=1056

View file

@ -11,7 +11,7 @@ Locked=1
Name=Development Name=Development
IsRelative=1 IsRelative=1
Path=development Path=development
StoreID=30267575 StoreID=aa80ffcc
ShowSelector=1 ShowSelector=1
[Profile0] [Profile0]