OpenBOX Openbox: let rc.xml program execution settings be the same as the X.org root screen

While trying to create a default xterm menu screen for different computers, I noticed that executing an xterm from within openbox causes the output window specs to be different than from X.org itself. It seems to become a much larger 4:3 window from openbox...
Example: starting an xterm with font size 30 with a configured openbox keyboard shortcut results in a different xterm than when running the identical command in X.org from a terminal.
Who knows where I can find the screen configuration of openbox that causes this to be different? Why is it different?
 
I have xterm settings in .Xresources and in .xinitrc I have xrdb -merge ~/.Xresource and I do not have problems in Openbox and in JWM.
The .Xresources values have to do with it?
No problems either but I'm trying to start a program in a window that has the same monitor-relative dimensions on different systems. 80x25 in fullscreen xterms everywhere would be nice. Starting from openbox or a terminal program shouldn't cause different window sizes. (As far as I know, at least. Does openhox have its own output screen properties? What does it pass to X when a program has to be executed?)
 
Its probably something in your /user/.config/openbox/rc.xml that needs tweaking.

<size>
# the size to make the window.
<width>20</width>
# a number like 20, or 'default' to use the size given by the application.
# you can use fractions such as 1/2 or percentages such as 75% in which
# case the value is relative to the size of the monitor that the window
# appears on.
<height>30%</height>
</size>
 
In openbox I open the alacritty terminal. I configure said terminal in $HOME/.config/alacritty/alacritty.toml. Previously, I used urxvt which I *think* had a default size of 80x24, and I had some stuff configured in $HOME/.Xdefaults but not the geometry, only fonts and foreground/background. I don't see anything like what Phishfry showed about size to make the window. However, this is VERY old rc.xml that has been taken from machine to machine through the ages, probably from 2008 or so. That is, it's a config that I'd save and when installing a new machine, copy it there.
 
In openbox I open the alacritty terminal. I configure said terminal in $HOME/.config/alacritty/alacritty.toml. Previously, I used urxvt which I *think* had a default size of 80x24, and I had some stuff configured in
Same here, I think my version is 15 years old or so but since openbox is very senstive about the config file and crashes on the tiniest error, I assume it's good. It's also really long. Maybe I have to merge all my custom settings with a recent default file.
 
I can only tell you my experience. What I've found is that if there's an error, something like a custom keyboard shortcut might not work. Then, I kill X and look for the error---but again, this hasn't happened in possibly years. So, in my experience, it will start,but things below the error might not work. As MG says, it's a long file. Mine is 954 lines, and every time I think of of doing what MG mentions, merging with a default, I say to myself, "Self? Nahhh". Actually on my main machine I'm using the tiling dwm but my secondary machine as well as laptops use openbox. Sometimes fluxbox if I feel like a change. (Flux's file is a LOT simpler)
 
I'm like scottro, I've been running openbox with the same configs for years. I do try to stick to core apps, particulary in OpenBSD where they have been audited, leading to an approach where I attempted to configure xterm to mostly work like urxvt.
I'll also point out that .Xdefaults and .Xresources function the same with the exception that .Xresources has to be specifically invoked.

My .Xdefault for xterm:
Code:
XTerm*termName: xterm-256color
XTerm*background: #161E2A
XTerm*foreground: white
XTerm*scrollBar: true
XTerm*rightScrollBar: true
XTerm*multiScroll: on
XTerm*jumpScroll: on
XTerm*locale: true
XTerm*faceName: DejaVuSansMono
XTerm*faceSize: 16
XTerm*eightBitInput: true
XTerm*pointerShape: left_ptr
XTerm*showBlinkAsBold: true
XTerm*colorBDMode: true
XTerm*ActiveIcon: true
XTerm*scrollbar.foreground: #2A3144
XTerm*scrollbar.background: #5D5D67
XTerm*scrollbar.thumb: black
XTerm*VT100.scrollbar.translations:  #override \n\
        <Btn5Down>:     StartScroll(Forward) \n\
        <Btn1Down>:     StartScroll(Continuous) MoveThumb() NotifyThumb() \n\
        <Btn4Down>:     StartScroll(Backward) \n\
        <Btn1Motion>:   MoveThumb() NotifyThumb() \n\
        <BtnUp>:        NotifyScroll(Proportional) EndScroll()
XTerm*VT100.color1: #2F4F4F
 
I'm a OpenBox user, no problem in my setup. xterm windows and font have the same size when opened from OpenBox keyboard shortcut or command line.

The color faded xterm window in the image down below is opend with the grep'ed openbox/rc.xml keyboard shortcut, the top layer xterm window is opend from command line.

