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
(include "modules/bar/idle_inhibit.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/vpn.yuck")
(include "variables/bar/bluetooth.yuck")

View file

@ -5,18 +5,22 @@
:revealvar reveal_network
:revealvar-name "reveal_network"
(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"
:orientation "h"
:space-evenly false
:halign "center"
(button :onclick {network_status.wifi ? 'scripts/bar/network-updown wifi down' : 'scripts/bar/network-updown wifi up'}
:class {network_status.wifi ? "active" : "inactive"}
"")
(button :onclick {network_status.wired ? 'scripts/bar/network-updown ethernet down' : 'scripts/bar/network-updown ethernet up'}
:class {network_status.wired ? "active" : "inactive"}
"󰈀")))
(for interface in array
(button :onclick "nmcli device ${( interface.state == 'connected' ? 'down' : 'up' )} ${interface.device}"
:class {( interface.state == "connected" ? 'active' : 'inactive' )}
:tooltip "${interface.connection} (${interface.device})"
{( interface.type == "wifi" ? "" : ( interface.type == "ethernet" ? "󰈀" : "" ))}
)
)
)
)

View file

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

View file

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

View file

@ -2,45 +2,41 @@
function btstatus(){
device_mac_list=$(bluetoothctl devices Paired | awk '{print $2}')
# device_mac_list=
device_json_array=()
for m in ${device_mac_list};do
device_name="$(bluetoothctl info ${m} | grep 'Name: ' | sed 's/.*Name: //')"
device_connected="$(bluetoothctl info ${m} | grep 'Connected: ' | sed 's/.*Connected: //')"
device_icon="$(bluetoothctl info ${m} | grep 'Icon: ' | sed 's/.*Icon: //')"
case "${device_icon}" in
for m in $(bluetoothctl devices Paired | awk '{print $2}');do
IFS=';' read -r dev_name dev_icon dev_connected <<<$(bluetoothctl info "${m}" | grep -e 'Connected\: \|Name\:\|Icon\:' | sed 's/.*: //g' | tr '\n' ';')
# IFS='' read -rd "\n" dev_name dev_icon dev_connected <<<$(bluetoothctl info "${m}" | grep -e 'Connected\: \|Name\:\|Icon\:' | sed -n 's/.*: //p')
# IFS="\n" read -r dev_name dev_icon dev_connected <<<$(bluetoothctl info "${m}" | grep -e 'Connected\: \|Name\:\|Icon\:' | sed -n 's/.*: //p')
case "${dev_icon}" in
"input-mouse")
device_icon="󰍽"
;;
dev_icon="󰍽";;
"phone")
device_icon=""
;;
dev_icon="";;
"input-keyboard")
device_icon=""
;;
dev_icon="";;
"input-gaming")
device_icon=""
;;
dev_icon="";;
"audio-headphones")
device_icon=""
;;
dev_icon="";;
"audio-headset")
device_icon=""
;;
dev_icon="";;
"computer")
device_icon=""
;;
dev_icon="";;
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_array+=("${device_json}")
done
devices_json=$(printf '%s\n' "${device_json_array[@]}" | jq -s .)
echo ${devices_json}
# 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}")
# printf 'Address: %s\nName: %s\nIcon: %s\nConnected: %s\n\n' "${m}" "${dev_name}" "${dev_icon}" "${dev_connected}"
printf '%s;%s;%s;%s\n' "${m}" "${dev_name}" "${dev_icon}" "${dev_connected}"
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
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
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
2 screens: Height=1119
2 screens: Width=490
2048x1280 screen: Height=1199
2048x1280 screen: Width=433
2048x1280 screen: Height=1030
2048x1280 screen: Width=1005
3 screens: Height=672
3 screens: Width=1056

View file

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