Giter Site home page Giter Site logo

alexanderepstein / sandman Goto Github PK

View Code? Open in Web Editor NEW
509.0 17.0 29.0 71.58 MB

An Application Built With Late Night Developers In Mind

Home Page: https://alexanderepstein.github.io/Sandman/

License: MIT License

HTML 16.95% JavaScript 58.44% CSS 18.79% Shell 4.80% Batchfile 1.02%
sleep electron insomnia javascript productivity cross-platform

sandman's Introduction

Sandman Sandman Sandman

an application built with late night developers in mind

Version Github All Releases Build Status Libraries.io for GitHub

Codacy Badge framework platform license

Counting Sheep

Lightweight bash version can be found here

Sandman will remind you to take a rest and that you can always come back to the work tomorrow.

A sleep cycle is a 90-minute chunk of time where your body transitions through various phases of sleep — all the way down to deep REM sleep — then back again. Some health experts believe that these 90-minute sleep cycles are the key to restful sleep. They recommend trying to sleep exactly 7.5 hours — or even 9 hours, if you have the time.

Based on your wakeup time and the sleep algorithm Sandman calculates the best times for you to sleep. It will notify you throughout the night when the optimal times to shutdown your computer and start to head to sleep and provide a button to do just that.

This application works well with https://justgetflux.com/

Inspired by http://sleepyti.me

In Action

Usage

Install

Mac

Homebrew casks are the preferred method of installations (easiest to upgrade Sandman with brew cask update)

Homebrew install

brew tap caskroom/cask # add homebrew casks if you havent already
brew update
brew cask install sandman

Manual install

Download your respective platforms release from the downloads section.

Drag the Sandman.app from the Sandman dmg to the Applications folder. Double Clicking on the app should run it and it could be kept in the dock from here.

Linux

Open up a terminal and navigate to the folder containing the downloaded installer files and run

Debian

First make sure you have the dependency libappindicator1

sudo apt-get install libappindicator1

then depending on your system architecture either run

sudo dpkg -i Sandman_1.9.2_amd64.deb

Or:

sudo dpkg -i Sandman_1.9.2_x86.deb

RedHat

sudo rpm -i Sandman.rpm

This will actually install Sandman as a utility application which can be accessed from your respective distributions application launchpad.

Windows

Scoops install

If you use scoops https://github.com/lukesampson/scoop You can download and install sandman with

scoop buckets add extras
scoop install sandman

Manual install

Download your respective architectures release from the downloads section.

Open up another windows explorer and navigate to your program files folder (x86 or 64 bit is irrelevant). Now drag the entire Sandman Windows folder you extracted from the downloaded zip in the previous step over to the program files folder. Go into the folder that was just dragged over and find the Sandman.exe and run it. Now the application will show up in the dock where it can be pinned.

Downloads

To get the full sourced version run in terminal:

git clone https://github.com/alexanderepstein/Sandman

Otherwise to just get the application click the link before to head to the latest release page and download your respective platform.

Uninstall

Mac

Homebrew

brew cask uninstall sandman

Manual uninstall

Go to the applications folder and delete the Sandman application.

Linux

Open up a terminal and run:

Debian

sudo dpkg --remove Sandman

RedHat

sudo rpm -e Sandman.rpm

Windows

Scoops

scoop uninstall sandman

Manual uninstall

Open up the program files folder and delete the Sandman folder.

Reviews Of Sandman

Addictive Tips Review

Softpedia Windows Review

Softpedia Mac Review

Helping Out

It is assumed you already have node installed and therefore npm.

To download the full source code and install the Dependencies run the following lines:

git clone https://github.com/alexanderepstein/Sandman
cd Sandman
npm install
cd ..
npm start dev # this will run the application with all of the devtools open

If you get some error and the application wont run try running the following lines and see if that works.

Linux/Mac

cd Sandman
sudo npm install -g

Windows

Right click on the start menu icon at the bottom left and click on the option to open a command prompt in developer mode cd to the Sandman directory then run

npm install -g

CSS Compilation

The app styling was made with: Sass v3.3.14 Ruby v2.3.1p112.

To compile the stylesheet you'll only need to run the following command:

sass --watch scss:css --style compressed

To Compile Source To Application

Linux

Open a terminal to the Sandman directory

cd build
chmod a+x linux.sh
./linux.sh

This will build installers for Debian 32/64 bit and Redhat linux in the build/dist/installers folder

Mac

Open a terminal to the Sandman directory

cd build
chmod a+x mac.sh
./mac.sh

This will build a dmg in the build folder

Windows

Right click on the start menu icon at the bottom left and click on the option to open a command prompt in developer mode then run

npm install -g electron-packager

Then once electron packager is installed to package your electron application open up a terminal and cd into the Sandman folder then run

For 64 Bit Binary:

electron-packager . Sandman --platform win32 --arch x64 --out dist/

For 32 Bit Binary

electron-packager . Sandman --platform win32 --arch ia32 --out dist/

If you have a feature you would like to add or optimizations to the original code

  • Feel free to fork this repository and submit a pull request
  • Add an issue labeled as an enhancement and if I think its a good idea I will do my best to implement it myself
