Code Monkey home page Code Monkey logo

desckit's Introduction

Desckit

Desckit

Custom desktop wallpaper generator with NodeJS and PhantomJS

Changelog

Version 0.0.6

  • Updated code and dependencies for modern libs - the code-rot is real, folks
  • Added option to set the generated images as wallpapers - only windows support for now I'm afraid, I'm only working on a windows machine, so if you want other platforms support, feel free to write a few lines of code and send a pull request!
  • Changed the weather module from Yahoo! weather to forecast.io

Earlier versions

Preview / Example Output

Based on base-desck desck

Example output

Installation

For Windows, please place the phantomsjs.exe on your PATH.

Clone and run the application on your local computer

$ git clone git://github.com/weisjohn/desckit.git
$ cd desckit
$ npm install
$ node .

Once ready, navigate your browser to http://localhost:1280/descks/base-desck/display to preview the base-desck desck and it's output.

To generate a desktop wallpaper append render to the url (like so: http://localhost:1280/descks/base-desck/render which will create a new file (or overwrite existing one) in /desckit/public/cache/base-desck/ directory.

Windows Configuration

asd To display your wallpaper in Windows 7/8 use the built in wallpaper rotation tool.

  1. Right click anywhere on your descktop
  2. Select Personalize (the lower-most item)
  3. Select Desktop Background in the bottom area of the window
  4. Click on Browse... next to Picture location: dropdown
  5. Locate and select the /desckit/public/cache/[DESCK_NAME] directory where [DESCK_NAME] is the style you want to use
  6. Select the update interval (I use 1 minute), make sure Shuffle is not marked
  7. Click Save changes

If you configured the application correctly you will now see the generated wallpaper showing on your desktop.

You might run into some issues running phantomjs on windows properly (make sure you follow all the recommended installations steps as seen on node-gyp repo), in which case installing phantom with the following flags might be helpful: $ npm install phantom -msvs_version=2012

Mac OS X Configuration

To display your wallpaper in Mac OSX use the built in wallpaper rotation tool.

  1. Open System Preferences
  2. Select Desktop & Screen Save (in the top-left area)
  3. Click the + button to choose a folder
  4. Locate and select the /desckit/public/cache/[DESCK_NAME] directory where [DESCK_NAME] is the style you want to use
  5. Select the Change picture: interval make sure Random order is not selected

If you configured the application correctly you will now see the generated wallpaper showing on your desktop.

Custom Scripts

The application supports custom scripts to be created.

See /public/descks/base-desck/ to get started with creating your own descks. The best way to get started with Desckit is by hacking away at that desck.

A Desck (AKA Script Files)

To create a desck you will need to create a new directory in /desckit/public/descks with your name of choise, and put a desck.json in it (a good starting point would be to copy base-desck desck).

There are currently 2 mandatory script files:

  • script.ejs - This is the HTML template for the layout of the desktop wallpaper.
  • script.js - This is the Server-side(!!) script to be run when the script is requested. This runs in your NodeJS instance so you can configure it to do whatever you want that is supported by NodeJS.

Optionally, you can include more files in scripts:

  • script.styl- This is the Stylus CSS source file that will generate a script.css file when needed.

Change those files to create your own customized descktop backgrounds.

Command Line

You can run desckit from the command line as well. This will be the prefered option to run the project in the future.

$ npm install -g desckit

To render the base-desck script only one time (think cron)

$ desckit -S base-desck 

To re-render every two minutes, specify an interval of 120 seocnds:

$ desckit -S base-desck -I 120

To automatically set the generated file as wallpaper (currently supports only windows)

$ desckit -W

Examples

There is one provided example at the moment named base-desck that you can use to play around with the application.

Possibilities

Since this is basically a web-page being rendered into a desktop background, there are a lot of things that can be done with it; just to give you some direction:

  • Use HD Youtube or Vimeo videos as backgrounds
  • Display a different style based on the time of day
  • Display news headlines
  • Display HackerNews threads
  • Show top pics from /r/pics/
  • Use parallax effects

Since this is being rendered on a WebKit based browser, basically anything that you can think of creating with HTML5 can be rendered onto your desktop.

Developing

To see the internals of desckit as it operates, set an environment variable for DEBUG equal to desckit, such as:

$ DEBUG=desckit* node-dev app.js 
  desckit Express server listening on port 1280 +0ms

We do this to help the command-line tool version output clean.

General Information

At this point the application is in preview/alpha version designed to show the capabilities of this technique. Most of the configuration is hard-coded (like the screen-resolution), you are welcome to change it to fit your needs. Some of the modules used are outdated (like datejs), and in general this is a work in progress aimed at hackers rather than the end-user at this point.

The Future

The goals for this project are:

  1. Create a simple and easy to use way to generate custom wallpapers using a Wysiwyg style designer
  2. Create modular widgets that could be configured to the users needs and wants
  3. Create integration with sites like Github, CSSDeck, jsfiddle along with an internal way to store users styles/designs
  4. Create a gallery of designs with ranking so users who are not into creating their own custom design could select an existing design, add or remove certain modules, and use it without hacking any code
  5. Provide an easy API to allow use of the software on mobile phones and tablets This is the very first step, unveiling the concept idea, and showing the very rudimentary capabilities, the next step will be decided by you, the user.

Contact

Created by Eli Sklar

Email: [email protected]

Twitter: @EliSklar

Contributors

desckit's People

Contributors

elis avatar weisjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desckit's Issues

can't run upon install

Trying to install on my machine:

jweis at jweismbp01 in ~/mysrc/eli_desckit on master
$ npm install
npm http GET https://registry.npmjs.org/open/0.0.3
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/commander
npm http 200 https://registry.npmjs.org/open/0.0.3
npm http GET https://registry.npmjs.org/open/-/open-0.0.3.tgz
npm http 200 https://registry.npmjs.org/request
npm http 200 https://registry.npmjs.org/open/-/open-0.0.3.tgz
npm http GET https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/keypress
[email protected] node_modules/open

[email protected] node_modules/debug

[email protected] node_modules/request

[email protected] node_modules/commander
└── [email protected]
jweis at jweismbp01 in ~/mysrc/eli_desckit on master
$ node app.js 

module.js:340
    throw err;
          ^
Error: Cannot find module 'cookie-signature'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/jweis/mysrc/eli_desckit/node_modules/express/node_modules/connect/lib/utils.js:16:17)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)

