Skip to content

Commit eed311e

Browse files
authored
Merge pull request #43 from briling/on-startup
Run commands on startup Add `startcom:` CLI option Regenerate figures Fix negative argument for `frame:` (again) Add missing `mol/MOL_3525.ext.xyz` Show point group also for `vib:1`
2 parents b157a2c + 2bc1c5b commit eed311e

33 files changed

Lines changed: 450 additions & 164 deletions

README.md

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A simple X11 molecular viewer.
44

5-
![Animation of 128 molecules](figures/intro.gif)
5+
![Animation of 128 molecules](fig/intro.gif)
66

77
---
88

@@ -81,9 +81,11 @@ Show the reference:
8181
| `shell:%%lf[,%%lf] | sphere(s) radii in Å |
8282
| `center:%d` | origin is geometric center (`1`, default) / center of mass (`2`) / as is (`0`) |
8383
| `inertia:%d` | if rotate molecules wrt axis of inertia (`1`) or not (`0`, default) |
84-
| `gui:%d` | normal (default `1`) / headless (`0`) mode |
84+
| `gui:%d` | gui (default `1`) / headless (`0`) mode |
8585
| `com:%s` | command sequence for `gui:0` |
8686
| `exitcom:%s` | command sequence to run on exit (same as for `gui:0`) |
87+
| `startcom:%s` | command sequence to run on startup |
88+
8789

8890
</details>
8991

@@ -136,7 +138,7 @@ One can also use the mouse to rotate the molecule and zoom in/out.
136138
#### Headless mode
137139

138140
If run in the headless mode with `gui:0`, the symbols from the standard input are processed
139-
as if the corresponding keys were pressed in the normal mode.
141+
as if the corresponding keys were pressed in the gui mode.
140142
Right now, `p`, `x`, `z`, `u`, and `.` are available.
141143
Command-line option `com:%s` overrides the standard input.
142144
These examples are equivalent:
@@ -151,15 +153,51 @@ D*h
151153
D*h
152154
```
153155

154-
#### Normal mode
155-
In the normal mode, the symbols from the CLI option `exitcom:` are executed immediately before closing.
156+
#### GUI mode
157+
In the GUI mode, the symbols from the CLI option `exitcom:` are executed immediately before closing.
156158
For example,
157159
```
158160
./v mol/mol0001.xyz exitcom:z
159161
```
160162
automatically prints the last xyz coordinates when the user closes the window.
161163

164+
The symbols from the CLI option `startcom:` are executed before the main loop.
165+
For example,
166+
```
167+
./v mol/mol0001.xyz startcom:aaaaaaa
168+
```
169+
moves the molecule to the left, and
170+
```
171+
./v mol/mol0001.xyz startcom:.mq
172+
```
173+
opens the file, computes the point group, save a picture to `mol/mol0001.xyz_1.xpm` and closes the window.
174+
For other examples, see [fig/regenerate.bash](fig/regenerate.bash) for the commands used to generate the figures on this page.
175+
176+
> [!NOTE]
177+
> The size depends on my screen and window layout, you might need to adjust the number of move/zoom in commands or the window size.
178+
179+
> [!WARNING]
180+
> Currently this option is unstable. Please let me know if you encounter any problems.
181+
182+
<details><summary><strong>Click to see currently available commands</strong></summary>
183+
162184

185+
| CLI regime symbol | GUI keyboard command | | GUI (`exitcom:`/`startcom:`) | headless (`com`) |
186+
| ------------------ | --------------------- | ----------------- | ---------------------------- | ---------------- |
187+
| `w`/`a`/`s`/`d` | `w`/`a`/`s`/`d` | move | + | |
188+
| `+` / `-` | `home`/`end` | zoom | + | |
189+
| `>` | `ins` | animate | + | |
190+
| `3`/`4` | `3`/`4` | scale atom sizes | + | |
191+
| `n`/`t`/`l` | `n`/`t`/`l` | toggle atom view | + | |
192+
| `m`/`f` | `m`/`f` | saving frame(s) | + | |
193+
| `q` | `q` | quit | + | |
194+
| `1`/`2` | `1`/`2` | scale bonds | + | + |
195+
| `b`/`l` | `b`/`l` | toggle bond view | + | + |
196+
| `.` | `.` | point group | + | + |
197+
| `x`,`z`,`p`,`u` | `x`,`z`,`p`,`u` | printing | + | + |
198+
199+
200+
</details>
163201

164202

