ewnd9 / record-desktop

:movie_camera: Effortless GIFs and screenshots on Linux, built with Electron.
66 stars 7 forks source link

some path was missed #15

Closed nskazki closed 8 years ago

nskazki commented 8 years ago

following the instruction i do:

$ history | tail -3
17624  sudo add-apt-repository ppa:nilarimogard/webupd8 && sudo apt-get update
17625  sudo apt-get install slop imagemagick byzanz
17626  npm install record-desktop -g

then:

$ record-desktop
TypeError: path must be a string
    at TypeError (native)
    at fs.readdir (fs.js:851:11)
    at fs.readdir (ATOM_SHELL_ASAR.js:478:24)
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:29:7
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:12:10
    at ret (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:56:34)
    at getFiles (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/utils.js:60:10)
    at updateTrayMenu (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/main.js:118:32)
    at EventEmitter.<anonymous> (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/main.js:165:3)
    at emitOne (events.js:82:20)

but application was started. when a press on icon opens a context menu with a single blank line. when i press this blank line opens a blank windon and and debugging information appears in the console:

TypeError: path must be a string
    at TypeError (native)
    at fs.readdir (fs.js:851:11)
    at fs.readdir (ATOM_SHELL_ASAR.js:478:24)
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:29:7
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:12:10
    at ret (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:56:34)
    at getFiles (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/utils.js:60:10)
    at updateTrayMenu (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/main.js:118:32)
    at EventEmitter.<anonymous> (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/main.js:165:3)
    at emitOne (events.js:82:20)
info: click appIcon false
info: TypeError: path must be a string
    at TypeError (native)
    at fs.readdir (fs.js:851:11)
    at fs.readdir (ATOM_SHELL_ASAR.js:478:24)
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:29:7
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:12:10
    at ret (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:56:34)
    at Object.getFiles (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/utils.js:60:10)
    at callFunction (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/electron-prebuilt/dist/resources/atom.asar/browser/rpc-server.js:230:18)
    at EventEmitter.<anonymous> (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/electron-prebuilt/dist/resources/atom.asar/browser/rpc-server.js:319:12)
    at emitMany (events.js:108:13)
info: TypeError: path must be a string
    at TypeError (native)
    at fs.readdir (fs.js:851:11)
    at fs.readdir (ATOM_SHELL_ASAR.js:478:24)
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:29:7
    at /home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:12:10
    at ret (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/pify/index.js:56:34)
    at Object.getFiles (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/dist/utils.js:60:10)
    at callFunction (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/electron-prebuilt/dist/resources/atom.asar/browser/rpc-server.js:230:18)
    at EventEmitter.<anonymous> (/home/nskazki/.nvm/versions/node/v5.7.0/lib/node_modules/record-desktop/node_modules/electron-prebuilt/dist/resources/atom.asar/browser/rpc-server.js:319:12)
    at emitMany (events.js:108:13) 

my enviroment:

$ node -v
v5.7.0
$ which node
/home/nskazki/.nvm/versions/node/v5.7.0/bin/node
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.10
DISTRIB_CODENAME=wily
DISTRIB_DESCRIPTION="Ubuntu 15.10"
ewnd9 commented 8 years ago

Do you have the settings icon at the top right corner? image

The path problem is related to missing directory option in settings (it is a bug, should have been opened settings view instead of gallery), you could try to manually put settings for now at ~/.config/configstore/record-desktop.json

{
        "isFirstRun": true,
        "combo-RECORD_AREA": "super+a",
        "combo-RECORD_ACTIVE": "super+z",
        "combo-STOP": "super+d",
        "combo-SCREEN_AREA": "super+s",
        "combo-SCREEN_ACTIVE": "super+x",
        "folder": "/home/nskazki",
        "screenshot-effect": "shadow"
}   

You would need to change combinations as they are not available in unity (if you use unity, assumption from environment log)

ewnd9 commented 8 years ago

I've released v0.4.1 with fixes, you could update with $ npm install -g record-desktop@0.4.1

ewnd9 commented 8 years ago

Also deb package is available now https://github.com/ewnd9/record-desktop/releases/tag/v0.4.1

$ sudo dpkg -i record-desktop_0.4.1_amd64.deb
nskazki commented 8 years ago

