• OT: setting the dimensions of xterm terminal

    From Sivaram Neelakantan@21:1/5 to All on Sun Aug 22 21:42:17 2021
    In a fit of madness, I enabled X server in WSL ubuntu on my laptop.
    As my laptop keeps changing quite frequently which means the screen
    size keeps changing too and hence the xterm starts off at a different
    position in each laptop. Now, I do know how to set the dimensions in
    .[Xx]res* files but I do have to keep fiddling the numbers to get it
    right so that it's offset by a few points from the top left.

    Does anyone have a script or a function to compute the screen size and
    suggest a typical 'fullwidth' by 40 rows size for xterm starting at the
    top left?

    For some reason, I've got obsessed with xterm starting off at random
    positions on the screen and could only get part way to at least
    iteratively, manually change the resource files repeatedly to get it
    right.

    !use xwininfo to get geometry
    xterm*VT100.geometry: 172x39+0+23 !painfully identified as fullwidth
    ! was spilling over beyond screen dimensions. 39 because windows
    taskbar overlays last row.


    What do you do?

    sivaram
    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Sivaram Neelakantan on Sun Aug 22 19:07:59 2021
    On 22.08.2021 18:12, Sivaram Neelakantan wrote:

    In a fit of madness, I enabled X server in WSL ubuntu on my laptop.
    As my laptop keeps changing quite frequently which means the screen
    size keeps changing too and hence the xterm starts off at a different position in each laptop. Now, I do know how to set the dimensions in .[Xx]res* files but I do have to keep fiddling the numbers to get it
    right so that it's offset by a few points from the top left.

    Does anyone have a script or a function to compute the screen size and suggest a typical 'fullwidth' by 40 rows size for xterm starting at the
    top left?

    I am a bit confused about what you try to achieve here with the
    172x39+0+23 setting and full-screen.

    If I want full-screen (with an xterm) I use option '-fullscreen'.
    I also don't need offsets because the menu bar gets not convered.
    And how many columns can be displayed depends also on font size.

    Could it be that you see an issue where there is none?

    Janis

    For some reason, I've got obsessed with xterm starting off at random positions on the screen and could only get part way to at least
    iteratively, manually change the resource files repeatedly to get it
    right.

    !use xwininfo to get geometry
    xterm*VT100.geometry: 172x39+0+23 !painfully identified as fullwidth
    ! was spilling over beyond screen dimensions. 39 because windows
    taskbar overlays last row.


    What do you do?

    sivaram


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sivaram Neelakantan@21:1/5 to Janis Papanagnou on Mon Aug 23 11:41:25 2021
    On Sun, Aug 22 2021,Janis Papanagnou wrote:


    [snipped 15 lines]


    If I want full-screen (with an xterm) I use option '-fullscreen'.
    I also don't need offsets because the menu bar gets not convered.
    And how many columns can be displayed depends also on font size.

    Could it be that you see an issue where there is none?


    -fs is making xterm spill beyond the right screen frame and below the
    windows taskbar which I don't know how to fix or resolve and hence
    those magic fiddly numbers.

    [snipped 17 lines]

    sivaram
    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Sivaram Neelakantan on Mon Aug 23 11:00:42 2021
    On 23.08.2021 08:11, Sivaram Neelakantan wrote:
    On Sun, Aug 22 2021,Janis Papanagnou wrote:


    [snipped 15 lines]


    If I want full-screen (with an xterm) I use option '-fullscreen'.
    I also don't need offsets because the menu bar gets not convered.
    And how many columns can be displayed depends also on font size.

    Could it be that you see an issue where there is none?


    -fs is making xterm spill beyond the right screen frame and below the
    windows taskbar which I don't know how to fix or resolve and hence
    those magic fiddly numbers.

    I cannot tell why the "fontsize" option (-fs) does that in your
    environment, in mine there's no "spilling". (I mentioned -fs
    only because the font size influences screen size if rows/columns
    are defined; "172x39" might fit on screen with one font size and
    not fit with another one.)

    But as I understand you just wanted full-screen mode, i.e.

    xterm -fullscreen

    Or did I miss a requirement in your original post?

    Janis


    [snipped 17 lines]

    sivaram


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sivaram Neelakantan@21:1/5 to Janis Papanagnou on Mon Aug 23 18:16:39 2021
    On Mon, Aug 23 2021,Janis Papanagnou wrote:


    [snipped 17 lines]


    I cannot tell why the "fontsize" option (-fs) does that in your
    environment, in mine there's no "spilling". (I mentioned -fs
    only because the font size influences screen size if rows/columns
    are defined; "172x39" might fit on screen with one font size and
    not fit with another one.)

    But as I understand you just wanted full-screen mode, i.e.

    xterm -fullscreen

    Or did I miss a requirement in your original post?

    Janis


    oh wait, I messed up my requirements. If I launch xterm in
    fullscreen, it spills over on the right and also below the taskbar of
    Windows(I run wsl ubuntu). To fix that, I had to fiddle the numbers
    to position xterm where I want. And was asking for any function that
    computes dimensions for arbitrary laptop screen sizes as I gave up on
    finding out why fullscreen was overflowing.

    And you're right that changing font size from 10 to 12 does make it wonky.

    Net net, ignoring why fullscreen makes it overflow, is there any function/script that can generate a dimension set worth using?

    sivaram
    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Javier@21:1/5 to Sivaram Neelakantan on Wed Aug 25 16:10:19 2021
    Sivaram Neelakantan <nsivaram.net@gmail.com> wrote:
    Net net, ignoring why fullscreen makes it overflow, is there any function/script that can generate a dimension set worth using?

    From xterm(1):

    -maximized
    This option indicates that xterm should ask the window manager
    to maximize its layout on startup. This corresponds to the
    maximized resource.

    Maximizing is not the reverse of iconifying; it is possible to
    do both with certain window managers.

    It should work all right thing on any window manager, or at least in
    those that are ICCCM compliant.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Keith Thompson@21:1/5 to Javier on Wed Aug 25 15:32:06 2021
    Javier <invalid@invalid.invalid> writes:
    Sivaram Neelakantan <nsivaram.net@gmail.com> wrote:
    Net net, ignoring why fullscreen makes it overflow, is there any
    function/script that can generate a dimension set worth using?

    From xterm(1):

    -maximized
    This option indicates that xterm should ask the window manager
    to maximize its layout on startup. This corresponds to the
    maximized resource.

    Maximizing is not the reverse of iconifying; it is possible to
    do both with certain window managers.

    It should work all right thing on any window manager, or at least in
    those that are ICCCM compliant.

    In the environments I use most often (Cygwin on Windows 10 and
    Cinnamon on Ubuntu), `xterm -maximized` does *not* do the same
    thing as launching an xterm and then maximizing it.

    `xterm -maximized` creates an xterm window that's big enough to fill
    (almost) the entire display, but it's still an ordinary window that I
    can move around and resize. With or without the `-maximized` option, if
    I click the maximize button (typically in the upper right next to the
    close button) or double-click the title bar, or use an appropriate
    keyboard shortcut, I get a full-screen window that still has a title
    bar, but I can't move or resize it without un-maximizing it.

    I don't know if that means these window managers are not
    ICCCM compliant. I personally would find it more convenient if
    `xterm -maximized` created a true full-screen window, which is
    usually what I want. Instead, I generally just launch an xterm
    and maximize it manually. It's mildly annoying, but not bad enough
    so far to induce me to find a better solution.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    Working, but not speaking, for Philips
    void Void(void) { Void(); } /* The recursive call of the void */

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Keith Thompson on Thu Aug 26 00:44:29 2021
    On 26.08.2021 00:32, Keith Thompson wrote:
    Javier <invalid@invalid.invalid> writes:
    Sivaram Neelakantan <nsivaram.net@gmail.com> wrote:
    Net net, ignoring why fullscreen makes it overflow, is there any
    function/script that can generate a dimension set worth using?

    From xterm(1):

    -maximized
    This option indicates that xterm should ask the window manager
    to maximize its layout on startup. This corresponds to the >> maximized resource.

    Maximizing is not the reverse of iconifying; it is possible to
    do both with certain window managers.

    It should work all right thing on any window manager, or at least in
    those that are ICCCM compliant.

    In the environments I use most often (Cygwin on Windows 10 and
    Cinnamon on Ubuntu), `xterm -maximized` does *not* do the same
    thing as launching an xterm and then maximizing it.

    `xterm -maximized` creates an xterm window that's big enough to fill
    (almost) the entire display, but it's still an ordinary window that I
    can move around and resize. With or without the `-maximized` option, if
    I click the maximize button (typically in the upper right next to the
    close button) or double-click the title bar, or use an appropriate
    keyboard shortcut, I get a full-screen window that still has a title
    bar, but I can't move or resize it without un-maximizing it.

    Funny effect; a 'xterm -maximize' on my system fills one physical
    screen, and if I pick its title bar to move it a bit around the
    screen size instantly doubles (I have two logical screens running
    side by side).

    (But the screen-resize function on my Linux has anyway many bugs
    that are similar or even more annoying.)

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Javier@21:1/5 to Sivaram Neelakantan on Wed Aug 25 18:37:11 2021
    Sivaram Neelakantan <nsivaram.net@gmail.com> wrote:

    -fs is making xterm spill beyond the right screen frame and below the
    windows taskbar which I don't know how to fix or resolve and hence
    those magic fiddly numbers.

    [snipped 17 lines]

    sivaram

    I don't find that a problem. In xterm you can switch between
    full-screen and default size with Alt-Enter. The same key combination
    that was used for MS-DOS consoles in windows.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Javier@21:1/5 to Keith Thompson on Wed Aug 25 18:28:11 2021
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Javier <invalid@invalid.invalid> writes:
    Sivaram Neelakantan <nsivaram.net@gmail.com> wrote:
    Net net, ignoring why fullscreen makes it overflow, is there any
    function/script that can generate a dimension set worth using?

    From xterm(1):

    -maximized
    This option indicates that xterm should ask the window manager
    to maximize its layout on startup. This corresponds to the >> maximized resource.

    Maximizing is not the reverse of iconifying; it is possible to
    do both with certain window managers.

    It should work all right thing on any window manager, or at least in
    those that are ICCCM compliant.

    In the environments I use most often (Cygwin on Windows 10 and
    Cinnamon on Ubuntu), `xterm -maximized` does *not* do the same
    thing as launching an xterm and then maximizing it.

    `xterm -maximized` creates an xterm window that's big enough to fill
    (almost) the entire display, but it's still an ordinary window that I
    can move around and resize. With or without the `-maximized` option, if
    I click the maximize button (typically in the upper right next to the
    close button) or double-click the title bar, or use an appropriate
    keyboard shortcut, I get a full-screen window that still has a title
    bar, but I can't move or resize it without un-maximizing it.

    I don't know if that means these window managers are not
    ICCCM compliant. I personally would find it more convenient if
    `xterm -maximized` created a true full-screen window, which is
    usually what I want. Instead, I generally just launch an xterm
    and maximize it manually. It's mildly annoying, but not bad enough
    so far to induce me to find a better solution.


    I'm getting the same behaviour in fvwm2. I get an xterm whose size is
    the root window + the size of the titlebar. I think a default
    maximized size and default positioning policy needs to be defined in
    the window manager config. But that would be window-manager specific.

    I guess the best is just to write an script for getting the root
    window size and calculate teh xterm size from that:

    #!/usr/bin/env bash
    w=$(xwininfo -root | sed -n '/ Width: /s/ Width: //p')
    h=$(xwininfo -root | sed -n '/ Height: /s/ Height: //p')
    xterm -fn 10x20 -geometry $((w/10-12))x$((h/20-9))+0+0

    There is also xprop which gives more complete information than xwininfo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sivaram Neelakantan@21:1/5 to Javier on Thu Aug 26 18:22:12 2021
    On Wed, Aug 25 2021,Javier wrote:


    [snipped 46 lines]


    #!/usr/bin/env bash
    w=$(xwininfo -root | sed -n '/ Width: /s/ Width: //p')
    h=$(xwininfo -root | sed -n '/ Height: /s/ Height: //p')
    xterm -fn 10x20 -geometry $((w/10-12))x$((h/20-9))+0+0

    There is also xprop which gives more complete information than xwininfo

    Thanks, I'll try this out.

    sivaram
    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sivaram Neelakantan@21:1/5 to Keith Thompson on Thu Aug 26 18:21:39 2021
    On Wed, Aug 25 2021,Keith Thompson wrote:


    [snipped 17 lines]


    In the environments I use most often (Cygwin on Windows 10 and
    Cinnamon on Ubuntu), `xterm -maximized` does *not* do the same
    thing as launching an xterm and then maximizing it.

    `xterm -maximized` creates an xterm window that's big enough to fill
    (almost) the entire display, but it's still an ordinary window that I
    can move around and resize. With or without the `-maximized` option, if
    I click the maximize button (typically in the upper right next to the
    close button) or double-click the title bar, or use an appropriate
    keyboard shortcut, I get a full-screen window that still has a title
    bar, but I can't move or resize it without un-maximizing it.

    I don't know if that means these window managers are not
    ICCCM compliant. I personally would find it more convenient if
    `xterm -maximized` created a true full-screen window, which is
    usually what I want. Instead, I generally just launch an xterm
    and maximize it manually. It's mildly annoying, but not bad enough
    so far to induce me to find a better solution.

    this is what I get too.

    sivaram
    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to Christian Weisgerber on Thu Aug 26 15:40:13 2021
    On Thu, 26 Aug 2021 14:49:58 +0000, Christian Weisgerber wrote:

    On 2021-08-25, Javier <invalid@invalid.invalid> wrote:

    I don't find that a problem. In xterm you can switch between
    full-screen and default size with Alt-Enter.

    That's not a standard feature of xterm. Either your setup adds a
    key-binding action, or it's a feature of your window manager.

    I beg to differ. This feature works in (at least) xterm -version X.Org 7.7.0(367),
    and is documented in that version's manpage.


    XTERM(1) X Window System XTERM(1)

    NAME
    xterm - terminal emulator for X

    SYNOPSIS
    xterm [-toolkitoption ...] [-option ...] [shell]

    DESCRIPTION
    The xterm program is a terminal emulator for the X Window System.
    ...

    Default Key Bindings
    The default bindings in the VTxxx window use the SELECT token, which is
    set by the selectToClipboard resource. These are for the vt100 widget:
    ...
    Alt <Key>Return:fullscreen() \n\


    --
    Lew Pitcher
    "In Skills, We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Weisgerber@21:1/5 to Javier on Thu Aug 26 14:49:58 2021
    On 2021-08-25, Javier <invalid@invalid.invalid> wrote:

    I don't find that a problem. In xterm you can switch between
    full-screen and default size with Alt-Enter.

    That's not a standard feature of xterm. Either your setup adds a
    key-binding action, or it's a feature of your window manager.

    --
    Christian "naddy" Weisgerber naddy@mips.inka.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)