USBDM default window width in Linux - Page 1
Forum section: electronics / general

author: Circlotron
author_rank: Super Contributor
timestamp: September 25, 2022, 07:08:27 am
content: When I use the stand alone programmer software for USBDM I have five instances of the software running, each with a different binary file loaded. Five instances takes up a lot of screen width so I have to manually resize the windows.Is there an easy way in Linux to change the default width of these windows? Some file that holds all the startup parameters?

author: janoc
author_rank: Super Contributor
timestamp: September 25, 2022, 08:16:45 am
content: No idea about USBDM software - that may have a setting somewhere in its config file specifying the window geometry. I doubt it, though - it would have likely been in the preferences already.Concerning Linux - depends? There is no "the Linux" and you haven't said what you are using. Especially the window manager matters - that is where these things happen. So it is not possible to give you a more specific advice.E.g. in KDE Plasma you can right click on the title bar, More Actions->Configure Special Window settings or More Actions->Configure Special Application settings and there you can set things such as forcing the size of the specific application/window. A well written application will work with that. Plasma will remember the setting and apply it every time it sees a window that matches whatever selector you have configured there (window ID, window title, application, etc.).Other window managers often have similar features. Usually either accessible through the window title bar or sometime (usually with the various "lite" WMs) through configuration files.

author: Circlotron
author_rank: Super Contributor
timestamp: September 25, 2022, 08:19:27 am
content: Okay. I'm using Mint Mate FWIW.Right clicking the title bar doesn't provide a suitable option.

author: janoc
author_rank: Super Contributor
timestamp: September 25, 2022, 09:08:45 am
content: Yeah, then you may be out of luck. Gnome (MATE is fork of Gnome 2) is not known for exactly providing features that the authors deem "unnecessary" for the users. You may want to try a different desktop environment, not sure what Mint ships with.Another option is using something like wmctrl:https://stackoverflow.com/questions/288512/resizing-a-window-to-a-set-size-in-linux#That command may be available for installation using the package manager.

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 25, 2022, 09:54:14 am
content: Quote from: Circlotron on September 25, 2022, 07:08:27 amUsually the widget toolkit (Gtk, WxWidgets, Qt) supports command-line arguments to set the location and/or width and/or height of the window.When they do not, you can write a launcher script that useswmctrlto force the window dimensions and/or location. You then modify menu entry for the application to run the launcher script instead of the application directly.(In Cinnamon, the menu editor is accessible by right-clicking the application menu icon, and picking Configure.., and then on the Menu tab, clicking Open the menu editor. Not sure about Mate.)Even easier is to write a keyboard shortcut that resizes the currently active window. In Cinnamon, the keyboard shortcuts are in Preferences > Keyboard, in the Shortcut tab. Add a custom shortcut, giving it a descriptive name like "Resize to 512x384", with the command beingwmctrl -r :ACTIVE: -e 0,-1,-1,512,384Then, add a binding to it by double-clicking in the Keyboard bindings section, and pressing the desired key combination, for example Shift+F11. It works immediately.If the USBDM windows are the only ones with USBDM in their title (in upper or lower case), thenwmctrl -r usbdm -e 0,-1,-1,512,-1will resize each of them to 512 pixels wide (unless they are maximized).The argument towmctrl -eisgravity,left,top,width,heightin desktop coordinates.In a launch script, I usually useLANG=C LC_ALL=C wmctrl -lGp, so I can use the process ID in the third column (andfind /proc/process ID/exe -maxdepth 0 -printf '%l'to identify the executable that created that window), and a temporary child process that waits until the parent process creates the new window, then resizes/moves it, and exits. There is very little overhead, basically no latency, and no extra processes left over.If anyone wants (and shows thewmctrl -lGpline identifying the target windows, with the relatedfind /proc/third-column/exe -maxdepth 0 -printf '%l\n'output), I can easily write an example one you can easily edit yourself further.

author: pgo
author_rank: Regular Contributor
timestamp: September 25, 2022, 01:57:19 pm
content: The initial window size is is hard-coded. There is no option to change this.The dialogue is created using wxFormBuilder. As a short-cut it is actually based on a dialog window so has some issues with resizing etc i.e. it's not a standard window.You could change the values used by modifying the values in shared/src/UsbdmDialgueSkeleton.h @line 202.If you routinely have 5 instances open and always program the same files? I would suggest you try another approach. For example a shell script with a simple menu could run the programmer in console mode with different parameters and check the error code. Launching the programmer in this way has little effect on the programming time.bye