Linux Window positioning

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fph
    Veteran
    • Apr 2009
    • 1030

    Linux Window positioning

    Is there a way to have Angband (on Linux) save and restore the position of its subwindows (term-n)? At least on the X11 port with GNOME/Ubuntu 9.10, this does not seem to happen.
    Maybe it's a window-manager issue, but metacity does not seem to provide this ability, and I know this is handled explicitly in angband.ini in Windows.

    Thanks,
    --
    Dive fast, die young, leave a high-CHA corpse.
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    Originally posted by fph
    Is there a way to have Angband (on Linux) save and restore the position of its subwindows (term-n)? At least on the X11 port with GNOME/Ubuntu 9.10, this does not seem to happen.
    Maybe it's a window-manager issue, but metacity does not seem to provide this ability, and I know this is handled explicitly in angband.ini in Windows.

    Thanks,
    Yes, there is. There's a script file embedded in comments in the source code, which lets you specify the position, size and font for each subwindow on X11. I think it's in main-x11.c ... <goes off to check>.

    Yes, here it is:
    Code:
     * #!/bin/csh
     *
     * # Describe attempt
     * echo "Launching angband..."
     * sleep 2
     *
     * # Main window
     * setenv ANGBAND_X11_FONT_0 10x20
     * setenv ANGBAND_X11_AT_X_0 5
     * setenv ANGBAND_X11_AT_Y_0 510
     *
     * # Message window
     * setenv ANGBAND_X11_FONT_1 8x13
     * setenv ANGBAND_X11_AT_X_1 5
     * setenv ANGBAND_X11_AT_Y_1 22
     * setenv ANGBAND_X11_ROWS_1 35
     *
     * # Inventory window
     * setenv ANGBAND_X11_FONT_2 8x13
     * setenv ANGBAND_X11_AT_X_2 635
     * setenv ANGBAND_X11_AT_Y_2 182
     * setenv ANGBAND_X11_ROWS_2 23
     *
     * # Equipment window
     * setenv ANGBAND_X11_FONT_3 8x13
     * setenv ANGBAND_X11_AT_X_3 635
     * setenv ANGBAND_X11_AT_Y_3 22
     * setenv ANGBAND_X11_ROWS_3 12
     *
     * # Monster recall window
     * setenv ANGBAND_X11_FONT_4 6x13
     * setenv ANGBAND_X11_AT_X_4 817
     * setenv ANGBAND_X11_AT_Y_4 847
     * setenv ANGBAND_X11_COLS_4 76
     * setenv ANGBAND_X11_ROWS_4 11
     *
     * # Object recall window
     * setenv ANGBAND_X11_FONT_5 6x13
     * setenv ANGBAND_X11_AT_X_5 817
     * setenv ANGBAND_X11_AT_Y_5 520
     * setenv ANGBAND_X11_COLS_5 76
     * setenv ANGBAND_X11_ROWS_5 24
     *
     * # The build directory
     * cd ~/Angband
     *
     * # Gamma correction
     * setenv ANGBAND_X11_GAMMA 142
     *
     * # Launch Angband
     * ./src/angband -mx11 -- -n6 &
    Obviously you'll need to remove the asterisks, and you'll also need to convert it to your favourite shell. If you use bash, you need export instead of setenv.

    You can add stanzas for subwindows 6 and 7, of course - and change all the values.
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

    • d_m
      Angband Devteam member
      • Aug 2008
      • 1517

      #3
      Maybe we should add a contrib/ directory and put this script in it.
      linux->xterm->screen->pmacs

      Comment

      • fph
        Veteran
        • Apr 2009
        • 1030

        #4
        Thanks a lot!

        Code:
         * echo "Launching angband..."
         * sleep 2
        Sleep 2? Uhm... for better responsivity, I guess?
        --
        Dive fast, die young, leave a high-CHA corpse.

        Comment

        • pav
          Administrator
          • Apr 2007
          • 793

          #5
          Place something like this in your ~/.angband/Angband/x11-settings.prf -- it's a bit easier than a shell script wrapper.

          Code:
          # Angband X11 settings
          
          TERM_WINS=4
          
          # Term 0
          AT_X_0=0
          AT_Y_0=0
          COLS_0=220
          ROWS_0=74
          IBOX_0=1
          IBOY_0=1
          FONT_0=8x13
          TILE_WIDTH_0=8
          TILE_HEIGHT_0=13
          
          AT_X_1=0
          AT_Y_1=1000
          ROWS_1=14
          FONT_1=8x13
          
          AT_X_2=650
          AT_Y_2=1000
          ROWS_2=14
          FONT_2=8x13
          
          AT_X_3=1300
          AT_Y_3=1000
          COLS_3=60
          ROWS_3=14
          FONT_3=8x13
          See the elves and everything! http://angband.oook.cz

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