165203
### Boundary conditions
@@ -208,47 +246,54 @@ Spherical confinement can be specified from the command-line by the following:
208246
## Examples [](#contents)
209247
* `mol/C3H6~mCPBA_01x11.qm.out` — geometries + vibrations
210248
```
211-
./v mol/C3H6~mCPBA_01x11.qm.out font:-*-*-medium-*-*--15-*-*-*-*-*-*-1
249+
./v mol/C3H6~mCPBA_01x11.qm.out
212250
```
213-
![Transition state mode animation](figures/C3H6~mCPBA_01x11.qm.out.gif)
251+
![Transition state mode animation](fig/C3H6~mCPBA_01x11.qm.out_01.gif)
214252
```
215253
./v mol/C3H6~mCPBA_01x11.qm.out vib:0 z:1,23,24,0,0
216254
```
217-
![Transition state optimization](figures/C3H6~mCPBA_01x11.qm.out_03.gif)
255+
![Transition state optimization](fig/C3H6~mCPBA_01x11.qm.out_03.png)
218256
* `mol/S8.qm.out` — geometries
219257
```
220-
./v mol/S8.qm.out z:1,1,2,0,0 font:-*-*-medium-*-*--15-*-*-*-*-*-*-1
258+
./v mol/S8.qm.out z:1,1,2,0,0
221259
```
222-
![S8 equilibrium structure](figures/S8.qm.out_69.gif)
260+
![S8 equilibrium structure](fig/S8.qm.out_69.png)
223261
* `mol/C10H16.qm.out` — vibrations
224262
```
225-
./v mol/C10H16.qm.out font:-*-*-medium-*-*--15-*-*-*-*-*-*-1
263+
./v mol/C10H16.qm.out
226264
```
227-
![Adamantane mode animation](figures/C10H16.qm.out.gif)
265+
![Adamantane mode animation](fig/C10H16.qm.out_72.gif)
228266
* `mol/1372_D02.340_1.out` — PBC simulation
229267
```
230-
./v mol/1372_D02.340_1.out bonds:0 cell:b10.7 font:-*-*-medium-*-*--15-*-*-*-*-*-*-1
268+
./v mol/1372_D02.340_1.out bonds:0 cell:b10.7
231269
```
232-
![Atoms in cell with PBC](figures/1372_D02.340_1.out_1087.gif)
270+
![Atoms in cell with PBC](fig/1372_D02.340_1.out_1024.gif)
233271
* `mol/mol0001.xyz`, `mol/mol0002.xyz``.xyz` files with atomic numbers and atomic symbols
234272
```
235-
./v mol/mol0001.xyz mol/mol0002.xyz symtol:1e-2 font:-*-*-medium-*-*--15-*-*-*-*-*-*-1
273+
./v mol/mol0001.xyz mol/mol0002.xyz symtol:1e-2
236274
```
237-
![Dimethyl ether structure](figures/mol0002.xyz_3.gif)
275+
![Dimethyl ether structure](fig/mol0002.xyz_3.png)
238276

239277
* `mol/MOL_3525.xyz` — organic crystal with non-orthogonal cell
240278
```
241279
./v mol/MOL_3525.ext.xyz
242280
```
243281
```
244-
./v mol/MOL_3525.xyz cell:8.929542,0.0,0.0,4.197206,8.892922,0.0,0.480945,2.324788,10.016044 font:-*-*-medium-*-*--15-*-*-*-*-*-*-1
282+
./v mol/MOL_3525.xyz cell:8.929542,0.0,0.0,4.197206,8.892922,0.0,0.480945,2.324788,10.016044
245283
```
246-
![Organic crystal cell](figures/MOL_3525.xyz_1.gif)
284+
![Organic crystal cell](fig/MOL_3525.xyz_1.gif)
247285

248-
---
249-
* Currently two colorschemes are supported (thanks to [@iribirii](https://))
286+
* Currently two colorschemes are supported
287+
(thanks to [@iribirii](https://github.com/iribirii))
250288
```
251289
v mol/periodic.in bonds:0 colors:v # default
252290
v mol/periodic.in bonds:0 colors:cpk
253291
```
254-
![Periodic table of elements with animated change of colorschemes](figures/periodic.gif)
292+
![Periodic table of elements with animated change of colorschemes](fig/periodic.gif)
293+
294+
---
295+
296+
The figures are generated with
297+
```
298+
fig/regenerate.bash
299+
```

fig/1372_D02.340_1.out_1024.gif

618 KB
Loading

fig/C10H16.qm.out_72.gif

108 KB
Loading

fig/C3H6~mCPBA_01x11.qm.out_01.gif

124 KB
Loading

fig/C3H6~mCPBA_01x11.qm.out_03.png

6.98 KB
Loading

fig/MOL_3525.xyz_1.gif

357 KB
Loading

fig/S8.qm.out_69.png

5.38 KB
Loading
File renamed without changes.

fig/mol0002.xyz_3.png

3.97 KB
Loading

fig/periodic.gif

32.6 KB
Loading

0 commit comments

Comments
 (0)