Nothing xterm related in ~/.Xdefaults.

I would try the OpenBox key shortcut and command line execution from a fresh created or pristine user account, with a default rc.xml, copied from/usr/local/etc/xdg/openbox/rc.xml.sample.

xterm-openbox.png
 
That's what I do. I usually strip out autostart and add my programs to it.
mkdir -p /home/xorg/.config/openbox
cp -vr /usr/local/etc/xdg/openbox/ /home/xorg/.config/openbox
I maintain a backed-up copy of the .config/openbox/ directory (all files), with all the customization I made, copy that directory to newly created users.
 
MG, were you able to find out what caused the problem?
With a workaround. I made a fullscreen xterm start and exit on the background to write it's own lines and columns count to a /tmp file, so we can calculate roughly what the size of an xterm should be, relative to the monitor size. There's still a difference between Nvidia and Intel graphics on the same monitor. I have no idea what causes this.
I have the slight idea that X at the start already accepts visual configuration before the display server is ready.
I'm using .xinitrc as start script. It seems to remember the output of "tput columns" and "tput lines" that were correct on the vt terminal before X started.

But xterm is very legacy anyway. I'm also looking for a nice graphical terminal that's scalable without steps and does smooth scrolling. The font size could be bound to the window size. Qemu does this too but with a vm output window. I haven't seen anything else. Maybe the large DE's like KDE and Gnome have something for that...
 
My
.Xdefaults
Code:
! FONTS
! -----------------------------------------------------------------------------
  Xft.antialias:  true
  Xft.hinting:    false
  Xft.hintstyle:  0
  Xft.dpi:        96
  Xft.rgba:       none

! ALL TERMINALS CONFIG | XTERM | URXVT
! -----------------------------------------------------------------------------
  *background:             #222222
  *foreground:             #aaaaaa
! *fading:                 40
! *fadeColor:              #222222
  *cursorColor:            #93a1a1
  *pointerColorBackground: #586e75
  *pointerColorForeground: #93a1a1
!mouse
Xcursor*size: 36
Xcursor*theme: Bibata-Modern-Amber
! XTERM
! -----------------------------------------------------------------------------
  xterm*allowBoldFonts:     true
  xterm*allowWindowOps:     true
  xterm*boldMode:           false
  xterm*charClass:          33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48,35:48,58:48,63:48,61:48,44:48,38:48,59:48
  xterm*cursorBlink:        false
  xterm*cutNewline:         true
  xterm*faceName:           consolas
  xterm*faceSize:           16
  xterm*fastScroll:         true
  xterm*fullscreen:         false
  xterm*iconHint:           /home/USER/.icons/xterm.xpm
  xterm*internalBorder:     1
  xterm*jumpScroll:         true
  xterm*keepSelection:      true
  xterm*loginShell:         true
  xterm*metaSendsEscape:    true
  xterm*multiScroll:        true
  xterm*omitTranslation:    fullscreen
  xterm*on4Clicks:          group
  xterm*on5Clicks:          page
  xterm*saveLines:          1024000
  xterm*scaleHeight:        1.0
  xterm*scrollKey:          true
  xterm*scrollTtyOutput:    false
  xterm*selectToClipboard:  true
  xterm.vt100.scrollBar : true
  xterm.vt100.scrollbar.width : 8
  xterm*SimpleMenu*font:    -*-clean-*-*-*-*-*-*-*-*-*-*-iso8859-2
  xterm*termName:           xterm-256color
  xterm*title:              xterm
  xterm*veryBoldColors:     14
  xterm*VT100*geometry:     90x40X+0+540
  xterm*VT100*translations: #override \
    <Btn1Up>: select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0) \n\
    <Btn2Up>: insert-selection(PRIMARY) \n\
    Shift <Key> Insert: insert-selection(CLIPBOARD) \n\
    Ctrl Shift <Key> V: insert-selection(CLIPBOARD) \n\
    Ctrl Shift <Key> C: copy-selection(CLIPBOARD) \n\
    Ctrl <Key> minus: smaller-vt-font() \n\
    Ctrl <Key> plus: larger-vt-font()

!-------------------------------------------------------------------------------
! URxvt settings
!-------------------------------------------------------------------------------
URxvt.depth:                 24
URxvt.geometry:             125x33
URxvt.transparent:          true
URxvt.loginShell:           true
URxvt.visualBell:           false
URxvt.termName:             rxvt-unicode-256color

! Fonts
URxvt*font:                 xft:Hack:pixelsize=24
URxvt*boldFont:             xft:Hack:pixelsize=24
URxvt.letterSpace:          -1

! Scrollbar
URxvt.scrollStyle:          rxvt
URxvt.scrollBar:            true

