mixu / nwm

Tiling window manager for X11 written in Node.js
http://mixu.net/nwm/
MIT License
789 stars 72 forks source link

nwm not starting under fedora #45

Closed TCMiranda closed 9 years ago

TCMiranda commented 9 years ago

Hello,

I am having trouble to start the application, if someone help me to figure out how to see what is wrong, it would be great

what i have done:

Switched to node v0.10.37

sudo node --version
v0.10.36

node --version
v0.10.37

sudo python --version
Python 2.7.8

Installed

libX11-devel-1.6.2-2.fc21.x86_64
libXinerama-1.1.3-4.fc21.x86_64

nwm

lrwxrwxrwx. 1 root root 29 Jun  7 17:43 /usr/bin/nwm -> /lib/node_modules/nwm/bin/nwm

The nwm options appears at gnome login manager screen

When I try to login with nwm, it flashes a black screen and redirects me back to the login manager

How can i find out what is wrong here?

Thanks!!

skovsgaard commented 9 years ago

Which Fedora version is this? I'll see if I can reproduce it.

TCMiranda commented 9 years ago

Fedora 21 Gnome 3.14.2

mixu commented 9 years ago

Usually this is caused by the paths being wrong in some way (for example, the user that is starting nwm has no node binary or the path to nwm is not readable etc.)

You can debug this by following the old install steps, which will configure nwm to also produce log files.

You probably already have a nwm.desktop so you can edit in it in step 2.

1: Create nwm.sh somewhere (and chmod +x it):

#!/bin/sh
/usr/local/bin/node /path/to/nwm 2> ~/nwm.err.log 1> ~/nwm.log

Note: run "which node" to find out the path to Node in the script above.

2: add the following as nwm.desktop to /usr/share/xsessions:

[Desktop Entry]
Encoding=UTF-8
Name=nwm
Comment=This session starts nwm
Exec=/PATH/TO/nwm.sh
Type=Application

-Select "nwm" from the Sessions menu when logging in. If you run into issues, have a look at ~/nwm.err.log. Mostly, it's a matter of getting all the paths (to Node, to the nwm files) right.

mixu commented 9 years ago

also, if you switched to a different node version you may need to uninstall and reinstall nwm - since it uses a native extension, and the native extensions are not compatible across node versions (e.g. npm uninstall -g nwm, npm install -g nwm)

TCMiranda commented 9 years ago

thanks @mixu, but i am still unable to start it.

Unfortunatly the logs wasn't created, so I imagine nwm wansn't even started, or called.

Can i manually start nwm via console, opening a new session (ex: alt + ctr + 2)? Using the command under the nwm.sh? Or i would need to start the x server first?

If i could, i would ensure use the right paths.

If i just type nwm in a new session i get:

Error finding or executing ~/.nwm-user, launching with default nwm-user-sample.js
Error was:
{ [Error: Cannot find module '/home/others/.nwm-user'] code: 'MODULE_NOT_FOUND' }

/usr/lib/node_modules/nwm/node_modules/which/which.js:100
return p.charAt(0) === "/" || p === ""
^
TypeError: Cannot call method 'charAt' of undefined
at absUnix (/usr/lib/node_modules/nwm/node_modules/which/which.js:100:12)
at which (/usr/lib/node_modules/nwm/node_modules/which/which.js:30:7)
at findTerm (/usr/lib/node_modules/nwm/nwm-user-sample.js:241:5)
at /usr/lib/node_modules/nwm/nwm-user-sample.js:243:9
at F (/usr/lib/node_modules/nwm/node_modules/which/which.js:40:25)
at E (/usr/lib/node_modules/nwm/node_modules/which/which.js:43:29)
at /usr/lib/node_modules/nwm/node_modules/which/which.js:54:16
at Object.oncomplete (fs.js:108:15)
ashnur commented 9 years ago

If the logs are not created then it might be because it doesn't have the rights to write to that directory.

You can start nwm manually, in fact what the "standard" approach is just to automate the same thing you would do manually.

Instead of typing just nwm I would suggest to type nwm 2> ~/nwm.err.log 1> ~/nwm.log

However from the output you shared it seems that you do not have the repo https://github.com/mixu/nwm-user in your home directory cloned. Is that right?

TCMiranda commented 9 years ago

Yes, I wanted to use the default nwm-user. Is that wrong?

TCMiranda commented 9 years ago

I downloaded the mixu nwm-user, but the error was the same:

/usr/lib/node_modules/nwm/node_modules/which/which.js:100
return p.charAt(0) === "/" || p === ""
^
TypeError: Cannot call method 'charAt' of undefined
at absUnix (/usr/lib/node_modules/nwm/node_modules/which/which.js:100:12)
at which (/usr/lib/node_modules/nwm/node_modules/which/which.js:30:7)
at findTerm (/usr/lib/node_modules/nwm/nwm-user-sample.js:241:5)
at /usr/lib/node_modules/nwm/nwm-user-sample.js:243:9
at F (/usr/lib/node_modules/nwm/node_modules/which/which.js:40:25)
at E (/usr/lib/node_modules/nwm/node_modules/which/which.js:43:29)
at /usr/lib/node_modules/nwm/node_modules/which/which.js:54:16
at Object.oncomplete (fs.js:108:15)

The only change is that the warning about the .nwm-user missing module is gone.

mixu commented 9 years ago

looks like the which module is failing for some reason, try removing the code:

  // START
  var terms = [
    'sakura',
    'rxvt',
    'urxvt',
    'xterm'
  ];

  function findTerm(onDone) {
    var name = terms.shift();
    which(name, function(err, filepath) {
      if (err || !filepath) {
        findTerm(onDone);
      } else {
        onDone(null, name);
      }
    });
  }

  findTerm(function(err, term) {
    bestAvailableTerm = term;
    nwm.start(function() {});
  });

and replacing it with:

bestAvailableTerm = '/bin/bash';
nwm.start(function() {});

you can directly edit the home/others/.nwm-user/index.js file, changes made there will be applied when you start nwm the next time

mixu commented 9 years ago

sorry, not /bin/bash but whatever which xterm resolves to in your terminal - it needs to be a X11 compatible GUI terminal application