Three different modules needed to be installed:

jweis at jweismbp01 in ~/mysrc/eli_desckit on master
$ node app.js 

module.js:340
    throw err;
          ^
Error: Cannot find module 'cookie-signature'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/jweis/mysrc/eli_desckit/node_modules/express/node_modules/connect/lib/utils.js:16:17)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
jweis at jweismbp01 in ~/mysrc/eli_desckit on master
$ ls
README.md          bin                lib                package.json       public             views
app.js             desckit.helpers.js node_modules       phantomjs.exe      routes             walls
jweis at jweismbp01 in ~/mysrc/eli_desckit on master
$ npm install --save cookie-signature
npm http GET https://registry.npmjs.org/cookie-signature
npm http 200 https://registry.npmjs.org/cookie-signature
[email protected] node_modules/cookie-signature
jweis at jweismbp01 in ~/mysrc/eli_desckit on master*
$ node app.js 

module.js:340
    throw err;
          ^
Error: Cannot find module 'buffer-crc32'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/jweis/mysrc/eli_desckit/node_modules/express/lib/utils.js:7:13)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
jweis at jweismbp01 in ~/mysrc/eli_desckit on master*
$ npm install buffer-crc32
npm http GET https://registry.npmjs.org/buffer-crc32
npm http 200 https://registry.npmjs.org/buffer-crc32
npm http GET https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz
npm http 200 https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz
[email protected] node_modules/buffer-crc32
jweis at jweismbp01 in ~/mysrc/eli_desckit on master*
$ node app.js 

module.js:340
    throw err;
          ^
Error: Cannot find module './mozdocument'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/jweis/mysrc/eli_desckit/node_modules/stylus/lib/nodes/index.js:46:23)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)

I eventually just had to delete everything in node_modules and reinstall.

I think you should delete everything inside of node_modules and never commit those again into the project. I think that's also the reason that Github isn't rendering your project as well.

remove .exe from repo

It made the download take a long time and because Mac / Linux can't run an .exe, you should remove the .exe from the repo and direct users to https://github.com/ariya/phantomjs to install from there