fine, I checked it started, but it seems not work

nskazki commented 8 years ago
$ record-desktop 
info: alt+shift+r register success: true
info: alt+shift+s register success: true
info: press alt+shift+r
info: Start 
info: press alt+shift+s
info: Finish 
info: Generated 
info: undefined
info: undefined ''

I started recording, selected a small region and stopped recording after 10 seconds. New messages in the console does not appear within a few minutes, and I stopped the application. What information I can give you to help solve this problem?

ewnd9 commented 8 years ago

Did you check the content of the image folder?

ewnd9 commented 8 years ago

My assumption is that the issue is the opening (https://github.com/ewnd9/record-desktop/blob/master/src/unix-utils/wrappers/xdg-open.js) as there is info: Generated in your log.

I tried to reproduce

info: undefined
info: undefined ''

by throwing an error (stack was showed in a log) and replacing variable with a non-existing path (no errors).

ewnd9 commented 8 years ago

image

I've reproduced the weird undefined log with empty folder in kubuntu 14.04 in virtual machine with the fresh installed app from deb package.

$ cat ~/.config/configstore/record-desktop.json 
{
        "isFirstRun": true,
        "screenshot-effect": "shadow",
        "combo-RECORD_AREA": "alt+shift+r",
        "combo-STOP": "alt+shift+v"
}

Could you paste your config, please?

ewnd9 commented 8 years ago

@nskazki ping

nskazki commented 8 years ago

@ewnd9, I'm sorry, I forgot about this issue. So, I install record-desktop@0.4.12

$ cat ~/.config/configstore/record-desktop.json
{
    "isFirstRun": true,
    "screenshot-effect": "shadow",
    "combo-RECORD_AREA": "alt+shift+r",
    "combo-STOP": "alt+shift+s"
}
$ record-desktop 
info: alt+shift+r register success: true
info: alt+shift+s register success: true
# click on "open a folder"
info: undefined
info: undefined ''
# show popup - title: "record-desktop", message: "undefined"
# press alt+shift+r
info: Error killed=false, code=1, signal=null, cmd=/bin/sh -c slop, stderr=Warning: Failed to grab X keyboard.
         This happens when something has already grabbed your keybaord.
         slop should still run properly though.
Warning: Failed to grab the keyboard. This is non-fatal, keyboard presses might fall through to other applications.
User pressed key. Canceled selection.
# press alt+shift+s
info: press alt+shift+s
info: Already finished 
# show popup - title: "record-desktop", message: "undefined"

env:

$ screenfetch -n
 OS: Ubuntu 15.10 wily
 Kernel: x86_64 Linux 4.2.0-27-generic
 Shell: bash 4.3.42
 DE: Unity 7.3.3
 WM: Compiz
$ node -v
v5.10.1
nskazki commented 8 years ago

So, I changed settings:

cat /home/nskazki/.config/configstore/record-desktop.json
{
    "isFirstRun": true,
    "screenshot-effect": "shadow",
    "folder": "/home/nskazki/Изображения/record-desktop",
    "combo-RECORD_AREA": "alt+shift+r",
    "combo-RECORD_ACTIVE": "alt+shift+x",
    "combo-STOP": "alt+shift+s",
    "combo-SCREEN_AREA": "alt+shift+a",
    "combo-SCREEN_ACTIVE": "alt+shift+w"
}

And now the application works. Pop-up still displays "record-desktop: undefined", but the screenshots are created.

It turns out that I just do not set the path to the folder. Please forgive me for your time. And please add checks for this path.

nskazki commented 8 years ago

And please reduce the lifetime of the pop-up notifications, and reduce their number.

ewnd9 commented 8 years ago

Please forgive me for your time.

Don't be so hard on yourself, you helped me find at least 2 bugs, thank you. (the "open folder" button was broken, will be fixed in the next release)

please add checks for this path.

It was added in https://github.com/ewnd9/record-desktop/issues/16 but not yet released

please reduce the lifetime of the pop-up notifications, and reduce their number.

I use node-notifier https://github.com/ewnd9/record-desktop/blob/master/src/main.js#L34-L37 with default timeout, so it might be worth for you to modify the default notifications timeout in your system. Hopefully, it will eliminate the number problem too