{"id":3514,"date":"2017-04-16T18:43:38","date_gmt":"2017-04-16T16:43:38","guid":{"rendered":"https:\/\/glancr.de\/?p=3514"},"modified":"2021-04-19T13:57:39","modified_gmt":"2021-04-19T13:57:39","slug":"write-your-own-module-for-mirr-os","status":"publish","type":"post","link":"https:\/\/glancr.net\/mirr-os\/previous-versions\/write-your-own-module-for-mirr-os\/","title":{"rendered":"Write your own module for mirr.OS"},"content":{"rendered":"[vc_row type=”in_container” full_screen_row_position=”middle” column_margin=”default” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″ shape_divider_position=”bottom” bg_image_animation=”none”][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_link_target=”_self” column_shadow=”none” column_border_radius=”none” width=”1\/1″ tablet_width_inherit=”default” tablet_text_alignment=”default” phone_text_alignment=”default” overlay_strength=”0.3″ column_border_width=”none” column_border_style=”solid” bg_image_animation=”none”][vc_column_text]\n
This tutorial refers to the earlier version <v1.0. mirr.OS one uses Ruby & VUE.JS.<\/strong><\/p>\n mirr.OS is a modified version of the popular operating system Raspbian. Put simply, after booting you see nothing but a browser without scrollbar and header and a website. mirr.OS<\/a> gives you the possibility to configure this website via a third device with a browser – for example via a smartphone or a laptop. In this respect the visible interface of mirr.OS is a kind of “small content management system”.<\/p>\n Therefore not only “Linuxers” will have fun with mirr.OS, but especially web developers. Because you basically only need PHP, JS<\/strong> and CSS<\/strong> to write your module.<\/p>\n Since mirr.OS is free for home users, you can also look at the code of the modules<\/a>. The best way to do this is to visit glancr on gitlab and see how other modules are built. You can also find a dummy module there. This is the perfect starting point for you to start working on your own module.<\/p>\nModule auf gitlab<\/span><\/i><\/a>\n Users usually get to see two interfaces. First, the view on the Smart Mirror (frontend). And then the config site, where everything is set (backend). In this respect, you have to think about both levels for your module.<\/p>\n Modules allow you to customize mirr.OS to your personal preferences and habits. Currently they are transferred to your Smart Mirror via data upload as *.zip. Starting with the next major release this will work directly from mirr.OS.<\/p>\n Each module works independently of other modules. Conversely, this means that no module requires another module.<\/p>\n In this file you record general data about the module. For example, version, author, download location, etc. You can see what you need by looking at the code.<\/p>\n Everything that concerns the output on the Smart Mirror goes in here. For this you usually need PHP, JS and a little CSS if needed. (Please use the classes we already assigned for mirr.OS. You can find them here<\/a>. This is so important to us, as we want to avoid conflicts with other modules and create the best user experience possible).<\/p>\n Here everything comes in what concerns the configuration of your module. Works just like the frontend with PHP, JS and CSS.<\/p>\n Then there is the assets folder. This is where you put your icons and graphics for your module. On the other hand, this is also the place where you store your functions.<\/p>\nExample modules on gitlab<\/h3>\n
Frontend and Backend<\/h3>\n
\n
Module integration<\/h3>\n
Module structure<\/h3>\n
Info.json<\/h4>\n
Frontend<\/h4>\n
Backend<\/h4>\n
Assets<\/h4>\n
Locales<\/h4>\n