( •_•)
( •_•)>⌐■-■
(⌐■_■)

Donate

If this project helped you in any way and you feel like buying a broke college kid a cup of coffee

Donate Donate

License

MIT License

Copyright (c) 2017 Alex Epstein

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

sandman's People

Contributors

dependabot[bot] avatar lex111 avatar priscilamtzfraire 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  avatar  avatar  avatar  avatar  avatar

sandman's Issues

App Needs Restart For Preferences To Take Effect

Problem

  • Because the preferences page is a different html file when running scripts spawned from there the use of document.getElementByID will not effect elements on the index html because that's not what this command refers to somewhat like being out of scope

Two Solutions:

  • Suck It Up
    Just add text to the preferences html that warns the user that a relaunch of the application is required to actually apply. Then implement an automatic restart and a dialog to ask the user if they want to restart the application now. Refer to electron/electron#5837

  • Fix it
    Find a way to make this work in javascript possibly bind the html to a javascript variable and just change the variable.

Port To Python or Java

Issue Label: [Enhancement]

Description of bug or feature enhancement:
Port the entire function and design of the program of the program to python. The binary size is unnecessarily large compared to the amount of code I've written and this stems from the use of electron. At first I thought it would just be a fun way to learn javascript and this framework but since this is growing in popularity I see it as unfair to tax your systems memory as I add features and python will make this program as light as it should be.

OS and OS version:
https://py2app.readthedocs.io/en/latest/
http://www.py2exe.org/
https://py2deb.readthedocs.io/en/latest/

Version of Insomnia Application:
The future

Brightness Slider

Look into modifying the notification dependency so that a slider will also appear to control screen brightness. Possibly make it a preference to have the brightness lower x percent for each notification you ignored.

https://github.com/kevva/brightness

No System Tray Icon

Issue Label: [Bug]

Description of bug or feature enhancement:
Note: libappindicator1 is installed. I even tried reinstalling it.

There is no system tray icon. Minimizing the program just makes it disappear into the background. (As an aside, this generates three processes, two with absurdly long names.)

OS and OS version:
Ubuntu 17.04

Version of Insomnia Application:
1.4.1 (same behavior on 1.2.0)
I'm using the dpkg 64-bit version. I see no way to run the version cloned from git.

Update The Preferences Window

Issue Label: [Enhancment]

Description of bug or feature enhancement:
Update the U.I. and logic behind the preferences window so it is easy to add new preferences and it is easier for the user to change them.

**OS and OS version:All

**Version of Insomnia Application:1.2.0

Speed Up Packaging For All Platforms + Have Installers For Mac and Windows

Issue Label: [Enhancement]

Description of bug or feature enhancement:
It takes to long currently to build out a new release even after the code is done (about 2 hours) and it is only because i have to be running the target OS.
Solution lies here https://github.com/electron-userland/electron-builder and in my package.json

OS and OS version:
All Platforms & Architectures Possible

Version of Insomnia Application:
Who knows when this will happen

App should remember the sleep time set

When I close the App after setting the sleep time and consequently setting notifications, when I reopen the App, it should open with the time I had set already, but this doesn't happen currently.

It would be nice to see the already set time when the App is reopened.

Optimal Sleeping Times not displaying properly

Issue Label:

  • [x ] bug
  • feature
  • enhancement

Description of bug or feature enhancement:
Times are listed in the dreaded NaaN
screen shot 2017-08-04 at 1 49 15 pm

OS and OS version:

  • [x ] Mac
  • GNU Linux 32 Bit
  • GNU Linux 64 Bit
  • Redhat Linux
  • Windows 64 Bit
  • Windows 32 Bit

Version of Sandman Application: 1.9.2

Sleep Tracking

I think insomnia has the potential to be a decent sleep tracking application with quick modal questions to generate data and visualize this data onto plots. This data can then be used to help better regulate your sleep cycles by changing the algorithm that tells you when to go to bed.

Restart notification pops up every hour.

Issue Label:

  • bug
  • feature
  • enhancement

Description of bug or feature enhancement:
Restart notification pops up every hour.
Bug appears to be in this line: script.js#L474
After ~6 hours of uptime, os.uptime() returns 518970.71.... 518970.71 / 60 / 60 results in 144.15... which is always bigger then 12 hours.
Fix: uptime = uptime / 60 / 60 / 24;

OS and OS version:

  • Mac
  • GNU Linux 32 Bit
  • GNU Linux 64 Bit
  • Redhat Linux
  • Windows 64 Bit
  • Windows 32 Bit

Version of Sandman Application: 1.9.0

[Bug] Default settings for Wake-Up time not working since V1.2.0 [WINDOWS]

Issue Label: Bug

Description of bug or feature enhancement:
When updated to version 1.2.0 suddenly the default Wake-Up time doesn't get saved any more, i can go to the tray icon, open preferences from right click menu, set time to 5 am instead of the initial default 8:30, click the set button and close such window, if i go and open preferences again, the time is back to 8:30.

OS and OS version:
Win 10

Version of Insomnia Application:
1.2.0

Google Calendar Integration

