Move bar-settings and background-switcher into the shell
This commit is contained in:
@@ -5,14 +5,4 @@
|
||||
# omarchy:name=bar-settings
|
||||
# omarchy:examples=omarchy launch bar-settings
|
||||
|
||||
OMARCHY_PATH="${OMARCHY_PATH:-$HOME/.local/share/omarchy}"
|
||||
CONFIG_DIR="$OMARCHY_PATH/default/quickshell/bar-settings"
|
||||
|
||||
if quickshell list -p "$CONFIG_DIR" 2>/dev/null | grep -q '^Instance '; then
|
||||
if ! hyprctl dispatch focuswindow 'title:Omarchy bar settings' 2>/dev/null | grep -q ok; then
|
||||
hyprctl dispatch focuswindow 'initialTitle:Omarchy bar settings' >/dev/null 2>&1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
setsid uwsm-app -- env OMARCHY_PATH="$OMARCHY_PATH" quickshell -p "$CONFIG_DIR" >/dev/null 2>&1 &
|
||||
exec omarchy-shell-ipc shell summon omarchy.bar-settings "{}"
|
||||
|
||||
@@ -84,7 +84,7 @@ done_file=$(mktemp)
|
||||
rm -f "$done_file"
|
||||
trap 'rm -f "$selection_file" "$done_file"' EXIT
|
||||
socket_path="${XDG_RUNTIME_DIR:-/run/user/$UID}/omarchy-image-selector.sock"
|
||||
selector_qml="$OMARCHY_PATH/default/quickshell/background-switcher.qml"
|
||||
shell_dir="$OMARCHY_PATH/default/quickshell/omarchy-shell"
|
||||
|
||||
image_dirs_env=""
|
||||
for dir in "${image_dirs[@]}"; do
|
||||
@@ -230,14 +230,11 @@ if [[ $cache_only == true || $prepare_only == true ]]; then
|
||||
fi
|
||||
|
||||
ensure_selector() {
|
||||
if [[ -S $socket_path && $selector_qml -nt $socket_path ]]; then
|
||||
quickshell kill -p "$selector_qml" >/dev/null 2>&1 || true
|
||||
rm -f "$socket_path"
|
||||
fi
|
||||
|
||||
# The image-selector socket is owned by omarchy-shell. Make sure the shell is
|
||||
# alive; once it is, the BackgroundSwitcher plugin keeps the socket bound for
|
||||
# the lifetime of the shell.
|
||||
if [[ ! -S $socket_path ]]; then
|
||||
quickshell kill -p "$selector_qml" >/dev/null 2>&1 || true
|
||||
quickshell -d -p "$selector_qml" >/dev/null
|
||||
omarchy-shell-ipc shell ping >/dev/null 2>&1 || true
|
||||
|
||||
for ((i = 0; i < 100; i++)); do
|
||||
if [[ -S $socket_path ]]; then
|
||||
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Send an IPC call to omarchy-shell, starting it if not running
|
||||
# omarchy:hidden=true
|
||||
|
||||
OMARCHY_PATH="${OMARCHY_PATH:-$HOME/.local/share/omarchy}"
|
||||
SHELL_DIR="$OMARCHY_PATH/default/quickshell/omarchy-shell"
|
||||
|
||||
if ! quickshell list -p "$SHELL_DIR" 2>/dev/null | grep -q '^Instance '; then
|
||||
setsid uwsm-app -- env OMARCHY_PATH="$OMARCHY_PATH" quickshell -p "$SHELL_DIR" >/dev/null 2>&1 &
|
||||
for _ in 1 2 3 4 5 6 7 8 9 10; do
|
||||
sleep 0.2
|
||||
quickshell list -p "$SHELL_DIR" 2>/dev/null | grep -q '^Instance ' && break
|
||||
done
|
||||
fi
|
||||
|
||||
exec quickshell ipc -p "$SHELL_DIR" call "$@"
|
||||
Reference in New Issue
Block a user