]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
terminal: run alacritty with LIBGL_ALWAYS_SOFTWARE=1
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 25 Dec 2025 13:30:33 +0000 (10:30 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 25 Dec 2025 13:30:33 +0000 (10:30 -0300)
terminal

index abd4cd9d8a9ca39141100e625584ec75ff947bdf..7e37c2658bc9921e65cb1adba4a8dcab9ec7c4c0 100755 (executable)
--- a/terminal
+++ b/terminal
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Terminal emulator wrapper
 #
@@ -75,9 +75,20 @@ elif [ "$TERM" == "xterm" ]; then
     xterm -u8 $FN_FONT -geometry $GEOMETRY -title $TITLE -e $SH
   fi
 elif [ "$TERM" == "alacritty" ]; then
+  # Run alacritty with LIBGL_ALWAYS_SOFTWARE to avoid glitches during startup
+  # or when switching windows and workspaces.
+  #
+  # Problem description:
+  # https://forum.endeavouros.com/t/weird-glitches-when-switching-workspaces-and-launching-windows/32862
+  # https://github.com/alacritty/alacritty/issues/6680
+  #
+  # Solution, sincel alacritty uses OpenGL:
+  # https://docs.mesa3d.org/envvars.html#envvar-LIBGL_ALWAYS_SOFTWARE
+  # https://superuser.com/questions/106056/force-software-based-opengl-rendering-on-ubuntu
+  #
   if [ ! -z "$1" ]; then
-    alacritty -e $SH -c "$*"
+    LIBGL_ALWAYS_SOFTWARE=1 alacritty -e $SH -c "$*"
   else
-    alacritty
+    LIBGL_ALWAYS_SOFTWARE=1 alacritty
   fi
 fi