File tree 13 files changed +646
-173
lines changed 13 files changed +646
-173
lines changed Original file line number Diff line number Diff line change
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
+
1
4
# About PulsarVenv
2
5
3
6
PulsarVenv is a simple virtual environment (shell) running on another mother OS.
Original file line number Diff line number Diff line change
1
+ unit colors {
2
+ reset := '[0m'
3
+ black := '[30m'
4
+ red := '[31m'
5
+ green := '[32m'
6
+ yellow := '[38;5;220m'
7
+ blue := '[34m'
8
+ purple := '[35m'
9
+ cyan := '[36m'
10
+ white := '[37m'
11
+ lime := '[92m'
12
+ }
Original file line number Diff line number Diff line change
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)
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments