The update prompt speaks Chinese and points What's new at the OmarchyCN releases page; the Wi-Fi, update, keybindings, dictation, and default-agent first-run notices follow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
31 lines
1.1 KiB
Bash
31 lines
1.1 KiB
Bash
notify_update() {
|
|
omarchy-notification-send -u critical -g "更新系统" "点击以更新系统。" \
|
|
--exec omarchy-launch-floating-terminal-with-presentation omarchy-update
|
|
}
|
|
|
|
notify_wifi() {
|
|
omarchy-notification-send -u critical -g "设置 Wi-Fi" "点击以配置无线网络。" \
|
|
--exec omarchy-shell shell toggle omarchy.network
|
|
}
|
|
|
|
announce_network() {
|
|
# Ethernet is still negotiating DHCP when the session starts, so probing
|
|
# right away calls a working machine offline. NetworkManager reports startup
|
|
# complete once it has tried every connection it could auto-activate, which
|
|
# is the first moment the answer means anything.
|
|
nm-online -q -s -t 30
|
|
|
|
# -x takes that answer as it stands rather than waiting out the timeout, so
|
|
# a laptop with nothing to connect to gets prompted immediately.
|
|
if ! nm-online -q -x -t 30; then
|
|
notify_wifi
|
|
# Nothing to update against until a link lands, so hold that prompt.
|
|
nm-online -q -t 3600 || return
|
|
fi
|
|
|
|
notify_update
|
|
}
|
|
|
|
# Detached, so a slow or absent connection never holds up the rest of first run.
|
|
announce_network &
|