Set up the sleep times to add google calendar events that will notify you on your phone even if you have closed your computer but remain busy with other shenanigans.

Uptime Notification

Every x hours or so grab the uptime of the computer if its over my default or a user preference it will notify you for a computer restart to improve the efficiency of the computer.

Close On X Bug [MAC]

Issue Label: [Bug]

Description of bug or feature enhancement:
Application will not close even if close on x preference is set.

OS and OS version:
Mac 10.12.4

Version of Insomnia Application:
1.3.0

No system menu options for Debian ?

Issue Label: [Bug]

Description of bug or feature enhancement: I don't see any system menu options on the top right for Insomnia like in the README gif in which I can choose preferences and stuff.

OS and OS version: Ubuntu 16.04

Version of Insomnia Application: Insomnia1.2.0 amd64

Application Provides Break Notification Out of Sync With Time

Issue Label: [Bug,Feauture,Enhancement]
Notification at the Wrong Time

Description of bug or feature enhancement:
I set my time to wake up at 6:30am the next day at 12:05 PM today and then closed the app, but the app has two notifications pop up every 2 minutes or so saying my computer needs a break with the option to dismiss or restart.

I installed the application last night and set a time in it and went to sleep, however when I woke up there were 20+notifications and I had to force close the application to clear it.

OS and OS version:
Windows 10

Version of Insomnia Application:
Insomnia Version 1.4.1
Node.js Version 7.4.0
Chromium Version 56.0.2924.87
Electron Version 1.6.6

Timing Issues

Sometimes the time doesn't pick the correct day for of that time.

Add hibernation/sleep to notification.

Issue Label:

  • feature

Description of bug or feature enhancement:
User should have the option to put their computer into hibernation/sleep, not just shutdown. Useful as it leaves applications where they were before the hibernation/sleep.

CSS/Bootstrap

At the moment I've been utilizing inline HTML styling this should be transferred over to a CSS file and implemented.

[Bug] Unordered optimal sleeping times

Issue Label: [Bug]

Description of bug or feature enhancement:
The optimal sleeping times are unordered, is hard to look when your next optimal sleep time is.

Version of Insomnia Application:
1.4.2

Demonstration:
To show it in order should show 19:45, 21:15, 22:45, 00:15, 01:45 and 02:45 (which might be wrong since intervals were switching between 15 and 45 except 2:45 one).
image

Persistent Storage Faulty

The persistent storage works until the application is packed into a deb and then the settings do not remain persistent when the application is installed.

Settings

Add persistent settings for the default wake up time. Possibly even a schedule of default times depending on day and whether shown times should be in military time or 12 hour time.

Bright blue background

Issue Label: Bug

Description of bug or feature enhancement:
Viewing blue light at night is harmful. Please change the background color of the app to something a bit less jarring.

OS and OS version:
Any

Version of Insomnia Application:
Any current

Auto Update

The application doesn't have to download and upgrade updates straight from the app, but it would be preferential for the application to let you know an update exists.

[Feat] Consider people chronotypes

Dr. Michael Breus gave a talk in Kwik Conference about Sleep and peoples chronotype, he talks about how each people chronotype affects the actual lenght of the sleep cycle.

According to his research each people cycle has a different lenght based on their Chronotype, some are longer, some shorter, the average is indeed 90 min, with 5 cycles giving an optimal total sleep time of 7.5 hours.

Giving himself as an example, Dr. Michael Breus calculated his optimal total sleep time in 7 hours, while other people have longer cycles and it goes up to 8 hours based on it's Chronotype.

The feature request has 2 parts:

  • Allow user to adjust their cycles based on Chronotypes.
  • Add a Chronotype test to allow the user to easy and acurately determine their Chronotype.
  • (Optional) As the user receives their Chronotype, make info about it available so they can understand better theirs, making planning around it's Chronotype possible.

UI/UX Problems and suggestions in Shutdown button in notification

Hey @alexanderepstein
I think the "Shutdown" button should be renamed as "Shutdown Computer". Just a suggestion.

And I think it would be better to confirm with the user about shutting down the computer instead of abruptly shutting it down. Why ? because the user might click the wrong button in a hurry or by mistake and this would lead to abrupt shutdown, and he/she might lose any unsaved changes in his files or it stop big file uploads or downloads, at least downloads can sometimes be resumed. It can lead to many other problems.

A confirmation to shutdown is always good. What do you think ?

[bug] notification

Issue Label: [Bug,Feature,Enhancement]
BUG

Description of bug or feature enhancement:
The notification : "Your computer need a break" shows up like 100 times instantly

OS and OS version:
OS X EL CAPITAN 10.11.6

Version of Insomnia Application:
1.2.0

sometimes it's like this :
screen shot 2017-05-04 at 20 59 14
but sometimes its even worse : my screen become full of notifications in less than 2 seconds, and I need to quit Insomia...

Option to choose times for notifications

I would be great if we can choose the times at which notifications should be displayed.
For example, if I set wake-up time to 7:00 a.m., the notifications start at 9:45 p.m, which seems too early (at least for me). So if I am able to set the notifications to start after, say, 11 pm, it would be better in my opinion.
What do you think?

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.