! Perl extensions
URxvt.perl-ext-common: default,matcher,tabbed,font-size

URxvt.url-launcher: firefox
URxvt.matcher.button: 1

URxvt.keysym.M-c:           perl:clipboard:copy
URxvt.keysym.M-v:           perl:clipboard:paste

URxvt.tabbed.tabbar-fg: 2
URxvt.tabbed.tabbar-bg: 0
URxvt.tabbed.tab-fg: 3
URxvt.tabbed.tab-bg: 0

! special
*.foreground:   #d2d4de
*.background:   #161821
*.cursorColor:  #d2d4de

! black
*.color0:       #161821
*.color8:       #6b7089

! red
*.color1:       #e27878
*.color9:       #e98989

! green
*.color2:       #b4be82
*.color10:      #c0ca8e

! yellow
*.color3:       #e2a478
*.color11:      #e9b189

! blue
*.color4:       #84a0c6
*.color12:      #91acd1

! magenta
*.color5:       #a093c7
*.color13:      #ada0d3

! cyan
*.color6:       #89b8c2
*.color14:      #95c4ce

! white
*.color7:       #c6c8d1
*.color15:      #d2d4de

! XCALC
! -----------------------------------------------------------------------------
  xcalc*ti.button1.vertDistance:          4
  xcalc*ti.button2.vertDistance:          4
  xcalc*ti.button3.vertDistance:          4
  xcalc*ti.button4.vertDistance:          4
  xcalc*ti.button5.vertDistance:          4
  xcalc*ti.background:                    gray90
  xcalc*ti.bevel.borderColor:             gray65
  xcalc*ti.bevel.borderWidth:             1
  xcalc*ti.bevel.vertDistance:            4
  xcalc*ti.bevel.defaultDistance:         0
  xcalc*ti.bevel.background:              rgb:b/c/b
  xcalc*ti.bevel.screen*background:       rgb:b/c/b
  xcalc*ti.bevel.screen.borderColor:      rgb:b/c/b
  xcalc*ti.bevel.screen.vertDistance:     10
  xcalc*ti.bevel.screen.horizDistance:    10
  xcalc*ti.bevel.screen*left:             chainLeft
  xcalc*ti.bevel.screen*right:            chainRight
  xcalc*ti.bevel.screen*top:              chainTop
  xcalc*ti.bevel.screen*bottom:           chainBottom
  xcalc*ti.bevel.screen*LCD.foreground:   gray10
  xcalc*ti.bevel.screen*INV.vertDistance: 0
  xcalc*ti.Command.borderColor:           gray65
  xcalc*ti.Command.background:            gray85
  xcalc*ti.Command.foreground:            gray30
  xcalc*ti.button5.background:            rgb:e/b/b
  xcalc*ti.button20.background:           rgb:e/d/c
  xcalc*ti.button25.background:           rgb:e/d/c
  xcalc*ti.button30.background:           rgb:e/d/c
  xcalc*ti.button35.background:           rgb:e/d/c
  xcalc*ti.button40.background:           rgb:b/b/e
  xcalc*ti.button22.background:           gray95
  xcalc*ti.button23.background:           gray95
  xcalc*ti.button24.background:           gray95
  xcalc*ti.button27.background:           gray95
  xcalc*ti.button28.background:           gray95
  xcalc*ti.button29.background:           gray95
  xcalc*ti.button32.background:           gray95
  xcalc*ti.button33.background:           gray95
  xcalc*ti.button34.background:           gray95
  xcalc*ti.button37.background:           gray95
  xcalc*ti.button38.background:           gray95
  xcalc*ti.button39.background:           gray95

! XMESSAGE
! -----------------------------------------------------------------------------
  xmessage*form.okay.shapeStyle:          rectangle
  xmessage*form.okay.background:          IndianRed
  xmessage*form.okay.foreground:          rgb:e/b/b
  xmessage*message*background:            ivory3
  xmessage*background:                    gray85
  xmessage*foreground:                    gray15
  xmessage*Scrollbar.width:               1
  xmessage*Scrollbar.borderWidth:         0
  xmessage*Text.?.cursorColor:            rgb:d/5/5
  xmessage*Text.borderColor:              gray65
  xmessage*Text*background:               gray95
  xmessage*Command.highlightThickness:    1
  xmessage*Command.internalWidth:         5
  xmessage*Command.internalHeight:        3
  xmessage*Command.borderColor:           gray40
  xmessage*Command.shapeStyle:            Rectangle
  xmessage*Command.background:            gray80
  xmessage*font:                          -*-clean-*-*-*-*-*-*-*-*-*-*-iso8859-2
