0

I want to set the windows size in bash script but I don't know which command is used to set the windows size.

When open the File Browser in Ubuntu Desktop, and then change the Windows size of the File Browser by dragging the bottom-right corner of File Browser, and then close the Window and reopen the File Browser, the windows size will change to the last size.

Here is the picture of File Browser: enter image description here

Where is the config file for storing the last updated windows size of File Browser? Or what bash command can be used to set the windows size?

muru
  • 197,895
  • 55
  • 485
  • 740
stackbiz
  • 267
  • Read this post: https://askubuntu.com/questions/612251/nautilus-geometry and the second answer from @WinEunuuchs2Unix but like this: nautilus . >/dev/null 2>&1 & sleep 1 && wmctrl -r "Home" -e '0,100,100,1530,914' (you could replace Home by the name of your Nautilus window, for me (I'am french), it's Dossier Personnel) – Arnaud Valmary Aug 18 '23 at 05:50
  • @ArnaudValmary will not work on 22.04 with Wayland, though. On Xorg, better use devilspie or devilspie2 for this. – vanadium Aug 18 '23 at 06:37

1 Answers1

1

To open a nautilus window from a script with a specific size, you can first customize the dconf setting org.gnome.nautilus.window-state initial-size to the size you want.

gsettings set org.gnome.nautilus.window-state initial-size "(1200,800)"
nautilus

will open a new nautilus window with the desired size.

vanadium
  • 88,010