dot/xinitrc: Add hacking for Gtk 3-based `pterm'.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 16:57:07 +0000 (17:57 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 16:57:07 +0000 (17:57 +0100)
dot/xinitrc

index 5b7cd61..a2af5c3 100755 (executable)
@@ -259,7 +259,14 @@ e_colchars=$(( e_colsz + e_colextrachars ))
 ## t_lineht, t_vextra = height parameters: if the window is N lines high,
 ##     then it will be N*t_lineht + t_vextra pixels high
 case "$term" in
-  pterm) t_wd=504 t_lineht=13 t_vextra=23 geom=-geometry;;
+  pterm)
+    ## The pterm width differs according to whether it's linked against Gtk 2
+    ## or 3.  Let's find out...
+    case $(ldd $(command -v pterm) | grep libgtk) in
+      libgtk-2*) t_wd=504 ;;
+      *) t_wd=500 ;;
+    esac
+    t_lineht=13 t_vextra=23 geom=-geometry;;
   Eterm) t_wd=504 t_lineht=13 t_vextra=23 geom=-g;;
   xterm) t_wd=507 t_lineht=13 t_vextra=27 geom=-geometry;;
 esac