! Herbe
herbe.background_color: #3e3e3e
herbe.border_color: #ececec
herbe.font_color: #ececec
herbe.font_pattern: monospace:size=10
herbe.line_spacing: 5
herbe.padding: 15
herbe.width: 450
herbe.border_size: 2
herbe.pos_x: 30
herbe.pos_y: 60
! 0 = TOP_LEFT, 1 = TOP_RIGHT, 2 = BOTTOM_LEFT, 3 = BOTTOM_RIGHT
herbe.corner: 1
herbe.duration: 5
Xcursor.theme: Bibata-Modern-Amber
Xcursor.size: 36
My
.xsession

(Choice afther login XDM)
Code:
#!/bin/sh
#conf pour xdm
LOG="$HOME/log/xsession-selector.log"
mkdir -p "$HOME/log"

choose_session() {
    if command -v rofi >/dev/null 2>&1; then
        printf '%s\n' "FVWM" "Openbox" "Fluxbox" "XFCE" \
        | rofi -dmenu -i -p "Session"
        return
    fi

    printf '%s\n' "FVWM"
}

echo "[$(date '+%F %T')] start .xsession" >> "$LOG"

CHOICE="$(choose_session)"
echo "[$(date '+%F %T')] choice=$CHOICE" >> "$LOG"

case "$CHOICE" in
    Openbox|openbox)
        echo "[$(date '+%F %T')] exec openbox" >> "$LOG"
        exec "$HOME/.config/X/start-openbox.sh"
        ;;
    Fluxbox|fluxbox)
        echo "[$(date '+%F %T')] exec fluxbox" >> "$LOG"
        exec "$HOME/.config/X/start-fluxbox.sh"
        ;;
    FVWM|fvwm|"")
        echo "[$(date '+%F %T')] exec fvwm" >> "$LOG"
        exec "$HOME/.config/X/start-fvwm.sh"
        ;;
    XFCE|xfce)
      echo "[$(date '+%F %T')] exec start-xfce" >> "$LOG"       
      exec "$HOME/.config/X/start-xfce.sh"
      ;;
    *)
        echo "[$(date '+%F %T')] invalid choice, fallback fvwm" >> "$LOG"
        exec "$HOME/.config/X/start-fvwm.sh"
        ;;
esac

My
session-common.sh
Code:
#!/bin/sh
export LANG="fr_FR.UTF-8"
export LC_COLLATE="C.UTF-8"
export MM_CHARSET="fr_FR.UTF-8"
export QT_QPA_PLATFORMTHEME=qt6ct
export GDK_USE_XFT=1
export QT_XFT=1

[ -f "$HOME/.Xdefaults" ] && xrdb -merge "$HOME/.Xdefaults"

setxkbmap -layout fr -variant azerty
#[ -r "$HOME/.Xmodmap" ] && xmodmap "$HOME/.Xmodmap"

# PulseAudio
pgrep -x pulseaudio >/dev/null 2>&1 || \
  pulseaudio --start --log-target=syslog &

#cherche mail
pgrep -x fetchmail >/dev/null 2>&1 || \
  fetchmail -d 300 -N -L "$HOME/log/fetchmail.log" &

numlockx on &
My

start-openbox.sh

Code:
#!/bin/sh

# Session X commune
. "$HOME/.config/X/session-common.sh"
# Openbox
exec openbox-session
Perhaps this can serve as inspiration;
rc.xml
defines the behavior of Openbox itself.
 
But xterm is very legacy anyway. I'm also looking for a nice graphical terminal that's scalable without steps and does smooth scrolling.
I'm using x11/alacritty for many year, and recently x11/terminator (mainly for built-in tabs). I was tired to walk through configuration files of more spartan xterminals (xterm, urxvt, also alacritty) to setup it up to my liking. terminator has a nice configuration gui, it has screen splitting and grouping I find very useful.
 
I'm using x11/alacritty for many year, and recently x11/terminator (mainly for built-in tabs). I was tired to walk through configuration files of more spartan xterminals (xterm, urxvt, also alacritty) to setup it up to my liking. terminator has a nice configuration gui, it has screen splitting and grouping I find very useful.
Installed it as test some time ago but I didn't do anything with it yet. It's at least fast like xterm. But you have to learn a configuration framework? I forgot the name... It's what you meet if you want to change the background color to black.
 
Installed it as test some time ago but I didn't do anything with it yet. It's at least fast like xterm. But you have to learn a configuration framework? I forgot the name... It's what you meet if you want to change the background color to black.
I assume you are referring to alacritty. It comes with a lot of documentation (not exactly light reading). See also manuals under "SEE ALSO".
 
Back
Top