Skip to content

Commit f7adea8

Browse files
committed
0.2.5
1 parent ebda4b5 commit f7adea8

File tree

13 files changed

+646
-173
lines changed

13 files changed

+646
-173
lines changed

PulsarVenv.exe

26.5 KB
Binary file not shown.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://license/)
2+
[![Windows Support](https://img.shields.io/badge/Windows-7+-green?logo=windows)](https://github.com/zeroqxq/PulsarVenv/releases)
3+
14
# About PulsarVenv
25

36
PulsarVenv is a simple virtual environment (shell) running on another mother OS.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
unit colors {
2+
reset := ''
3+
black := ''
4+
red := ''
5+
green := ''
6+
yellow := ''
7+
blue := ''
8+
purple := ''
9+
cyan := ''
10+
white := ''
11+
lime := ''
12+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import 'std.sys'
2+
import 'std.convert'
3+
import 'std.jvm'
4+
import 'std.threads'
5+
import 'sysprint.wt'
6+
7+
// вывод
8+
window := new Printer()
9+
os := system.get_info().getOperatingSystem()
10+
processor := system.get_hal().getProcessor()
11+
card := system.get_hal().getGraphicsCards().get(0)
12+
13+
// обновление информации о нагрузке процессора
14+
cpu_load := 0
15+
ticks := processor.getSystemCpuLoadTicks()
16+
threads.run(fun() {
17+
threads.sleep(1000)
18+
cpu_load = system.get_hal().getProcessor().getSystemCpuLoadBetweenTicks(ticks)
19+
ticks = system.get_hal().getProcessor().getSystemCpuLoadTicks()
20+
}, [])
21+
22+
window.refresh([
23+
new Title(
24+
'💻 System',
25+
[
26+
new Label(
27+
'Uptime',
28+
os.getSystemUptime()/60
29+
),
30+
new Label(
31+
'User',
32+
system.get_property('user.name')
33+
),
34+
new Label(
35+
'Tasks',
36+
os.getProcessCount()
37+
),
38+
new Label(
39+
'Arch',
40+
os.getBitness() + '-bit'
41+
)
42+
]
43+
),
44+
new Title(
45+
'🎛 Cpu',
46+
[
47+
new Label(
48+
'CpuPhysicalCores',
49+
processor.getPhysicalProcessorCount()
50+
),
51+
new Label(
52+
'CpuLoad',
53+
convert.to_int(cpu_load * 100.0) + ' %'
54+
),
55+
new Label(
56+
'CpuLogicalCores',
57+
processor.getLogicalProcessorCount()
58+
),
59+
new Label(
60+
'CpuTemp',
61+
system.get_hal().getSensors().getCpuTemperature() + '°C'
62+
)
63+
]
64+
),
65+
new Title(
66+
'⚙ Gpu',
67+
[
68+
new Label(
69+
'',
70+
card.getVersionInfo()
71+
),
72+
new Label(
73+
'VRam: ',
74+
card.getVRam() / 1024 / 1024 + ' MB'
75+
)
76+
]
77+
),
78+
new Title(
79+
'📥 Ram',
80+
[
81+
new Label(
82+
'Memory: ',
83+
system.get_hal().getMemory()
84+
)
85+
]
86+
)
87+
])
88+
threads.sleep(1000)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import 'syscolors.wt'
2+
import 'ext.tui'
3+
import 'std.io'
4+
5+
type Label(key, value) {
6+
fun print {
7+
tui.render_line('· ' + key + ': ' + value)
8+
}
9+
}
10+
11+
type Title(title, labels) {
12+
fun print {
13+
tui.render_line(colors.green + title + colors.reset)
14+
for i in 0 to labels.size() {
15+
labels.get(i).print()
16+
}
17+
}
18+
}
19+
20+
type Printer {
21+
last_title := null
22+
23+
fun refresh(titles) {
24+
tui.clear()
25+
for i in 0 to titles.size() {
26+
titles.get(i).print()
27+
}
28+
}
29+
}
9.23 MB
Binary file not shown.

0 commit comments

Comments
 (0)