Coder Social home page Coder Social logo

geeklet-scripts's Issues

Geektool Calendar missing 31st day

I sure hope someone can help me out. I've been using Geektool for quite some time to display a calendar on my desktop, highlighting the current day in one color and Sundays in a different color, however, since I moved to have the days of the week start on Monday instead of Sunday my months with 31 days only display 30.

I cannot figure this out.

cal -h | awk '{ print " "$0;
getline;
print " Mo Tui We Th Fr Sa So ";
getline;
if (substr($1,2) == "1") print "\033[0;37m \033[0m ";
do {
prevline=$0;
if (getline == 0) exit;

    print " "substr(prevline,4,17)" \033[1;37m"substr($0,1,2)" \033[0m "; 

} while (1)
}' | sed -E '1,$'"s/ ($(date +%e))( |$)/ $(echo '\033[1;31m')\1$(echo '\033[0m')\2/"

Undefined method "decode" in calendar?

Hi, I wanted to set up the calendar.rb script as a geeklet but I get the following error:

calendar.rb:271:in '<main>': undefined method 'decode' for nil:NilClass (NoMethodError)

I would do a correction as a pull request but I unfortunately don't know ruby :/

Running Geektool 3.1.8 on Mavericks 10.9.5, ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]

calendar.rb

Do you plan implementing current day/date highlighting?

opts.on( '-d', '--colordate', 'Use color to mark the date (01, 02, 03) _NOT_IMPLEMENTED_') 
opts.on( '-d', '--colorday', 'Use color to mark the day (Mo, Tu, We) _NOT_IMPLEMENTED_') 

Undefined method decode in calender.rb

If you don't activate the html option you get the method error on 271 because the encode variable is defined in an if block near the top only if the html option is chosen. Unfortunately you still need it to interpret line seperator A.

Reassigning the encode variable outside the if block fixed the issue.

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.