diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-08-09 03:05:36 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:34 -0700 |
| commit | f1694b519cd73d1bf2b2424ed893489cd1a8d8b3 (patch) | |
| tree | b8e2bd4e54c7b06142508c9e60090a0882c38ebc /config/hypr/scripts/WaybarStartup.sh | |
| parent | 1f754ef8cfc24cb29b18ba1bf905fb73e56e8d2e (diff) | |
Fix: waybar startup/restart in Fedora
Conflicts with waybar.service when hyprland-uwsm session not selected
Fixed startup config files
Added gate check for AGS to remove errors when not installed
Signed-off-by: Don Williams <don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: CHANGELOG.md
modified: config/hypr/configs/Startup_Apps.conf
modified: config/hypr/lua/startup.lua
modified: config/hypr/lua/user_startup_helper.lua
modified: config/hypr/scripts/DarkLight.sh
modified: config/hypr/scripts/PortalHyprland.sh
modified: config/hypr/scripts/Refresh.sh
modified: config/hypr/scripts/ToggleWaybarTime.sh
modified: config/hypr/scripts/WaybarStartup.sh
modified: scripts/migrate-hypr-to-lua.sh
Diffstat (limited to 'config/hypr/scripts/WaybarStartup.sh')
| -rwxr-xr-x | config/hypr/scripts/WaybarStartup.sh | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/config/hypr/scripts/WaybarStartup.sh b/config/hypr/scripts/WaybarStartup.sh index 8cd36efb..7f8ee1e2 100755 --- a/config/hypr/scripts/WaybarStartup.sh +++ b/config/hypr/scripts/WaybarStartup.sh @@ -62,17 +62,11 @@ start_portal_services() { } wait_for_wayland() { - # If WAYLAND_DISPLAY is already valid, use it. if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -S "$runtime_dir/$WAYLAND_DISPLAY" ]; then return 0 fi - # Otherwise wait briefly for an available Wayland socket. - for _ in $(seq 1 120); do - if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -S "$runtime_dir/$WAYLAND_DISPLAY" ]; then - return 0 - fi - + for _ in $(seq 1 30); do for socket in "$runtime_dir"/wayland-[0-9]*; do [ -S "$socket" ] || continue case "$(basename "$socket")" in @@ -87,48 +81,41 @@ wait_for_wayland() { return 1 } +ensure_wallust_waybar_colors() { + local colors_file="${XDG_CONFIG_HOME:-$HOME/.config}/waybar/wallust/colors-waybar.css" + mkdir -p "$(dirname "$colors_file")" 2>/dev/null || true + if [ ! -f "$colors_file" ]; then + touch "$colors_file" 2>/dev/null || true + fi + if [ ! -s "$colors_file" ] && [ -x "$SCRIPTSDIR/WallustSwww.sh" ]; then + "$SCRIPTSDIR/WallustSwww.sh" >/dev/null 2>&1 & + fi +} + start_waybar_direct() { if command -v waybar >/dev/null 2>&1; then waybar >/dev/null 2>&1 & - wait_for_waybar - return $? + return 0 fi if command -v .waybar-wrapped >/dev/null 2>&1; then .waybar-wrapped >/dev/null 2>&1 & - wait_for_waybar - return $? + return 0 fi return 1 } -start_waybar_via_systemd() { - [ -x "$(command -v systemctl)" ] || return 1 - - local load_state - load_state="$(systemctl --user show waybar.service --property=LoadState --value 2>/dev/null || true)" - [ -n "$load_state" ] && [ "$load_state" != "not-found" ] || return 1 - - systemctl --user start waybar.service >/dev/null 2>&1 || return 1 - wait_for_waybar -} - main() { - wait_for_wayland || true - sync_portal_env - # Portal services are already started by PortalHyprland.sh; no need to wait here. - ensure_wallust_waybar_colors || true - is_waybar_running && exit 0 + wait_for_wayland || true + sync_portal_env || true + ensure_wallust_waybar_colors if start_waybar_via_systemd || start_waybar_direct; then exit 0 fi - # One retry after attempting to refresh wallust templates. - ensure_wallust_waybar_colors || true - sleep 0.3 - start_waybar_via_systemd || start_waybar_direct || exit 1 + exit 1 } main |
