<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[One-line switch to enable &#x2F; disable modules]]></title><description><![CDATA[<p dir="auto">Currently, I comment out all modules that I want to keep configured but don’t want to use currently line by line.</p>
<p dir="auto">Is there an easier way to enable / disable modules in the config.js file?<br />
If not, I would suggest a MM2-wide working variable (analog to <em>header</em>) to enable / disable modules, e.g.</p>
<pre><code>module_active: true / false
</code></pre>
<p dir="auto">What do you think?</p>
]]></description><link>https://forum.magicmirror.builders/topic/4224/one-line-switch-to-enable-disable-modules</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 07:10:50 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/4224.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Jun 2017 09:37:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Tue, 29 Jan 2019 20:22:46 GMT]]></title><description><![CDATA[<p dir="auto">@sean said in <a href="/post/51000">One-line switch to enable / disable modules</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rudibarani" aria-label="Profile: rudibarani">@<bdi>rudibarani</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael5r" aria-label="Profile: michael5r">@<bdi>michael5r</bdi></a></p>
<p dir="auto">Here is my version. No need to list all modules.</p>
<pre><code class="language-js">const pre_disabled = {
  "UNLISTED": true, // default value for unlisted other modules.
  "alert":false,
  "clock": false,
  "MMM-Remote-Control":false,
 }

var DISABLED = new Proxy(pre_disabled, {
  get (receiver, name) {
    return name in receiver ? receiver[name] : receiver["UNLISTED"]
  }
})
</code></pre>
</blockquote>
<p dir="auto">Lovely :thumbs_up_light_skin_tone:</p>
]]></description><link>https://forum.magicmirror.builders/post/51096</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51096</guid><dc:creator><![CDATA[michael5r]]></dc:creator><pubDate>Tue, 29 Jan 2019 20:22:46 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Mon, 28 Jan 2019 13:54:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rudibarani" aria-label="Profile: rudibarani">@<bdi>rudibarani</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael5r" aria-label="Profile: michael5r">@<bdi>michael5r</bdi></a></p>
<p dir="auto">Here is my version. No need to list all modules.</p>
<pre><code class="language-js">const pre_disabled = {
  "UNLISTED": true, // default value for unlisted other modules.
  "alert":false,
  "clock": false,
  "MMM-Remote-Control":false,
 }

var DISABLED = new Proxy(pre_disabled, {
  get (receiver, name) {
    return name in receiver ? receiver[name] : receiver["UNLISTED"]
  }
})
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/51000</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51000</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 28 Jan 2019 13:54:20 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Mon, 24 Dec 2018 19:45:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sebi76" aria-label="Profile: sebi76">@<bdi>sebi76</bdi></a> Your syntax is wrong - you have this:</p>
<pre><code class="language-js">const DISABLED = {};
   
    DISABLED.clock = false;

},
</code></pre>
<p dir="auto">It should just be this:</p>
<pre><code class="language-js">const DISABLED = {};
DISABLED.clock = false;
</code></pre>
<p dir="auto">It’s that last <code>},</code> that’s breaking your code.</p>
]]></description><link>https://forum.magicmirror.builders/post/48519</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48519</guid><dc:creator><![CDATA[michael5r]]></dc:creator><pubDate>Mon, 24 Dec 2018 19:45:26 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Mon, 24 Dec 2018 17:51:51 GMT]]></title><description><![CDATA[<p dir="auto">It’s works not :grimacing_face:</p>
<pre><code>/* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information how you can configurate this file
 * See https://github.com/MichMich/MagicMirror#configuration
 *
 */

const DISABLED = {};
   
    DISABLED.clock = false;

},


var config = {
	address: "0.0.0.0", // Address to listen on, can be:
	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
	                      // - another specific IPv4/6 to listen on a specific interface
	                      // - "", "0.0.0.0", "::" to listen on any interface
	                      // Default, when address config is left out, is "localhost"
	port: 8080,
	ipWhitelist: [], // Set [] to allow all IP addresses
	                                                       // or add a specific IPv4 of 192.168.1.5 :
	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
	                                                       // or IPv4 range of 192.168.3.0 --&gt; 192.168.3.15 use CIDR format :
	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

	language: "de",
	timeFormat: 24,
	units: "metric",



	modules: [
			
  
		{
			module: "alert",
			classes:  'default everyone',
			},
		{
			module: "updatenotification",
			position: "top_bar",
			classes:  'default everyone', 
			},
		{
			module: "clock",
			position: "top_left",
			classes:  'default everyone',
			//disabled: DISABLED.clock			
		},
		
	    ]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/48516</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48516</guid><dc:creator><![CDATA[Sebi76]]></dc:creator><pubDate>Mon, 24 Dec 2018 17:51:51 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Mon, 24 Dec 2018 15:45:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sebi76" aria-label="Profile: sebi76">@<bdi>sebi76</bdi></a> No, it needs to be before that.</p>
<p dir="auto">Place it at the top of the file, before this line:</p>
<pre><code class="language-js">var config = {
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/48514</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48514</guid><dc:creator><![CDATA[michael5r]]></dc:creator><pubDate>Mon, 24 Dec 2018 15:45:41 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Mon, 24 Dec 2018 11:06:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael5r" aria-label="Profile: michael5r">@<bdi>michael5r</bdi></a> said in <a href="/post/48474">One-line switch to enable / disable modules</a>:</p>
<blockquote>
<p dir="auto">I’ve done this in my config.js file:</p>
</blockquote>
<p dir="auto">Where do you placesd this in you config. Like this?</p>
<pre><code>
	modules: [
			
const DISABLED = {};
   
    DISABLED.clock = false;

}
  
		{
			module: "alert",
			classes:  'default everyone',
			},
		{
			module: "updatenotification",
			position: "top_bar",
			classes:  'default everyone', 
			},
		{
			module: "clock",
			position: "top_left",
			classes:  'default everyone',
			disabled: DISABLED.clock			
		},
		
	    ]

};
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/48507</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48507</guid><dc:creator><![CDATA[Sebi76]]></dc:creator><pubDate>Mon, 24 Dec 2018 11:06:19 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Sun, 23 Dec 2018 18:19:46 GMT]]></title><description><![CDATA[<p dir="auto">I’ve done this in my config.js file:</p>
<pre><code class="language-js">const DISABLED = {};

if (RPI_DEV) { // I'm setting this value automatically based on the system
    DISABLED.weather = false;
    DISABLED.clock = false;
    DISABLED.calendar = false;
    DISABLED.tools = false;
    DISABLED.hue = true;
    DISABLED.newsfeed = true;
    DISABLED.nest_cameras = true;
    DISABLED.nest_status = true;
    DISABLED.telegram = true;
    DISABLED.hotword = true;
} else {
    DISABLED.weather = false;
    DISABLED.clock = false;
    DISABLED.calendar = false;
    DISABLED.tools = false;
    DISABLED.hue = false;
    DISABLED.newsfeed = false;
    DISABLED.nest_cameras = false;
    DISABLED.nest_status = false;
    DISABLED.telegram = false;
    DISABLED.hotword = false;
}
</code></pre>
<p dir="auto">And then for each module you can do something like this:</p>
<pre><code class="language-js">{
    module: 'clock',
    position: 'top_left',
    config: {
        displaySeconds: false,
        displayType: 'digital',
        dateFormat: 'dddd, MMM D, YYYY'
    },
    disabled: DISABLED.clock
},
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/48474</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48474</guid><dc:creator><![CDATA[michael5r]]></dc:creator><pubDate>Sun, 23 Dec 2018 18:19:46 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Sun, 23 Dec 2018 13:02:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sebi76" aria-label="Profile: sebi76">@<bdi>sebi76</bdi></a> booleans do not have quotes. Try without</p>
]]></description><link>https://forum.magicmirror.builders/post/48461</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48461</guid><dc:creator><![CDATA[strawberry 3.141]]></dc:creator><pubDate>Sun, 23 Dec 2018 13:02:03 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Sun, 23 Dec 2018 11:10:56 GMT]]></title><description><![CDATA[<p dir="auto">disabled: “true”, it doesnt work</p>
]]></description><link>https://forum.magicmirror.builders/post/48457</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/48457</guid><dc:creator><![CDATA[Sebi76]]></dc:creator><pubDate>Sun, 23 Dec 2018 11:10:56 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Sat, 24 Jun 2017 20:07:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/anhalter42" aria-label="Profile: Anhalter42">@<bdi>Anhalter42</bdi></a> That’s what I was looking for! Thanks a lot :)</p>
]]></description><link>https://forum.magicmirror.builders/post/24466</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24466</guid><dc:creator><![CDATA[rudibarani]]></dc:creator><pubDate>Sat, 24 Jun 2017 20:07:54 GMT</pubDate></item><item><title><![CDATA[Reply to One-line switch to enable &#x2F; disable modules on Sat, 24 Jun 2017 12:38:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rudibarani" aria-label="Profile: rudibarani">@<bdi>rudibarani</bdi></a> <code>disabled</code> does this, doesn’t it?</p>
<pre><code>disabled 	Set disabled to true to skip creating the module. This field is optional.
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/24461</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/24461</guid><dc:creator><![CDATA[Anhalter42]]></dc:creator><pubDate>Sat, 24 Jun 2017 12:38:27 GMT</pubDate></item></channel></rss>