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

Commit

Permalink
✨ Support username display on Windows (#470)
Browse files Browse the repository at this point in the history
* Use username library for name detection

Signed-off-by: Chromecube <chromecube@t-online.de>

* Use async username call instead of username.sync()

* Lint package.json
  • Loading branch information
niklas2810 authored and GitSquared committed Mar 24, 2019
1 parent 574fee0 commit 122c46c
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/_renderer.js
Expand Up @@ -344,8 +344,8 @@ async function initUI() {

let greeter = document.getElementById("main_shell_greeting");

window.si.users().then(userlist => {
greeter.innerHTML += `Welcome back, <em>${userlist[0].user}</em>`;
require("username")().then(user => {
greeter.innerHTML += `Welcome back, <em>${user}</em>`;
}).catch(() => {
greeter.innerHTML += "Welcome back";
});
Expand Down
78 changes: 78 additions & 0 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/package.json
Expand Up @@ -35,7 +35,8 @@
"systeminformation": "4.1.1",
"tail": "2.0.2",
"ws": "6.2.0",
"xterm": "3.12.0"
"xterm": "3.12.0",
"username": "4.1.0"
},
"optionalDependencies": {
"osx-temperature-sensor": "1.0.3"
Expand Down

0 comments on commit 122c46c

Please sign in to comment.