summaryrefslogtreecommitdiff
path: root/run-wayland-compositor
diff options
context:
space:
mode:
authorMartin Stransky <stransky@redhat.com>2021-04-04 18:51:01 +0200
committerMartin Stransky <stransky@redhat.com>2021-04-04 18:51:01 +0200
commit9869746357fecb892b80986ac923c137b1e6c94d (patch)
tree93bf582811e0bfa2d3fbf513ee644091aea8e194 /run-wayland-compositor
parentAdded fix for mozbz#1702606 / rhbz#1936071, Switched tests back to X11 due to... (diff)
downloadlibrewolf-fedora-ff-9869746357fecb892b80986ac923c137b1e6c94d.tar.gz
librewolf-fedora-ff-9869746357fecb892b80986ac923c137b1e6c94d.tar.bz2
librewolf-fedora-ff-9869746357fecb892b80986ac923c137b1e6c94d.zip
Fixed wayland tests/PGO, enable PGO on Fedora 33+
Diffstat (limited to 'run-wayland-compositor')
-rwxr-xr-xrun-wayland-compositor47
1 files changed, 47 insertions, 0 deletions
diff --git a/run-wayland-compositor b/run-wayland-compositor
new file mode 100755
index 0000000..db3035d
--- /dev/null
+++ b/run-wayland-compositor
@@ -0,0 +1,47 @@
+#!/usr/bin/bash
+# Run wayland compositor and set WAYLAND_DISPLAY env variable
+
+set -x
+
+echo export DESKTOP_SESSION=gnome > $HOME/.xsessionrc
+echo export XDG_CURRENT_DESKTOP=GNOME > $HOME/.xsessionrc
+echo export XDG_SESSION_TYPE=wayland >> $HOME/.xsessionrc
+
+# Turn off the screen saver and screen locking
+gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
+gsettings set org.gnome.desktop.screensaver lock-enabled false
+gsettings set org.gnome.desktop.screensaver lock-delay 3600
+
+# Disable the screen saver
+# This starts the gnome-keyring-daemon with an unlocked login keyring. libsecret uses this to
+# store secrets. Firefox uses libsecret to store a key that protects sensitive information like
+# credit card numbers.
+if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
+ # if not found, launch a new one
+ eval `dbus-launch --sh-syntax`
+fi
+eval `echo '' | /usr/bin/gnome-keyring-daemon -r -d --unlock --components=secrets`
+
+if [ -z "$XDG_RUNTIME_DIR" ]; then
+ export XDG_RUNTIME_DIR=$HOME
+fi
+
+xvfb-run -s "-screen 0 1600x1200x24" -n 80 mutter --wayland --nested &
+
+if [ -z "$WAYLAND_DISPLAY" ] ; then
+ export WAYLAND_DISPLAY=wayland-0
+else
+ export WAYLAND_DISPLAY=wayland-1
+fi
+sleep 10
+retry_count=0
+max_retries=5
+until [ $retry_count -gt $max_retries ]; do
+ if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then
+ retry_count=$(($max_retries + 1))
+ else
+ retry_count=$(($retry_count + 1))
+ echo "Waiting for Mutter, retry: $retry_count"
+ sleep 2
+ fi
+done
bgstack15