drwxr-xr-x  12 jweis  CORP\Domain Users      408 Feb  5 17:13 .
drwxr-xr-x  11 jweis  CORP\Domain Users      374 Feb  5 17:13 ..
drwxr-xr-x  13 jweis  CORP\Domain Users      442 Feb  5 17:13 .git
-rw-r--r--   1 jweis  CORP\Domain Users     4316 Feb  5 17:13 README.md
-rw-r--r--   1 jweis  CORP\Domain Users     1133 Feb  5 17:13 app.js
drwxr-xr-x  12 jweis  CORP\Domain Users      408 Feb  5 17:13 node_modules
-rw-r--r--   1 jweis  CORP\Domain Users      205 Feb  5 17:13 package.json
-rw-r--r--   1 jweis  CORP\Domain Users  6812160 Feb  5 17:13 phantomjs.exe
drwxr-xr-x  10 jweis  CORP\Domain Users      340 Feb  5 17:13 public
drwxr-xr-x   4 jweis  CORP\Domain Users      136 Feb  5 17:13 routes
drwxr-xr-x   4 jweis  CORP\Domain Users      136 Feb  5 17:13 views
drwxr-xr-x   4 jweis  CORP\Domain Users      136 Feb  5 17:13 walls

Installation Script

We need an installation script that will install the following dependancies:

and will install Desckit as a daemon in the system (ticket #5 is open for that).

support non-Windows PhantomJS

GET /assemble/wide/render/60 200 6ms - 220
exec error: Error: Command failed: /bin/sh: phantomjs.exe: command not found

nothing but thumbnails in /public/cache/ directory

Running ver 0.0.5 on a mac, when using localhost:1280 in the browser everything works, but when I follow the OSX instructions and go to desckit/public/cache directory all I have there is a thumbnails directory.

How is this a "Live" backgrounds.

I'm not sure I understand how to make a "Live" desktop out of this. It seems like I'm pointing my desktop background at a rendered PNG not a dynamic web page. Am I misunderstanding, or is maybe something missing from the Readme?

(node) sys is deprecated. Use util instead

Right after node .
I got that

(node) sys is deprecated. Use util instead.

I ran grep -r "require('sys')" .
and I got that

./node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js: module.exports = require('sys');
./node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/common.js: , sys = require('sys');
./node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Readme.md: require('sys').puts(bark);
./node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Readme.md: var sys = require('sys');
./node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Readme.md: var sys = require('sys');
./node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/dog.js: require('sys').puts(bark);
./lib/phantom/phantomControl.js:var sys = require('sys')

Any fix?

Unhandled exception: Cannot find module...

Node 0.10.0, OSX 10.7.5

$ desckit -S base-desck
Error: Cannot find module '/usr/local/lib/node_modules/desckit/routes/../public/scripts/base-desck/script'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at output (/usr/local/lib/node_modules/desckit/routes/assemble.js:40:22)
    at test (/usr/local/lib/node_modules/desckit/routes/assemble.js:24:17)
    at callbacks (/usr/local/lib/node_modules/desckit/node_modules/express/lib/router/index.js:161:37)
    at param (/usr/local/lib/node_modules/desckit/node_modules/express/lib/router/index.js:135:11)
    at param (/usr/local/lib/node_modules/desckit/node_modules/express/lib/router/index.js:132:11)
    at param (/usr/local/lib/node_modules/desckit/node_modules/express/lib/router/index.js:132:11)

server crash when trying to view a wallpaper

When navigating to the http://localhost:1280/descks/base-desck/display URL, desckit crashes

/Users/jweis/mysrc/eli_desckit/node_modules/weather/yahoo.js:71
        if (result.Found)
                  ^
TypeError: Cannot read property 'Found' of undefined
    at Request._callback (/Users/jweis/mysrc/eli_desckit/node_modules/weather/yahoo.js:71:13)
    at Request.self.callback (/Users/jweis/mysrc/eli_desckit/node_modules/weather/node_modules/request/main.js:119:22)
    at Request.<anonymous> (/Users/jweis/mysrc/eli_desckit/node_modules/weather/node_modules/request/main.js:525:16)
    at Request.EventEmitter.emit (events.js:95:17)
    at IncomingMessage.<anonymous> (/Users/jweis/mysrc/eli_desckit/node_modules/weather/node_modules/request/main.js:484:14)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:895:16
    at process._tickCallback (node.js:415:13)

Cannot GET /descks/base-desck/display

On Osx, after following the installation instructions and browsing to the specified url, got:
Cannot GET /descks/base-desck/display

also, no public/cache

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.