« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rwxr-xr-xindex.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/index.js b/index.js
index 2c352cd..efee187 100755
--- a/index.js
+++ b/index.js
@@ -64,6 +64,7 @@ async function main() {
     'player-options': {type: 'series'},
     'stress-test': {type: 'flag'},
     'socket-client': {type: 'value'},
+    'socket-name': {type: 'value'},
     'socket-server': {type: 'value'},
     'telnet-server': {type: 'flag'},
     'skip-config-file': {type: 'flag'},
@@ -200,6 +201,12 @@ async function main() {
     attachBackendToSocketClient(backend, socketClient, {
       getPlaylistSources: () => appElement.playlistSources
     })
+
+    let nickname = process.env.USER
+    if (options['socket-name']) {
+      nickname = options['socket-name']
+    }
+    socketClient.setNickname(nickname)
   }
 
   if (options['stress-test']) {