Files
omarchy/install/user/first-run/wifi.sh
T
ZacharyZhang-NY a9b39710a2 Add Simplified Chinese as a system language
The installer asks for the language before the keyboard, and
Setup > Language (omarchy language en|zh) switches it later. Under
zh_CN the menu reads its labels from omarchy-menu.zh-cn.jsonc, the
shell from I18nZh.js through I18n.tr, and notifications are worded
by their sender through omarchy-text, which reads the same table.
User text is never translated.
2026-10-12 02:56:40 -04:00

31 lines
1.2 KiB
Bash

notify_update() {
omarchy-notification-send -u critical -g  "$(omarchy-text "Update System")" "$(omarchy-text "Click to update the system.")" \
--exec omarchy-launch-floating-terminal-with-presentation omarchy-update
}
notify_wifi() {
omarchy-notification-send -u critical -g 󰖩 "$(omarchy-text "Setup Wi-Fi")" "$(omarchy-text "Click to configure the wireless network.")" \
--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 &