aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/WaybarStartup.sh
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmal.com>2026-07-24 17:04:04 -0400
committerPinapelz <yukais@pinapelz.com>2026-08-29 21:41:34 -0700
commitbeceab7fb97654483b5d505ee6d251b206143aed (patch)
tree28993072f211310d366a2a0110fedc2c2ff47b07 /config/hypr/scripts/WaybarStartup.sh
parent84ed728735d7d2d550675a072879e285a6ebf9f8 (diff)
copy.sh was enablling lua workflow
Added additional checks Signed-off-by: Don Williams <don.e.williams@gmal.com> On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/UserConfigs/01-UserDefaults.conf modified: config/hypr/configs/Startup_Apps.conf modified: config/hypr/lua/startup.lua modified: config/hypr/scripts/WallpaperDaemon.sh modified: config/hypr/scripts/WaybarStartup.sh modified: config/rofi/.current_wallpaper modified: copy.sh modified: scripts/lib_copy.sh
Diffstat (limited to 'config/hypr/scripts/WaybarStartup.sh')
-rwxr-xr-xconfig/hypr/scripts/WaybarStartup.sh44
1 files changed, 33 insertions, 11 deletions
diff --git a/config/hypr/scripts/WaybarStartup.sh b/config/hypr/scripts/WaybarStartup.sh
index 5691c86b..575a7a2b 100755
--- a/config/hypr/scripts/WaybarStartup.sh
+++ b/config/hypr/scripts/WaybarStartup.sh
@@ -10,10 +10,32 @@
runtime_dir="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
export XDG_RUNTIME_DIR="$runtime_dir"
+SCRIPTSDIR="${XDG_CONFIG_HOME:-$HOME/.config}/hypr/scripts"
is_waybar_running() {
pgrep -x "waybar" >/dev/null 2>&1 || pgrep -x '\.waybar-wrapped' >/dev/null 2>&1
}
+wait_for_waybar() {
+ for _ in $(seq 1 30); do
+ is_waybar_running && return 0
+ sleep 0.1
+ done
+ return 1
+}
+ensure_wallust_waybar_colors() {
+ local colors_file="${XDG_CONFIG_HOME:-$HOME/.config}/waybar/wallust/colors-waybar.css"
+ [ -s "$colors_file" ] && return 0
+
+ if [ -x "$SCRIPTSDIR/WallustSwww.sh" ]; then
+ "$SCRIPTSDIR/WallustSwww.sh" >/dev/null 2>&1 || true
+ fi
+
+ for _ in $(seq 1 40); do
+ [ -s "$colors_file" ] && return 0
+ sleep 0.1
+ done
+ return 1
+}
sync_portal_env() {
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment --systemd \
@@ -68,12 +90,14 @@ wait_for_wayland() {
start_waybar_direct() {
if command -v waybar >/dev/null 2>&1; then
waybar >/dev/null 2>&1 &
- return 0
+ wait_for_waybar
+ return $?
fi
if command -v .waybar-wrapped >/dev/null 2>&1; then
.waybar-wrapped >/dev/null 2>&1 &
- return 0
+ wait_for_waybar
+ return $?
fi
return 1
@@ -87,8 +111,7 @@ start_waybar_via_systemd() {
[ -n "$load_state" ] && [ "$load_state" != "not-found" ] || return 1
systemctl --user start waybar.service >/dev/null 2>&1 || return 1
- sleep 0.4
- is_waybar_running
+ wait_for_waybar
}
main() {
@@ -97,18 +120,17 @@ main() {
wait_for_wayland || true
sync_portal_env
start_portal_services || true
+ ensure_wallust_waybar_colors || true
is_waybar_running && exit 0
- if start_waybar_via_systemd; then
+ if start_waybar_via_systemd || start_waybar_direct; then
exit 0
fi
-
- if is_waybar_running; then
- exit 0
- fi
-
- start_waybar_direct || exit 1
+ # 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
}
main
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage