diff --git a/bin/omarchy-network-status b/bin/omarchy-network-status index 2f8a9875..abb3a8b5 100755 --- a/bin/omarchy-network-status +++ b/bin/omarchy-network-status @@ -37,7 +37,7 @@ print_status() { nm=$(nmcli -t -f GENERAL.STATE,GENERAL.CONNECTION dev show "$device" 2>/dev/null) state=$(awk -F: '$1 == "GENERAL.STATE" { print $2; exit }' <<<"$nm") ssid=$(awk -F: '$1 == "GENERAL.CONNECTION" { print $2; exit }' <<<"$nm") - signal=$(nmcli -t -f IN-USE,SIGNAL dev wifi list ifname "$device" 2>/dev/null | awk -F: '$1 == "*" { print $2; exit }') + signal=$(nmcli -t -f IN-USE,SIGNAL dev wifi list ifname "$device" --rescan no 2>/dev/null | awk -F: '$1 == "*" { print $2; exit }') freq=$(iw dev "$device" link 2>/dev/null | awk '/freq:/ { print $2; exit }') if [[ $state != 100* ]]; then diff --git a/bin/omarchy-restart-shell b/bin/omarchy-restart-shell index 332b95b0..71eaed81 100755 --- a/bin/omarchy-restart-shell +++ b/bin/omarchy-restart-shell @@ -114,6 +114,38 @@ hyprland_session_locked() { [[ $monitors == *"session lock"* ]] } +shell_quote() { + printf "'" + printf "%s" "$1" | sed "s/'/'\\\\''/g" + printf "'" +} + +lua_quote() { + local value=$1 + value=${value//\\/\\\\} + value=${value//\"/\\\"} + value=${value//$'\n'/\\n} + printf '"%s"' "$value" +} + +launch_shell() { + local launch_command + + launch_command="env OMARCHY_PATH=$(shell_quote "$omarchy_root") PATH=$(shell_quote "$PATH") quickshell -n -p $(shell_quote "$CONFIG_DIR")" + + if [[ -n ${HYPRLAND_INSTANCE_SIGNATURE:-} ]] && omarchy-cmd-present hyprctl; then + if hyprctl dispatch "hl.dsp.exec_cmd($(lua_quote "$launch_command"))" >/dev/null 2>&1; then + return 0 + fi + + if hyprctl dispatch exec "$launch_command" >/dev/null 2>&1; then + return 0 + fi + fi + + setsid quickshell -n -p "$CONFIG_DIR" >/dev/null 2>&1 & +} + restore_hyprland_session_lock() { local attempt @@ -141,7 +173,7 @@ fi pkill -x quickshell 2>/dev/null || true sleep 0.2 -setsid quickshell -n -p "$CONFIG_DIR" >/dev/null 2>&1 & +launch_shell if (( hyprland_was_session_locked )); then restore_hyprland_session_lock