Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it configurable #52

Closed
4 of 5 tasks
o-sdn-o opened this issue Dec 6, 2020 · 1 comment · Fixed by #232
Closed
4 of 5 tasks

Make it configurable #52

o-sdn-o opened this issue Dec 6, 2020 · 1 comment · Fixed by #232
Assignees

Comments

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Dec 6, 2020

Make the following aspects configurable

  • Color scheme (background, highlights, etc.)
  • Keyboard shortcuts
  • Taskbar: menu application list
  • Enable debug overlay using triple left+right click
  • Term: scrollback buffer size.
    To set the buffer size use VT-sequence CSI 24 : n : m p
    • Set scrollback buffer size, int32_t
    • n Buffer limit in lines, 0 is unlimited, default is 20.000
    • m Grow step for unlimited buffer, default is 0

Main Menu Configuration

The main menu can be configured in the ~/.config/vtm/settings.xml file in xml format.

The top-level element <config selected=_selected_id_> contains a list of

  • menu items <menuitem ... />
  • splitters <splitter ... />
  • default attribute definitions <defaults ... />.

The value of the selected= attribute specifies which menu item will be selected by default at startup.

The list of main menu items can be extended using the VTM_CONFIG=... environment variable. This variable should contain a list of items as inside the <config selected=_selected_id_> ... </config> block.

Arguments can be specified without quotes if there are no spaces in the string.

Character escapes

  • \e ASCII 0x1B ESC
  • \t ASCII 0x09 TAB
  • \a ASCII 0x07 BEL
  • \n ASCII 0x0A LF
  • \\ ASCII 0x5C Backslash
  • \" ASCII 0x22 Quotes
  • \' ASCII 0x27 Single quote
  • $0 Current module full path

Menu item attributes

Attribute Description Value type Mandatory Default value
id Menu item textual identifier string required
index Menu item zero-based index index
alias Use existing menu item specified by id as template string
hidden Menu item visibility boolean no
label Menu item label text string =id
notes Menu item tooltip text string empty
title Object window title string empty
footer Object window footer string empty
bgcolor Object window background color RGBA
fgcolor Object window foreground color RGBA
winsize Object window 2D size x;y
wincoor Object window 2D coor x;y
slimmenu Object window menu vertical size boolean no
hotkey Keyboard shortcut (Modifier1+[Mod...+][ModN...+]Key) string
cwd Current working directory string
type Object type string SHELL
cmd Object constructor arguments string empty

Object type

  • DirectVT, cmd: _command line_
  • SHELL, cmd: _command line_
  • ANSIVT, cmd: _command line_
  • Group, cmd: [ v[n:m:w] | h[n:m:w] ] ( id_1 | _nested_block_ , id_2 | _nested_block_ )]
  • Region, cmd attribute is not used, use title to set region name

Example of configuration via ~/.config/vtm/settings.xml

<config selected=Term>
    <splitter label="apps"/>
    <defaults index=-1 hidden=no slimmenu=false type=SHELL fgcolor=#00000000 bgcolor=#00000000 winsize=0x0 wincoor=0x0 />
    <menuitem id=Term index=1 label="Term" bgcolor=#0a0a0a fgcolor=15 slimmenu notes="$0 -r Term:\nTerminal emulator" type=DirectVT cmd="vtm -r term bash"/>
    <menuitem id=mc label="mc" title="mc" notes="Midnight Commander" type=SHELL cmd="mc"/>
    <menuitem id=Settings index=2 label="Settings \e[45mLink\e[m" title="Settings title" footer="\e[11:2psettings status" fgcolor=15 bgcolor=0xFF562401 notes="$0\n\tRun settings" type=DirectVT cmd="vtm -r settings"/>
    <menuitem id=View label=View notes="Set desktop region" type=Region title="\e[11:3pView: Region"/>"
    <splitter label="groups"/>
    <menuitem id=Tile1 label="Tile" notes="Tiling window manager" type=Group cmd="h(Term, v(mc, Term))"/>
    <menuitem id=Tile2 label="Second TWM"
                       notes="Tooltip for Tiling window manager"
                       type=Group
                       cmd="h(v(Term, Tile1), v(mc, Term))"/>
    // not ready yet
    //<autorun>
    //    <mc   wincoor=100,7 winsize=100,50 />
    //    <Term wincoor=40,12 winsize=100,50 />
    //    <Tile wincoor=15,1 winsize=100,50 />
    //</autorun>
</config>

Example of configuration via VTM_CONFIG= envar

VTM_CONFIG='<splitter label="envars" notes=" Menu items configured using envar VTM_CONFIG=... "/>
            <menuitem id=Term2 notes="Run terminal" type=DirectVT label="Virtual \e[41mTerminal\e[m Emulator" cmd="$0 -r term"/>
            <menuitem id=View2 label=View notes="Desktop region" type=Region title="Region 1"/>
            <menuitem id=htop2 label=htop hidden=yes notes="htop app" type=ANSIVT cmd="htop"/>
            <menuitem id=mc2 label=mc hidden=1 notes="mc app" type=SHELL cmd="mc"/>
            <menuitem id=Tile2 label=Tile notes="Tiling Window Manager" type=Group title="Tiling Window Manager" cmd="h1:2( v1:1(htop2, mc2), Term2)"/>'
@o-sdn-o o-sdn-o self-assigned this Dec 6, 2020
@arsoda
Copy link

arsoda commented Feb 9, 2022

  • keyboard shortcuts :)

o-sdn-o added a commit that referenced this issue Apr 17, 2022
@o-sdn-o o-sdn-o linked a pull request Aug 2, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants