Skip to content
A MagicMirror² module that displays "Good Fucking Design Advice"
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
MMM-GFDA.js
README.md
gfda.json
gfdascreenshot.PNG

README.md

Module: GoodFuckingDesignAdvice

The 'gfda' module is a module for the MagicMirror and is a shameless derivative of the 'compliments' module. This module displays a random bit of thought-provoking, and possibly not safe for work, advice.

Screenshots

  • Screenshot GFDA Screenshot

Installation

cd ~/MagicMirror/modules
git clone https://github.com/jonspraggins/MMM-GFDA.git

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: "MMM-GFDA",
		position: "lower_third",	// This can be any of the regions.
						// Best results in one of the middle regions like: lower_third
		config: {
			// The config property is optional.
			// If no config is set, the default advice is shown.
			// See 'Configuration options' for more information.
		}
	}
]

Configuration options

The following properties can be configured:

Option Description
updateInterval How often does the gfda have to change? (Milliseconds)

Possible values: 1000 - 86400000
Default value: 30000 (30 seconds)
fadeSpeed Speed of the update animation. (Milliseconds)

Possible values:0 - 5000
Default value: 4000 (4 seconds)
gfdas The list of gfdas.

Possible values: An object with four arrays: morning, afternoon, evening and anytime. See gfda configuration below.
Default value: See gfda configuration below.
remoteFile External file from which to load the gfdas

Possible values: Path or URL (starting with http:// or https://) to a JSON file containing gfdas, configured as per the value of the gfdas configuration (see below). An object with four arrays: morning, afternoon, evening and anytime. - gfdas.json
Default value: null (Do not load from file)
classes Override the CSS classes of the div showing the gfdas

Default value: thin xlarge bright
morningStartTime Time in hours (in 24 format), after which the mode of "morning" will begin
Possible values: 0 - 24

Default value: 3
morningEndTime Time in hours (in 24 format), after which the mode of "morning" will end
Possible values: 0 - 24

Default value: 12
afternoonStartTime Time in hours (in 24 format), after which the mode "afternoon" will begin
Possible values: 0 - 24

Default value: 12
afternoonEndTime Time in hours (in 24 format), after which the mode "afternoon" will end
Possible values: 0 - 24

Default value: 17

All the rest of the time that does not fall into the morningStartTime-morningEndTime and afternoonStartTime-afternoonEndTime ranges is considered "evening".

GFDA configuration

The advice property contains an object with four arrays: morning, afternoon, evening and anytime. Based on the time of the day, the gfdas will be picked out of one of these arrays. The arrays contain one or multiple gfdas.

If use the currentweather is possible use a actual weather for set advice. The availables properties are:

  • day_sunny
  • day_cloudy
  • cloudy
  • cloudy_windy
  • showers
  • rain
  • thunderstorm
  • snow
  • fog
  • night_clear
  • night_cloudy
  • night_showers
  • night_rain
  • night_thunderstorm
  • night_snow
  • night_alt_cloudy_windy

Example use with currentweather module

config: {
	gfdas: {
		day_sunny: [
			"It's fucking sunny today"
		],
		snow: [
			"It's fucking snowing!"
		],
		rain: [
			"Don't forget your fucking umbrella"
		]
	}
}

Multi-line gfdas:

Use \n to split gfda text into multiple lines, e.g. First line.\nSecond line. will be shown as:

First line.
Second line.

External File

You may specify an external file that contains the three gfda arrays. This is particularly useful if you have additional advice and do not wish to crowd your config.js file with a large array of advice. Adding the remoteFile variable will override an array you specify in the configuration file.

This file must be straight JSON. Note that the array names need quotes around them ("morning", "afternoon", "evening", "snow", "rain", etc.).

Example gfdas.json file:

{
    "anytime" : [
        "Carpe-fucking-diem"
    ],
    "morning" : [
        "Good fucking morning!",
        "Drink some fucking coffee"
    ],
    "evening" : [
        "Fucking sleep on it"
    ]
}
You can’t perform that action at this time.