LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Bless hex editor create & name custom layout file (https://www.linuxquestions.org/questions/linux-software-2/bless-hex-editor-create-and-name-custom-layout-file-4175636185/)

LenHoff 08-11-2018 05:26 PM

Solved: Bless hex editor create & name custom layout file
 
In Bless hex editor, anyone created a custom layout file to change startup UI size?

I read the manual & found (only) one example on Github - but he just edited the default.layout to change font in ascii area.
https://github.com/bdsword/bless-lay...default.layout.
Code:

<layout>
  <area type="offset">
    <display>
      <evenrow>
        <evencolumn>
          <foreground>dark red</foreground>
          <background>white</background>
        </evencolumn>
      </evenrow>
      <oddrow>
        <evencolumn>
          <foreground>dark red</foreground>
          <background>white</background>
        </evencolumn>
      </oddrow>
      <font>Monaco 12</font>
    </display>
  </area>
  <area type="separator">
    <display>
      <evenrow>
        <evencolumn>
          <foreground>dark green</foreground>
          <background>white</background>
        </evencolumn>
      </evenrow>
      <font>Monaco 12</font>
    </display>
  </area>
  <area type="hexadecimal">
    <case>upper</case>
    <bpr>16</bpr>
    <display>
      <font>Monaco 12</font>
    </display>
  </area>
  <area type="separator">
    <display>
      <evenrow>
        <evencolumn>
          <foreground>dark green</foreground>
          <background>white</background>
        </evencolumn>
      </evenrow>
      <font>Monaco 12</font>
    </display>
  </area>
  <area type="ascii">
    <display>
      <font>Monaco 12</font>
    </display>
  </area>
</layout>

I'd like the ascii column ("area") to automatically open wider than default, which probably means the other areas will have to increase the same.

1st, I'm not sure what the customized layout file needs to be named.
When I open the View > Layouts, it's not showing the file I saved in .config/bless/<filename>.layout.

I understood you should be able to choose a custom layout from Bless' menu (if one exists)? Even if I made syntax error, it should still show the file name? AFAIK, the manual doesn't give an actual example of a custom layout file or naming convention. I assume it'd be like the default - "bless-default.layout."

I'm not sure if using the <bpr> option is the best way (or NO way) to make an area open larger than the default? There's another layout file in the package, named /usr/share/bless/bless-16-bytes-per-row.layout. It's not visible from the menu, either.

Thanks.

LenHoff 08-11-2018 11:08 PM

I figured out one issue - why no "user layouts" were visible from the Bless menu.
When it installed, it created the user config files path as ~/.config/bless.

Per the manual, any custom layout files should be in ~/.config/bless/layouts.
But the deb installer didn't create the "layouts" directory. It had a few other files already in ~/.config/bless, so that's where I put a test layout file.

Once I move it to ~/.config/bless/layouts, they were visible from the Bless menu.

I'm still not sure about the best way to make the ascii area a little wider & the entire starting UI bigger in x & y.
There are some default height & width values in a couple of files, but they aren't close to the actual opening UI size.

ondoho 08-12-2018 02:17 AM

in the example file you gave, i see no indication that width & height can be changed.
if you have reason to believe otherwise, please show us.

LenHoff 08-18-2018 07:37 PM

Solved: Bless hex editor create & name custom layout file
 
Quote:

Originally Posted by ondoho (Post 5890768)
in the example file you gave, i see no indication that width & height can be changed.
if you have reason to believe otherwise, please show us.

No, it doesn't show the ascii area size. That was the point of my question - how to change it. In case I wasn't clear, I was asking, not telling. :)

I surmised the ascii area is controlled by the hex area - it increases the # of ascii characters per line when you drag the window length and the hex area enlarges.
But it wasn't retaining the size, in spite of a pref: "Session.RememberWindowGeometry">True. Maybe a bug.

The DEFAULT.layout file seems to show 16 bytes per row for the hex area, but it *actually* opens at 18 chars, not 16 - not a biggie.
I can't find what controls the default UI opening width & height.

There's a Glade file that specifies sizes of various boxes. It controls other box sizes correctly, but not the overall main window size.

The question was, is enlarging the default size of the Hex area the best way to control the default opening UI size?
In the default layout file, only the bpr - bytes per row - are specified for the hex area.

**The dirty solution: They didn't make it easy. The Glade file controlled some default configuration, while the "bless-default.layout" file controlled others.
I think it was necessary to enter larger Main Window sizes under Glade, before making the width stored in a custom layout file.

Glade's orig. Bless main window size was 400 x 400. It observed that height, but something (I never found) was increasing the startup length - but not enough for my needs.
The ascii pane showed only 8 char - hard to find anything, that way.

So, increased Glade's "Main Window" length to 1100; width to 550.
I copied the contents of "bless-default.layout" to a user / custom layout file, in ~/.config/bless/layout/bless-24bpr.layout.
In the custom layout file, under the section, "<area type="hexadecimal">", I added the line, "<bpr>24</bpr>", which made the hex area 24 bytes / char wide, which automatically increased the width of aasci area to the same.

Again, for some reason, installing bless from a repo didn't create the sub dir, "layout," under ~/.config. Bless couldn't read custom layout files unless in that path.


All times are GMT -5. The time now is 01:48 PM.