Comments (17)
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.
I think you can test this feature. 😉
from vtm.
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.
Thanks for the great idea. I'll add this option.
from vtm.
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.
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.
It remains to add synchronization of environment vars and the current directory.
from vtm.
The syntax needs to be changed, since too many parameters are expected for vtm functions.
from vtm.
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.
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.
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.
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.
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.
Adding splitters to the taskbar menu does not work yet.
from vtm.
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.
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.
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)
- Invalid user environment block
- Built-in terminal cannot start after running elevated terminal
- Desktop session crashes when started by limited user
- Session terminate after pasting HOT 12
- Reload config while running HOT 1
- Command history suddenly resets when pressing Alt (cmd.exe)
- Tiling window manager - select what to add HOT 5
- Project logo / icon HOT 10
- Per virtual terminal text search. HOT 5
- Text wrap switch doesn't work
- Command arguments are not parsed correctly on POSIX systems
- Line splitting is broken and corrupts script expression
- Different exit code styles between UNIX and NT HOT 1
- Unnecessary translation layer if the applet type is not specified
- Dead modifier keys print incorrect characters in cmd.exe readline mode
- Graphical front-end (GUI-TUI Bridge) HOT 26
- Broken `vtm -?` output in non-UTF-8 code page
- Maintaining the "don't wrap configuration" HOT 4
- Standalone terminal focus is lost by left clicking on window menu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vtm.