From 41e66a016474871b9c595d5a9f0d16954b237b75 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Fri, 23 Jul 2021 23:23:39 +0200 Subject: [PATCH] Restrict dimensions of gtk3 file chooser on phone screens Signed-off-by: Stacy Harper --- scripts/core/sxmo_xinit.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/core/sxmo_xinit.sh b/scripts/core/sxmo_xinit.sh index 98ab2de..0c01e71 100755 --- a/scripts/core/sxmo_xinit.sh +++ b/scripts/core/sxmo_xinit.sh @@ -47,6 +47,11 @@ xdefaults() { done [ -e "$HOME"/.Xresources ] && xrdb -merge "$HOME"/.Xresources synclient TapButton1=1 TapButton2=3 TapButton3=2 MinSpeed=0.25 + SCREENWIDTH=$(xrandr | grep "Screen 0" | cut -d" " -f 8) + SCREENHEIGHT=$(xrandr | grep "Screen 0" | cut -d" " -f 10 | tr -d ",") + if [ "$SCREENWIDTH" -lt 1024 ] || [ "$SCREENHEIGHT" -lt 768 ]; then + gsettings set org.gtk.Settings.FileChooser window-size "($SCREENWIDTH,$((SCREENHEIGHT / 2)))" + fi } defaultkeyboard() {