GithubHelp home page GithubHelp logo

Comments (17)

o-sdn-o avatar o-sdn-o commented on June 30, 2024 1

I want to make the new syntax the same as in <menu\item ...> in settings.xml:

vtm.run(label="cmd" type=dtvt title="Command Prompt" footer="test footer" notes=" Windows Command Prompt " cmd="$0 -r term" hidden=no fgc=whitedk bgc=0x00000000 winsize=80,25 wincoor=10,5 winform=undefined)
echo "vtm.run(type=dtvt cmd='vtm -r')" | vtm
echo "vtm.run(type=dtvt cmd='$0 -r')" | vtm
echo "vtm.dtvt($0 -r)" | vtm
echo "vtm.dtvt($0 -r vim ~/.bashrc)" | vtm

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024 1

I think you can test this feature. 😉

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024 1

I think that at this stage the added functionality is enough. We will return to this issue later when we fully implement integration with external scripting engines.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

Thanks for the great idea. I'll add this option.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

I'll try to use Application Scripting Runtime from #393 without external interpreters for now.

vtm monitor (vtm -m) or server in interactive mode (vtm -s) will read their input line by line and execute it.

List of commands

vtm.run("class", "param"={}, "user"={}, coor={}, size={})
vtm.exit()
vtm.shutdown()
vtm.users.disconnect("user")
vtm.users.list()
vtm.apps.list()
vtm.taskbar.menu.item.list()
vtm.taskbar.menu.swap("a_id", "b_id")
vtm.taskbar.menu.add.after("prev id", "xml config")
vtm.taskbar.menu.add.before("next id", "xml config")
vtm.taskbar.menu.remove("id")
vtm.taskbar.menu.run("id", "user"={}, coor={}, size={})
vtm.taskbar.menu.selected.get("user"={})
vtm.taskbar.menu.selected.set("id", "user"={})
vtm.config.get()
...

Usage

Redirected input:

printf "vtm.run(term, \"vim ~/.bashrc\")" | vtm -m
printf "vtm.run(headless, mc)\nvtm.run(headless, top)" | vtm -m

Interactively:

prompt:~# vtm -m
  os: Terminal type: VT
  os: Color mode: VT truecolor
  os: Mouse mode: Win32 Console API
 vtm: v0.9.55
main: Waiting for server...
 tty: Reading thread started 1648
main: No server connected
main: Connected
      10736:  tty: Console title changed to [sdn@megasus:0]

vtm.run(term, "vim ~/.bashrc")
...

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

It seems to me that there is no need to use the vtm -m monitor cli option in the case of input redirection. This makes usage easier:

echo "vtm.run(dtvt, 'vtm -r')" | vtm
echo "vtm.exit()" | vtm

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

It remains to add synchronization of environment vars and the current directory.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

The syntax needs to be changed, since too many parameters are expected for vtm functions.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

I decided not to use $0 in this context:

echo "vtm.dtvt($0 -r)" | vtm

echo "vtm.run(type=dtvt cmd='vtm -r')" | vtm
echo "vtm.dtvt(vtm -r)" | vtm
echo "vtm.dtvt(vtm -r vim ~/.bashrc)" | vtm

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

I added a new option - the 'cfg=' tag - with it you can set the configuration in xml-format for dtvt-apps:

echo "vtm.run(type=dtvt cmd='vtm -p p' cfg='<config><menu item*><item id=Term type=dtvt fgc=0xFFffff00 bgc=0xFFff0000 cmd=\'vtm -r\'/></menu><client><background tile=\'\' bgc=whitedk fgc=0 /></client></config>')" | vtm

from vtm.

Fan-iX avatar Fan-iX commented on June 30, 2024

Can I set id in the vtm.run command to categorize app windows in the task bar? In v0.9.56 All window started from command line are arranged under a new category in the taskbar titled the cmd of the first window launched, and clicking this taskbar item will startup new window using that cmd. I think windows launched without id can be displayed separately in the taskbar.

By the way, vtm.dtvt(bash) (bash can be any other executable file under $PATH) will launch a blank window that could not be closed by the taskbar ×.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

Can I set id in the vtm.run command to categorize app windows in the task bar?

In the current implementation, the 'id=' tag is completely ignored, it is replaced by the entire command expression, i.e. 'id=vtm.run(...)'. I need to figure out how to integrate it into the existing menu configuration. A possible way is to take an existing menu item by id and launch a derived instance based on it.

By the way, vtm.dtvt(bash) (bash can be any other executable file under $PATH) will launch a blank window that could not be closed by the taskbar ×.

The executable file does not support DirectVT, and then something goes wrong there. I'll fix this bug and make it closeable. Thanks for testing.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

Can I set id in the vtm.run command to categorize app windows in the task bar?

I have implemented the following logic to use the 'id' tag.

If a menu item configuration with the specified 'id' already exists and it was created at desktop startup, then the launched window instance will inherit the existing configuration. Otherwise, it will be overwritten before starting a new window instance while preserving the existing windows in the group.

Now you can set id in the vtm.run command to categorize app windows in the task bar.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

Adding splitters to the taskbar menu does not work yet.

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

Run vtm desktop with custom menu from bash:

vtm -d; printf "vtm.del()\nvtm.set(splitter id=s2 label=Group1)\nvtm.set(id=mc cmd=mc)\nvtm.set(splitter id=s1 label=Group2)\nvtm.set(id=htop cmd=htop)\nvtm.selected(mc)" | vtm; vtm

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

Another syntax (need to implement --script <body> option) to run vtm desktop with custom menu from bash:

vtm --script "vtm.del()\nvtm.set(splitter id=s2 label=Group1)\nvtm.set(id=mc cmd=mc)\nvtm.set(splitter id=s1 label=Group2)\nvtm.set(id=htop cmd=htop)\nvtm.selected(mc)"

from vtm.

o-sdn-o avatar o-sdn-o commented on June 30, 2024

It is necessary to add the ability to invoke several expressions separated by punctuation (. , ; / spc tab lf etc). One expression per line is not convenient.

vtm.run(); vtm.run()

from vtm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.