Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 4d1b803

Browse files
author
Lucas Malandrino
authored
Merge pull request #1 from GitSquared/master
Merge new commits.
2 parents e0a1b66 + 5afea2d commit 4d1b803

17 files changed

+2147
-118
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ Download | Linux & macOS | Windows | Dependencies | Build system | Source
99
-------- | ------------- | ------- | ------------ | ------------ | ------
1010
[![Release Badge](https://badgen.net/github/release/GitSquared/edex-ui)](https://github.com/GitSquared/edex-ui/releases) | [![Build Status](https://travis-ci.org/GitSquared/edex-ui.svg?branch=master)](https://travis-ci.org/GitSquared/edex-ui) | [![Build status](https://ci.appveyor.com/api/projects/status/leb069bro8gwocu7/branch/master?svg=true)](https://ci.appveyor.com/project/GitSquared/edex-ui/branch/master) | [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=GitSquared/edex-ui)](https://dependabot.com) | [![Known Vulnerabilities](https://snyk.io/test/github/GitSquared/edex-ui/badge.svg?targetFile=package.json)](https://snyk.io/test/github/GitSquared/edex-ui?targetFile=package.json) | [![Known Vulnerabilities](https://snyk.io/test/github/GitSquared/edex-ui/badge.svg?targetFile=src%2Fpackage.json)](https://snyk.io/test/github/GitSquared/edex-ui?targetFile=src%2Fpackage.json)
1111

12+
Download 1.0.1: [for Windows](https://github.com/GitSquared/edex-ui/releases/download/v1.1.0/eDEX-UI.Windows.Installer.exe) | [for macOS](https://github.com/GitSquared/edex-ui/releases/download/v1.1.0/eDEX-UI.MacOS.Image.dmg) | [for Linux x32](https://github.com/GitSquared/edex-ui/releases/download/v1.1.0/eDEX-UI.Linux.i386.AppImage) | [for Linux x64](https://github.com/GitSquared/edex-ui/releases/download/v1.1.0/eDEX-UI.Linux.x86_64.AppImage)
13+
1214
eDEX-UI is a fullscreen desktop application resembling a sci-fi computer interface, heavily inspired from [DEX-UI](https://github.com/seenaburns/dex-ui) and the [TRON Legacy movie effects](https://web.archive.org/web/20170511000410/http://jtnimoy.com/blogs/projects/14881671). It runs the shell of your choice in a real terminal, and displays live information about your system. It was made to be used on large touchscreens but will work nicely on a regular desktop computer or perhaps a tablet PC or one of those funky 360° laptops with touchscreens.
1315

1416
I had no ideas for a name so i took DEX-UI and added a "e" for Electron. Deal with it.
1517

18+
([Official ArchLinux AUR package](https://aur.archlinux.org/packages/edex-ui/) maintained by [@JesusCrie](https://github.com/JesusCrie))
19+
1620
## Screenshots
1721
![Default screenshot](https://github.com/GitSquared/edex-ui/raw/master/media/screenshot_default.png)
1822

@@ -38,17 +42,28 @@ eDEX-UI is meant to be used on touchscreens, even if it works well on regular di
3842
#### What's the difference between this and the original DEX-UI?
3943
Seenaburns' DEX-UI was created _"as an experiment or an art piece, not distributable software"_. The goal of this project is to push Seena's vision forward by making such an interface usable in real-life scenarios.
4044
#### Will using this make me insanely badass?
41-
[Yes.](https://78.media.tumblr.com/35d4ef4447e0112f776b629bffd99188/tumblr_mk4gf8zvyC1s567uwo1_500.gif)
45+
Yes.
46+
47+
<img width="220" src="https://78.media.tumblr.com/35d4ef4447e0112f776b629bffd99188/tumblr_mk4gf8zvyC1s567uwo1_500.gif" />
4248

4349

4450
## Featured in...
4551
- [Linux Uprising Blog](https://www.linuxuprising.com/2018/11/edex-ui-fully-functioning-sci-fi.html)
4652
- [My post on r/unixporn](https://www.reddit.com/r/unixporn/comments/9ysbx7/oc_a_little_project_that_ive_been_working_on/)
4753
- [Korben article (in french)](https://korben.info/une-interface-futuriste-pour-vos-ecrans-tactiles.html)
54+
- [Hacker News](https://news.ycombinator.com/item?id=18509828)
55+
- [This tweet that made me smile](https://twitter.com/mikemaccana/status/1065615451940667396)
56+
- [BoingBoing article](https://boingboing.net/2018/11/23/simulacrum-sf.html) - Apparently i'm a "French hacker" lol
57+
- [OReilly 4 short links](https://www.oreilly.com/ideas/four-short-links-23-november-2018)
58+
- [Hackaday](https://hackaday.com/2018/11/23/look-like-a-movie-hacker/)
59+
- [Developpez.com (another french link)](https://www.developpez.com/actu/234808/Une-application-de-bureau-ressemble-a-une-interface-d-ordinateur-de-science-fiction-inspiree-des-effets-du-film-TRON-Legacy/)
4860

4961

5062
## Useful commands for the nerds
5163
#### Starting from source:
64+
65+
**IMPORTANT NOTE:** the following instructions are meant **for DEVELOPERS ONLY**. If you're just a casual user please download the precompiled binaries available on the [Releases tab](https://github.com/GitSquared/edex-ui/releases).
66+
5267
on *nix systems (You'll need the Xcode command line tools on macOS):
5368
- clone the repository
5469
- `npm run install-linux`

package-lock.json

Lines changed: 40 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "edex-ui",
33
"productName": "eDEX-UI",
4-
"version": "1.0.1",
4+
"version": "1.1.1",
55
"description": "A science fiction desktop running everywhere. Awesome.",
66
"keywords": [
77
"desktop",
@@ -26,7 +26,8 @@
2626
"postbuild-linux": "rm -R prebuild-src",
2727
"postbuild-darwin": "rm -R prebuild-src",
2828
"postbuild-windows": "rmdir /S /Q prebuild-src",
29-
"snyk-protect": "snyk protect"
29+
"snyk-protect": "snyk protect",
30+
"test": "rsync -a --info=progress2 src prebuild-src --exclude node_modules && node prebuild-minify.js && rm -R prebuild-src"
3031
},
3132
"repository": {
3233
"type": "git",
@@ -107,8 +108,8 @@
107108
"electron-rebuild": "1.8.2",
108109
"node-abi": "2.5.0",
109110
"node-json-minify": "1.0.0",
110-
"snyk": "^1.108.2",
111-
"uglify-es": "3.3.10"
111+
"snyk": "^1.110.2",
112+
"uglify-es": "3.3.9"
112113
},
113114
"snyk": true
114115
}

src/_boot.js

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ process.on("uncaughtException", e => {
55
signale.fatal(e);
66
dialog.showErrorBox("eEDEX-UI failed to launch", e.message || "Cannot retrieve error message.");
77
if (tty) {
8-
tty.tty.kill();
8+
tty.close();
9+
}
10+
if (extraTtys) {
11+
Object.keys(extraTtys).forEach(key => {
12+
if (extraTtys[key] !== null) {
13+
extraTtys[key].close();
14+
}
15+
});
916
}
1017
});
1118

@@ -26,7 +33,7 @@ ipc.on("log", (e, type, content) => {
2633
signale[type](content);
2734
});
2835

29-
var win, tty;
36+
var win, tty, extraTtys;
3037
const settingsFile = path.join(electron.app.getPath("userData"), "settings.json");
3138
const themesDir = path.join(electron.app.getPath("userData"), "themes");
3239
const innerThemesDir = path.join(__dirname, "assets/themes");
@@ -80,7 +87,14 @@ fs.readdirSync(innerFontsDir).forEach((e) => {
8087

8188
function createWindow(settings) {
8289
signale.info("Creating window...");
83-
let {x, y, width, height} = electron.screen.getPrimaryDisplay().bounds;
90+
91+
let display;
92+
if (!isNaN(settings.monitor)) {
93+
display = electron.screen.getAllDisplays()[settings.monitor] || electron.screen.getPrimaryDisplay();
94+
} else {
95+
display = electron.screen.getPrimaryDisplay();
96+
}
97+
let {x, y, width, height} = display.bounds;
8498
width++; height++;
8599
win = new BrowserWindow({
86100
title: "eDEX-UI",
@@ -129,7 +143,8 @@ app.on('ready', () => {
129143
signale.pending(`Creating new terminal process on port ${settings.port || '3000'}`);
130144
tty = new Terminal({
131145
role: "server",
132-
shell: settings.shell,
146+
shell: settings.shell.split(" ")[0],
147+
params: settings.shell.split(" ").splice(1),
133148
cwd: settings.cwd,
134149
port: settings.port || 3000
135150
});
@@ -165,6 +180,61 @@ app.on('ready', () => {
165180
});
166181

167182
createWindow(settings);
183+
184+
// Support for more terminals, used for creating tabs (currently limited to 4 extra terms)
185+
extraTtys = {};
186+
let basePort = settings.port || 3000;
187+
basePort = Number(basePort) + 2;
188+
189+
for (let i = 0; i < 4; i++) {
190+
extraTtys[basePort+i] = null;
191+
}
192+
193+
ipc.on("ttyspawn", (e, arg) => {
194+
let port = null;
195+
Object.keys(extraTtys).forEach(key => {
196+
if (extraTtys[key] === null && port === null) {
197+
extraTtys[key] = {};
198+
port = key;
199+
}
200+
});
201+
202+
if (port === null) {
203+
signale.error("TTY spawn denied (Reason: exceeded max TTYs number)");
204+
e.sender.send("ttyspawn-reply", "ERROR: max number of ttys reached");
205+
} else {
206+
signale.pending(`Creating new TTY process on port ${port}`);
207+
let term = new Terminal({
208+
role: "server",
209+
shell: settings.shell.split(" ")[0],
210+
params: settings.shell.split(" ").splice(1),
211+
cwd: tty.tty._cwd || settings.cwd,
212+
port: port
213+
});
214+
signale.success(`New terminal back-end initialized at ${port}`);
215+
term.onclosed = (code, signal) => {
216+
term.ondisconnected = () => {};
217+
term.wss.close();
218+
signale.complete(`TTY exited at ${port}`, code, signal);
219+
extraTtys[term.port] = null;
220+
delete term;
221+
};
222+
term.onopened = () => {
223+
signale.success(`TTY ${port} connected to frontend`);
224+
};
225+
term.onresized = () => {};
226+
term.ondisconnected = () => {
227+
term.onclosed = () => {};
228+
term.close();
229+
term.wss.close();
230+
extraTtys[term.port] = null;
231+
delete term;
232+
};
233+
234+
extraTtys[port] = term;
235+
e.sender.send("ttyspawn-reply", "SUCCESS: "+port);
236+
}
237+
});
168238
});
169239

170240
app.on('web-contents-created', (e, contents) => {
@@ -185,6 +255,11 @@ app.on('window-all-closed', () => {
185255
});
186256

187257
app.on('before-quit', () => {
188-
tty.tty.kill();
258+
tty.close();
259+
Object.keys(extraTtys).forEach(key => {
260+
if (extraTtys[key] !== null) {
261+
extraTtys[key].close();
262+
}
263+
});
189264
signale.complete("Shutting down...");
190265
});

0 commit comments

Comments
 (0)