From 30a0ea757ce5c5cc604d230c39040b0d4fefcec7 Mon Sep 17 00:00:00 2001 From: Amolith Date: Tue, 21 May 2024 21:33:24 -0400 Subject: [PATCH] Fix Wayland detection --- dot_local/bin/executable_startup.tmpl | 36 +++++++++++---------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/dot_local/bin/executable_startup.tmpl b/dot_local/bin/executable_startup.tmpl index c8b0bea9a5d8fa3a75c28493aec29c5962bbdc86..02b8fbad035fb544d0928f558e5187b23043fcd2 100644 --- a/dot_local/bin/executable_startup.tmpl +++ b/dot_local/bin/executable_startup.tmpl @@ -1,30 +1,25 @@ #!/bin/bash -matched=$(hyprctl instances | grep -oE "instance [a-zA-Z0-9]{40}_[a-zA-Z0-9]{10}:") - -if [[ -n $matched ]]; then - # We're in Wayland - hyprctl dispatch exec -- "waybar" - hyprctl dispatch exec -- "blueman-applet" - hyprctl dispatch exec -- "gammastep" - hyprctl dispatch exec -- "/usr/lib/geoclue-2.0/demos/agent" - hyprctl dispatch exec -- "dunst" - hyprctl dispatch exec -- "playerctl pause" - hyprctl dispatch exec -- "solaar -w hide" - hyprctl dispatch exec -- "emacs --daemon" - hyprctl dispatch exec -- "xrdb -load ~/.Xresources" - hyprctl dispatch exec -- "xfsettingsd" - hyprctl dispatch exec -- "darkman get" - hyprctl dispatch exec -- "dbus-update-activation-environment --all" - hyprctl dispatch exec -- "telegram-desktop" +if [[ -n $WAYLAND_DISPLAY ]]; then + hyprctl -i 0 dispatch exec -- "waybar" + hyprctl -i 0 dispatch exec -- "blueman-applet" + hyprctl -i 0 dispatch exec -- "gammastep" + hyprctl -i 0 dispatch exec -- "/usr/lib/geoclue-2.0/demos/agent" + hyprctl -i 0 dispatch exec -- "dunst" + hyprctl -i 0 dispatch exec -- "playerctl pause" + hyprctl -i 0 dispatch exec -- "solaar -w hide" + hyprctl -i 0 dispatch exec -- "emacs --daemon" + hyprctl -i 0 dispatch exec -- "xrdb -load ~/.Xresources" + hyprctl -i 0 dispatch exec -- "xfsettingsd" + hyprctl -i 0 dispatch exec -- "dbus-update-activation-environment --all" + hyprctl -i 0 dispatch exec -- "telegram-desktop" {{- if eq .chezmoi.hostname "angmar" }} - hyprctl dispatch exec -- "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile" - hyprctl dispatch exec -- "firefox-developer-edition" + hyprctl -i 0 dispatch exec -- "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile" + hyprctl -i 0 dispatch exec -- "firefox-developer-edition" {{- end }} sleep 5 hyprctl dispatch exec -- "nextcloud" else - # We're in i3 (X.org) i3-msg exec "polybar top" i3-msg exec "polybar bottom" i3-msg exec "feh --bg-scale ~/.wallpaper.png" @@ -41,7 +36,6 @@ else i3-msg exec "emacs --daemon" i3-msg exec "xrdb -load ~/.Xresources" i3-msg exec "xfsettingsd" - i3-msg exec "darkman get" i3-msg exec "dbus-update-activation-environment --all" {{- if eq .chezmoi.hostname "angmar" }} i3-msg exec "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile"