Compare commits

...
6 Commits
Author SHA1 Message Date
sora 208e7cb2b2 Improve eww
update.yml (push) Invalid workflow file
2026-10-30 16:01:01 +01:00
bot 6e2601a39c Merge pull request 'Lock file maintenance' (#329) from renovate/lock-file-maintenance into main
update.yml (push) Invalid workflow file
2026-10-25 03:03:40 +01:00
Renovate Bot 07e14bf4e5 Lock file maintenance
update.yml (push) Invalid workflow file
2026-10-25 02:03:37 +00:00
bot 1657357da4 Merge pull request 'Lock file maintenance' (#328) from renovate/lock-file-maintenance into main
update.yml (push) Invalid workflow file
2026-10-24 04:04:50 +02:00
Renovate Bot dfa4797354 Lock file maintenance
update.yml (push) Invalid workflow file
2026-10-24 02:04:49 +00:00
bot 95aa3ad114 Merge pull request 'Update DeterminateSystems/magic-nix-cache-action action to v15' (#312) from renovate/determinatesystems-magic-nix-cache-action-15.x into main
update.yml (push) Invalid workflow file
2026-10-24 04:04:09 +02:00
6 changed files with 175 additions and 25 deletions

No files matched your search

Generated
+21 -21
View File
@@ -23,11 +23,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1786845137, "lastModified": 1792737899,
"narHash": "sha256-oQFip+v0luP8NIxJzmiW4Wu8bILsbFWom5l0zonl8hQ=", "narHash": "sha256-P0/GhewcEQmAbzq3QunNWY2jLJaYH9F6c/5dEM/jQ4M=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "4cff07de74b50e64bdd68cd4e722ab5b6b35ee48", "rev": "bb0b90dbd54e207100de72b5dcbe3188c98a4b69",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -76,11 +76,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1791721963, "lastModified": 1792697326,
"narHash": "sha256-BYhx89XJltnRyQeuDKHVL5eSqbbfAcOKuDts7QRsrxQ=", "narHash": "sha256-2UBK0jdmPANGaeAIoVOZY+hSPB2Gy13ZuZeSxP3vF8k=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "60a624466c08787ee8303393b7d4752d1826f14f", "rev": "1b418b8f203e49a92f250f8babdd19af1b6f7a7f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -96,11 +96,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1792274446, "lastModified": 1792818383,
"narHash": "sha256-AM1HmBeDnB2B3dSiXuCYeu7Me+lHNpz/P39lVxGJBuQ=", "narHash": "sha256-199i7ubVSXTMl+0AAlL7cVCXSjcI+jWByMcimYjeMX0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "ab3823b4b24c0c3ca984c1f3ee577fd6d667424c", "rev": "24f2190587513b9c2f73db112a17844ae912d965",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -131,11 +131,11 @@
}, },
"nixUnstable": { "nixUnstable": {
"locked": { "locked": {
"lastModified": 1792116957, "lastModified": 1792782095,
"narHash": "sha256-EjZqHKObBfIOeHZnMRVV87HB3pPq/WBkmRJWyFxmZu8=", "narHash": "sha256-KtL+p7f7jY34cO5Mt0/hUZNE3spnINk7hwpYxM2XLC4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f20cd90e28fe0403873f473b29e42662cd86e8c4", "rev": "901c54c08bdc20e00c2b3c73716b97497b1b3c74",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -211,11 +211,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1792030654, "lastModified": 1792615934,
"narHash": "sha256-OaQwAtPMTjQiY2sT/2/62UbSPhzP/0aDnWzMm/NCiUw=", "narHash": "sha256-MlvRfa1O5Cqc2/a+gG+l9TSuowEoCKCmrJ1d9oAVm0I=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "26f4107e47e3ad0ffd0db220469ba83b6f6d96e8", "rev": "da6dc0e7b26060f2f71ce3ef7088fb56ee44fa36",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -245,11 +245,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1792056300, "lastModified": 1792809984,
"narHash": "sha256-YU1LjDe1o2Ymg5zEiCHbmMXLkDCtxHQRiVqZ3nC5GGk=", "narHash": "sha256-KV+CaZX7QS0hcdKxwGKehDb1jmUgx6lbkTPpaoIW5Nw=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "44931708c62937c2b1bf7953902989fa5bb9ee1b", "rev": "442449fa7b1fe6c692d0103ac9fc8f9e82931cf3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -263,11 +263,11 @@
"flake-parts": "flake-parts" "flake-parts": "flake-parts"
}, },
"locked": { "locked": {
"lastModified": 1784312229, "lastModified": 1792669057,
"narHash": "sha256-2uHCSUw341o3my1R0U0YCfbnMEazylxb58evWsjGL50=", "narHash": "sha256-3dBWR7+z35n1Rrg68MghpGEUu9RnlKRzSDrkCzKXj7Q=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-vscode-server", "repo": "nixos-vscode-server",
"rev": "2f984dfbe7e5271b5c413d3e734374cc1306c921", "rev": "442c629540ed1e85cd2aed813a65b7eaa7ff27c5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -23,6 +23,7 @@
@include border-radius; @include border-radius;
font-size: 1.1em; font-size: 1.1em;
} }
.net-add-btn { margin-right: $popup-scale * 2pt; }
// Bluetooth device list // Bluetooth device list
.bt-device-row { margin-bottom: $popup-scale * 4pt; } .bt-device-row { margin-bottom: $popup-scale * 4pt; }
+111
View File
@@ -0,0 +1,111 @@
#!/usr/bin/env bash
# Pick a nearby WiFi network in wofi and connect to it through wpa_supplicant
# (userControlled: the control socket is open to wheel). Networks added here
# live in wpa_supplicant's memory only — the config file is a sops secret and
# is never rewritten — so they are gone after a reboot.
detach_self "$@"
eww close popup 2>/dev/null
eww update active-panel= 2>/dev/null
iface=""
for s in /run/wpa_supplicant/*; do
[[ -S $s && ${s##*/} != p2p-* ]] && { iface=${s##*/}; break; }
done
notify() { notify-send -a WiFi -i network-wireless "$@"; }
[[ -n $iface ]] || { notify "WiFi" "wpa_supplicant is not running"; exit 1; }
wpa() { wpa_cli -g "/run/wpa_supplicant/$iface" "$@"; }
field() { awk -F= -v k="$1" '$1 == k { print substr($0, length(k) + 2); exit }'; }
signal_icon() {
if (($1 >= -50)); then echo "󰤨"
elif (($1 >= -60)); then echo "󰤥"
elif (($1 >= -70)); then echo "󰤢"
elif (($1 >= -80)); then echo "󰤟"
else echo "󰤯"; fi
}
# wpa_cli prints SSIDs with printf-style escapes (\xNN, \\, \")
unescape() { printf '%b' "$1"; }
saved_id() { # SSID → network id
local id s
while IFS=$'\t' read -r id s _; do
[[ $(unescape "$s") == "$1" ]] && { echo "$id"; return; }
done < <(wpa list_networks | tail -n +2)
}
wpa scan >/dev/null
sleep 2
current=$(unescape "$(wpa status | field ssid)")
declare -A ssid_of flags_of
lines=()
# strongest BSS per SSID, strongest first; hidden networks are skipped
while IFS=$'\t' read -r sig flags raw; do
ssid=$(unescape "$raw")
[[ -n $ssid && $ssid != *$'\n'* ]] || continue
line="$(signal_icon "$sig") $ssid"
[[ $flags == *PSK* || $flags == *SAE* || $flags == *EAP* ]] && line+=" 󰌾"
[[ $ssid == "$current" ]] && line+=" 󰄬"
ssid_of[$line]=$ssid
flags_of[$line]=$flags
lines+=("$line")
done < <(wpa scan_results | awk -F'\t' '
NR > 1 && $5 != "" { if (!($5 in best) || $3 > best[$5]) { best[$5] = $3; flags[$5] = $4 } }
END { for (s in best) printf "%s\t%s\t%s\n", best[s], flags[s], s }' | sort -t$'\t' -k1,1nr)
((${#lines[@]})) || { notify "WiFi" "No networks found"; exit 0; }
choice=$(printf '%s\n' "${lines[@]}" | wofi --dmenu -p "WiFi")
[[ -n $choice && -n ${ssid_of[$choice]+x} ]] || exit 0
ssid=${ssid_of[$choice]}
flags=${flags_of[$choice]}
[[ $ssid == "$current" ]] && exit 0
id=$(saved_id "$ssid")
new=0
if [[ -z $id ]]; then
[[ $flags == *EAP* ]] && { notify "$ssid" "Enterprise (EAP) networks are not supported"; exit 1; }
id=$(wpa add_network | tail -n 1)
[[ $id =~ ^[0-9]+$ ]] || { notify "$ssid" "Could not add the network"; exit 1; }
new=1
wpa set_network "$id" ssid "$(printf '%s' "$ssid" | od -An -tx1 | tr -d ' \n')" >/dev/null
if [[ $flags == *PSK* || $flags == *SAE* ]]; then
psk=$(wofi --dmenu --password -p "Password for $ssid" </dev/null)
if ((${#psk} < 8 || ${#psk} > 63)); then
wpa remove_network "$id" >/dev/null
[[ -n $psk ]] && notify "$ssid" "The password must be 8 to 63 characters"
exit 1
fi
wpa set_network "$id" psk "\"$psk\"" >/dev/null
if [[ $flags == *SAE* ]]; then
wpa set_network "$id" key_mgmt WPA-PSK SAE >/dev/null
wpa set_network "$id" ieee80211w 1 >/dev/null
fi
else
wpa set_network "$id" key_mgmt NONE >/dev/null
fi
fi
# select_network disables every other network; re-enable them afterwards so
# the saved ones still auto-connect later.
wpa select_network "$id" >/dev/null
for ((i = 0; i < 30; i++)); do
sleep 0.5
st=$(wpa status)
if [[ $(field wpa_state <<<"$st") == COMPLETED && $(field id <<<"$st") == "$id" ]]; then
wpa enable_network all >/dev/null
notify "Connected" "$ssid"
exit 0
fi
done
((new)) && wpa remove_network "$id" >/dev/null
wpa enable_network all >/dev/null
wpa reassociate >/dev/null
notify "Could not connect to $ssid" "$( ((new)) && echo "Wrong password?" || echo "Timed out")"
exit 1
@@ -15,8 +15,9 @@ api="https://www.radiorecord.ru/api"
unit=eww-radio unit=eww-radio
state_dir=${XDG_STATE_HOME:-$HOME/.local/state}/eww state_dir=${XDG_STATE_HOME:-$HOME/.local/state}/eww
cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}/eww cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}/eww
img_dir=$cache_dir/radio-img
id_file=$state_dir/radio-station id_file=$state_dir/radio-station
mkdir -p "$state_dir" "$cache_dir" mkdir -p "$state_dir" "$cache_dir" "$img_dir"
station_ids='[507,522,523,536,537,42532,42602]' station_ids='[507,522,523,536,537,42532,42602]'
# Extra stations: {id (unique integer >= 1000000), title, stream_hls, icon_fill_white ("" for none)} # Extra stations: {id (unique integer >= 1000000), title, stream_hls, icon_fill_white ("" for none)}
@@ -47,6 +48,32 @@ stations() {
printf '%s\n' "$out" printf '%s\n' "$out"
} }
# GTK loads CSS url() images synchronously on the UI thread: a remote URL
# freezes the whole daemon until the download finishes (or times out). eww
# only ever gets file:// URIs of cached copies.
local_img() { # URL → file:// URI, "" if unavailable
local url=$1 f
case $url in
file://*) printf '%s' "$url"; return ;;
/*) printf 'file://%s' "$url"; return ;;
http://* | https://*) ;;
*) return ;;
esac
f=$img_dir/$(cksum <<<"$url" | cut -d' ' -f1)
if [[ ! -s $f ]]; then
curl -sfL --max-time 5 -o "$f.tmp" "$url" 2>/dev/null && mv "$f.tmp" "$f" || { rm -f "$f.tmp"; return; }
fi
printf 'file://%s' "$f"
}
localize_stations() {
local url map='{}'
while IFS= read -r url; do
map=$(jq -c --arg k "$url" --arg v "$(local_img "$url")" '.[$k] = $v' <<<"$map")
done < <(jq -r '.[].icon_fill_white // empty' <<<"$STATIONS" | sort -u)
STATIONS=$(jq -c --argjson m "$map" 'map(.icon_fill_white = ($m[.icon_fill_white // ""] // ""))' <<<"$STATIONS")
}
station() { # ID FIELD station() { # ID FIELD
jq -r --argjson id "${1:-0}" --arg f "$2" 'first(.[] | select(.id == $id) | .[$f]) // empty' <<<"$STATIONS" jq -r --argjson id "${1:-0}" --arg f "$2" 'first(.[] | select(.id == $id) | .[$f]) // empty' <<<"$STATIONS"
} }
@@ -141,7 +168,8 @@ song_playing() { # ID → SONG from the station history (radiorecord) or the tit
if [[ $(station "$id" radiorecord) == true ]]; then if [[ $(station "$id" radiorecord) == true ]]; then
fetched=$(curl -sf --compressed --max-time 8 "$api/station/history/?id=$id" 2>/dev/null \ fetched=$(curl -sf --compressed --max-time 8 "$api/station/history/?id=$id" 2>/dev/null \
| jq -c '.result.history[0] | {artist: (.artist // ""), song: (.song // ""), image600: (.image600 // "")}' 2>/dev/null) | jq -c '.result.history[0] | {artist: (.artist // ""), song: (.song // ""), image600: (.image600 // "")}' 2>/dev/null)
[[ -n $fetched && $fetched != null ]] && SONG=$fetched [[ -n $fetched && $fetched != null ]] \
&& SONG=$(jq -c --arg i "$(local_img "$(jq -r .image600 <<<"$fetched")")" '.image600 = $i' <<<"$fetched")
else else
SONG=$(jq -cn --arg t "$(station "$id" title)" '{artist: "", song: $t, image600: ""}') SONG=$(jq -cn --arg t "$(station "$id" title)" '{artist: "", song: $t, image600: ""}')
fi fi
@@ -159,7 +187,7 @@ media_event() {
if [[ -z $player ]]; then if [[ -z $player ]]; then
MEDIA=$default_media MEDIA_PLAYER="" MEDIA=$default_media MEDIA_PLAYER=""
elif [[ $player != mpv* ]]; then # the radio and jellyfin are mpv, not "external" elif [[ $player != mpv* ]]; then # the radio and jellyfin are mpv, not "external"
MEDIA=$(media_json "$player" "$status" "$artist" "$title" "$art") MEDIA=$(media_json "$player" "$status" "$artist" "$title" "$(local_img "$art")")
MEDIA_PLAYER=$player MEDIA_PLAYER=$player
fi fi
} }
@@ -206,7 +234,9 @@ refresh() {
} }
status_loop() { status_loop() {
find "$img_dir" -type f -mtime +7 -delete 2>/dev/null
STATIONS=$(stations) STATIONS=$(stations)
localize_stations
SONG=$default_song MEDIA=$default_media MEDIA_PLAYER="" PLAYING="" LAST_SONG=0 LAST_VOL="" SONG=$default_song MEDIA=$default_media MEDIA_PLAYER="" PLAYING="" LAST_SONG=0 LAST_VOL=""
refresh refresh
mux_init mux_init
@@ -10,6 +10,7 @@
(box :orientation "h" :space-evenly false :valign "center" :class "sys-section-header" (box :orientation "h" :space-evenly false :valign "center" :class "sys-section-header"
(box :class "section-accent ${accent}") (box :class "section-accent ${accent}")
(label :class "sys-label" :text title :hexpand true :halign "start") (label :class "sys-label" :text title :hexpand true :halign "start")
(children)
(button (button
:class "net-toggle-btn ${enabled ? 'net-toggle-on' : 'net-toggle-off'}" :class "net-toggle-btn ${enabled ? 'net-toggle-on' : 'net-toggle-off'}"
:onclick onclick :onclick onclick
@@ -23,7 +24,13 @@
:title "WiFi" :accent "wifi-accent" :title "WiFi" :accent "wifi-accent"
:enabled {net.wifi.enabled} :enabled {net.wifi.enabled}
:onclick {net.wifi.enabled ? "rfkill block wlan" : "rfkill unblock wlan"} :onclick {net.wifi.enabled ? "rfkill block wlan" : "rfkill unblock wlan"}
:icon-on "󰤨" :icon-off "󰖪") :icon-on "󰤨" :icon-off "󰖪"
(button
:class "net-toggle-btn net-toggle-on net-add-btn"
:visible {net.wifi.enabled}
:onclick "scripts/net/wifi-connect"
:tooltip "Connect to a network"
(label :text "󰐕")))
(box :orientation "v" :space-evenly false (box :orientation "v" :space-evenly false
:visible {net.wifi.connected} :visible {net.wifi.connected}
(netinfo-row :label "SSID" :value {net.wifi.ssid}) (netinfo-row :label "SSID" :value {net.wifi.ssid})
@@ -21,6 +21,7 @@ let
"scripts/net/bt" = mkScript "bt" ./bar/scripts/net/bt [ jq glib ]; "scripts/net/bt" = mkScript "bt" ./bar/scripts/net/bt [ jq glib ];
"scripts/net/bt-toggle" = mkScript "bt-toggle" ./bar/scripts/net/bt-toggle [ bluez ]; "scripts/net/bt-toggle" = mkScript "bt-toggle" ./bar/scripts/net/bt-toggle [ bluez ];
"scripts/net/wg-toggle" = mkScript "wg-toggle" ./bar/scripts/net/wg-toggle [ ]; "scripts/net/wg-toggle" = mkScript "wg-toggle" ./bar/scripts/net/wg-toggle [ ];
"scripts/net/wifi-connect" = mkScript "wifi-connect" ./bar/scripts/net/wifi-connect [ eww wpa_supplicant wofi libnotify ];
"scripts/sys/gpu" = mkScript "gpu" ./bar/scripts/sys/gpu [ custom.amdgpu_top jq ]; "scripts/sys/gpu" = mkScript "gpu" ./bar/scripts/sys/gpu [ custom.amdgpu_top jq ];
"scripts/sys/memory" = mkScript "memory" ./bar/scripts/sys/memory [ ]; "scripts/sys/memory" = mkScript "memory" ./bar/scripts/sys/memory [ ];
"scripts/sys/battery" = mkScript "battery" ./bar/scripts/sys/battery [ ]; "scripts/sys/battery" = mkScript "battery" ./bar/scripts/sys/battery [ ];