├── .gitignore ├── .travis.yml ├── LICENSE ├── readme.md ├── ricerous ├── __init__.py ├── backend │ ├── JsonInfoReader.py │ ├── JsonStateHandler.py │ ├── Outputer.py │ ├── State.py │ ├── Updater.py │ ├── __init__.py │ ├── location_manager.py │ ├── readme.md │ └── ricer_class_diagram.jpg ├── json │ ├── conf.json │ ├── info.json │ ├── info_to_json.py │ ├── pad_info │ ├── readme.md │ └── version ├── plugins │ ├── __init__.py │ ├── bbcode.py │ ├── html.py │ ├── latex.py │ ├── markdown.py │ └── readme.md ├── rice.kv ├── run_test.py └── unit_test.py ├── scripts └── ricerous └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.7" 4 | - "3.4" 5 | # command to run tests, e.g. python setup.py test 6 | script: "./ricerous/unit_test.py" 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Ricerous - A Ricer Helper 2 | 3 | A Nixers community project 4 | 5 | ![unit test](https://travis-ci.org/nixers-projects/ricerous.svg) 6 | 7 | 8 | ## The Idea 9 | 10 | A kind of portable wiki diary program about ricing. It regroups altogether what 11 | can be riced with useful information and link about it. It also let the user 12 | notes/comments in each sections to keep track of what has been done. The notes 13 | can then be exported/imported in multiple formats. We hope it will: 14 | 15 | * Make it easy to redo another person's setup. 16 | * Remove the mystification around the word "ricing". 17 | * Easily share one's setup on forums/boards. 18 | 19 | ## Goals 20 | 21 | * Make it easy to redo another person's setup. 22 | * Remove the mystification around the word "ricing". 23 | * Easily share one's setup on forums/boards. 24 | 25 | ## User Base 26 | 27 | * Beginner ricers that don't know where to start. 28 | * Advanced users that get lost when they want to share info about their setup. 29 | 30 | 31 | ## Installation 32 | 33 | The program depends on Kivy. 34 | To install kivy 1.8.0 with APT 35 | ``` 36 | sudo add-apt-repository ppa:kivy-team/kivy 37 | sudo apt-get update 38 | sudo apt-get install python-kivy 39 | ``` 40 | 41 | ``` 42 | git clone https://github.com/nixers-projects/ricerous 43 | 44 | cd ricerous 45 | 46 | sudo python2 setup.py install 47 | 48 | ricerous 49 | ``` 50 | 51 | 52 | ## TODO list 53 | 54 | * Test/Debug the Program (Doesn't need programming knowledge) 55 | 56 | 57 | ## Screenshots 58 | 59 | ![one](http://pub.iotek.org/p/E3kXJUk.png) 60 | ![two](http://pub.iotek.org/p/e53QyX2.png) 61 | ![three](http://pub.iotek.org/p/Fpu6NcN.png) 62 | ![four](http://pub.iotek.org/p/xP28lIO.png) 63 | 64 | 65 | ## More Information 66 | 67 | * [Development thread on the Nixers.net forums](http://nixers.net/showthread.php?tid=1518) 68 | * [Tutorial & Sharing thread on the Nixers.net forums](http://nixers.net/showthread.php?tid=1579) 69 | 70 | ## Contributors 71 | 72 | * Dami 73 | * Z3bra 74 | * Foggalong 75 | * pizzaroll1 (kaashif) 76 | * Jolia 77 | * Kirby 78 | * DotDev 79 | * Dcli 80 | * Venam 81 | * Vompatti 82 | * Earsplit 83 | 84 | 85 | The rest of the community for giving ideas, opinions, and helping choose a name. 86 | -------------------------------------------------------------------------------- /ricerous/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nixers-projects/ricerous/6289bd0253a98552f6819f7a72da699b5d3feb3d/ricerous/__init__.py -------------------------------------------------------------------------------- /ricerous/backend/JsonInfoReader.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import sys 4 | import json 5 | try: 6 | from ricerous.backend import Updater 7 | except Exception: 8 | from backend import Updater 9 | 10 | """ 11 | The role of the JsonInfoReader class is to handle the information located 12 | in the infoFile (json) so that they can be easily accessible for the rest 13 | of the program. 14 | """ 15 | 16 | 17 | class JsonInfoReader: 18 | def __init__(self, infoFile): 19 | """ 20 | Constructor takes an infoFile (String) as parameter 21 | """ 22 | self._infoFile = infoFile 23 | info_json = open(infoFile, 'r') 24 | self._allInfo = json.load(info_json) 25 | info_json.close() 26 | """ 27 | WARNING: an Updater object is created in the constructor 28 | Might want to read that host from a file 29 | """ 30 | server = "https://raw.githubusercontent.com/nixers-projects/ricerous/master/ricerous/" 31 | self._updater = Updater.Updater(server, self._infoFile) 32 | 33 | def refresh(self): 34 | """ 35 | refresh :: Int 36 | reload the infoFile, at failure returns -1 37 | """ 38 | try: 39 | self._allInfo = json.load(open(self._infoFile, 'r')) 40 | return 0 41 | except Exception: 42 | print("cannot re-read file") 43 | return -1 44 | 45 | def update(self): 46 | """ 47 | update :: Int 48 | use the Updater object to try updating the info file if it has new info 49 | if it doesn't have new info it returns 2 50 | if it successfully updated the info it returns 0 51 | if it failed it returns -1 52 | """ 53 | if self._updater.hasNewInfo(): 54 | try: 55 | self._updater.fetchNewInfo() 56 | self.refresh() 57 | return 0 58 | except Exception: 59 | return -1 60 | return 2 61 | 62 | def listCategories(self): 63 | """ 64 | listCategories :: [String] 65 | return a list of categories that have information (Headers) 66 | """ 67 | categories = [] 68 | for info in self._allInfo: 69 | categories.append(info) 70 | return categories 71 | 72 | def listInsideCategories(self, category): 73 | """ 74 | listInsideCategories :: String -> [String] 75 | takes a category and returns the sub-categories found for that category 76 | """ 77 | if category not in self._allInfo: 78 | return "" 79 | return self._allInfo[category] 80 | 81 | def getInfo(self, name): 82 | """ 83 | getInfo :: String -> String 84 | return the info for a particular category 85 | """ 86 | category = self.getCategory(name) 87 | if category not in self._allInfo: 88 | return "" 89 | if name not in self._allInfo[category]: 90 | return "" 91 | return self._allInfo[category][name] 92 | 93 | def getCategory(self, name): 94 | """ 95 | getCategory :: String -> String 96 | takes a sub-category and returns the mother category 97 | """ 98 | thecategory = "" 99 | for category in self._allInfo: 100 | for info in self._allInfo[category]: 101 | if name == info: 102 | thecategory = category 103 | break 104 | if thecategory != "": 105 | break 106 | return thecategory 107 | 108 | 109 | """ 110 | if __name__ == "__main__" : 111 | test = JsonInfoReader("json/info.json") 112 | test.listCategories() 113 | print "\n\n" 114 | test.listInsideCategories("raw") 115 | print "\n\n" 116 | print test.getInfo("Shell") 117 | print "\n\n" 118 | print test.getCategory("IM") 119 | print "\n\n" 120 | """ 121 | -------------------------------------------------------------------------------- /ricerous/backend/JsonStateHandler.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | """ 4 | The Role of this file is to save the state to json or read the state from json 5 | the state is a State object (State.py) 6 | """ 7 | 8 | 9 | def save(saveLocation, state): 10 | """ 11 | save :: String -> State -> Void 12 | save the state in json format to a location specified 13 | """ 14 | # Save the comments and selected to a json file 15 | saveOutput = "{\n" 16 | saveOutput += '"comments":\n' 17 | saveOutput += json.JSONEncoder().encode(state.comments)+"\n" 18 | saveOutput += ',"selections":\n' 19 | saveOutput += json.JSONEncoder().encode(state.selected)+"\n" 20 | saveOutput += "}\n" 21 | open(saveLocation, 'w').write(saveOutput) 22 | 23 | 24 | def load(loadLocation, state): 25 | """ 26 | load :: String -> State (by reference) -> Void 27 | load the state from a json file into a State object 28 | WARNING: this function will change the state 29 | """ 30 | jfile = open(loadLocation, 'r') 31 | loaded = json.load(jfile) 32 | jfile.close() 33 | state.comments = loaded['comments'] 34 | state.selected = loaded['selections'] 35 | -------------------------------------------------------------------------------- /ricerous/backend/Outputer.py: -------------------------------------------------------------------------------- 1 | import importlib 2 | import pkgutil 3 | import inspect 4 | 5 | """ 6 | The purpose of the Outputer class it to provide a dynamic way of outputing 7 | the State object (State.py) 8 | It loads all the available plugins from a plugin directory 9 | """ 10 | 11 | 12 | PLUGIN_PATHS = ["plugins"] 13 | 14 | 15 | class Outputer: 16 | def __init__(self, plugin_paths): 17 | """ 18 | Constructor takes the plugin path 19 | """ 20 | self.plugin_paths = [plugin_paths] 21 | 22 | def lister(self): 23 | """ 24 | lister :: [String] 25 | returns the list of available plugins 26 | """ 27 | path = self.plugin_paths 28 | availables = [] 29 | for loader, modname, is_pkg in pkgutil.walk_packages(path): 30 | module = loader.find_module(modname).load_module(modname) 31 | good = 0 32 | for name, value in inspect.getmembers(module): 33 | if name.startswith('__'): 34 | continue 35 | if name == "getName": 36 | good += 1 37 | if name == "output": 38 | good += 1 39 | # Has the 2 functions getName and output, so it's a good plugin 40 | if good == 2: 41 | availables.append(modname) 42 | return availables 43 | 44 | def getAvailable(self): 45 | """ 46 | getAvailable :: [String] 47 | a wrapper to return the list of available plugins 48 | """ 49 | # availables = self.lister() 50 | 51 | # for available in availables: 52 | # m = importlib.import_module('plugins.'+available) 53 | # m.getName() 54 | return self.lister() 55 | 56 | def output(self, module, state, info, location): 57 | """ 58 | output :: String -> State -> JsonInfoReader -> String -> Void 59 | takes the name of the output module (can be listed using getAvailable()) 60 | , a State object, a JsonInfoReader object, the location where you want 61 | to save the output. 62 | it will call the `output` method on the dynamically loaded module from the 63 | plugin directory 64 | """ 65 | toImp = self.plugin_paths[0].replace("/", ".") 66 | if not toImp.endswith("."): 67 | toImp = toImp + "." 68 | if "eggs" in toImp.lower() : 69 | toImp = "ricerous.plugins." 70 | m = importlib.import_module(toImp + module) 71 | toSave = m.output(state, info) 72 | open(location, 'w').write(toSave) 73 | 74 | """ 75 | if __name__ == "__main__": 76 | output = Outputer() 77 | output.getAvailable() 78 | """ 79 | -------------------------------------------------------------------------------- /ricerous/backend/State.py: -------------------------------------------------------------------------------- 1 | try: 2 | from ricerous.backend import JsonStateHandler 3 | except Exception: 4 | from backend import JsonStateHandler 5 | 6 | """ 7 | The purpose of the State class is to keep track of the temporary changes 8 | happening 9 | """ 10 | 11 | 12 | class State: 13 | def __init__(self): 14 | """ 15 | Constructor doesn't take any arguments 16 | """ 17 | self.selected = [] 18 | self.comments = {} 19 | 20 | def load(self, loadLocation): 21 | """ 22 | load :: String -> Void 23 | a wrapper to load state from a json file 24 | """ 25 | self.selected = [] 26 | self.comments = {} 27 | JsonStateHandler.load(loadLocation, self) 28 | 29 | def save(self, savelocation): 30 | """ 31 | save :: String -> Void 32 | a wrapper to save state to a json file 33 | """ 34 | JsonStateHandler.save(savelocation, self) 35 | 36 | def addComment(self, section, comment): 37 | """ 38 | addComment :: String -> String -> Void 39 | takes the name of a section and a comment 40 | it set the comment of this section as the one specified (overwrite) 41 | """ 42 | self.comments[section] = comment 43 | 44 | def unComment(self, section): 45 | """ 46 | unComment :: String -> Void 47 | takes the name of a section and remove the comment associated with it 48 | """ 49 | if section in self.comments: 50 | del(self.comments[section]) 51 | 52 | def addSelect(self, section): 53 | """ 54 | addSelect :: String -> Void 55 | takes the name of a section and set it as riced 56 | """ 57 | if section not in self.selected: 58 | self.selected.append(section) 59 | 60 | def unSelect(self, section): 61 | """ 62 | unSelect :: String -> Void 63 | takes the name of a section and unset it from the riced things 64 | """ 65 | if section in self.selected: 66 | self.selected.remove(section) 67 | -------------------------------------------------------------------------------- /ricerous/backend/Updater.py: -------------------------------------------------------------------------------- 1 | import sys 2 | if sys.version < '3': 3 | from urllib import URLopener 4 | else: 5 | from urllib import request 6 | 7 | try: 8 | from ricerous.backend import location_manager 9 | except Exception: 10 | from backend import location_manager 11 | 12 | print location_manager.VERSION 13 | 14 | """ 15 | The role of this class is to handle the Update of the configurations 16 | """ 17 | 18 | 19 | class Updater: 20 | def __init__(self, server, infoFile): 21 | """ 22 | takes a server location and an info file as parameters in the constructor 23 | it will use this server to fetch the new information 24 | there should be a json/version and json/info.json dir on this server 25 | """ 26 | self._infoFile = infoFile 27 | self._serverJSON = server + self._infoFile 28 | self._serverDate = server + "json/version" 29 | if sys.version < '3': 30 | self.br = URLopener() 31 | else: 32 | self.br = request 33 | 34 | def hasNewInfo(self): 35 | """ 36 | hasNewInfo :: Boolean 37 | compare the local version tag with the one found on the server 38 | and returns true if the server version is newer 39 | """ 40 | jsonDate = open(location_manager.VERSION , 'r').read().strip() 41 | if sys.version < '3': 42 | servDate = self.br.open(self._serverDate).read().strip() 43 | else: 44 | servDate = self.br.urlopen(self._serverDate).read().strip() 45 | return (int(jsonDate) < int(servDate)) 46 | 47 | def generateTimeStamp(self): 48 | """ 49 | generateTimeStamp :: String 50 | returns a string that is used to timestamp old config backup files 51 | """ 52 | return open(location_manager.VERSION, 'r').read().strip() 53 | 54 | def fetchNewInfo(self): 55 | """ 56 | fetchNewInfo :: Void 57 | it will download the info file from the server 58 | use the timestamp to back it up 59 | and overwrite it 60 | """ 61 | # Fetching server's info.json 62 | if sys.version < '3': 63 | response = self.br.open(self._serverJSON).read() 64 | else: 65 | response = self.br.urlopen(self._serverJSON).read().decode("utf-8") 66 | oldInfo = open(self._infoFile, 'r').read() 67 | open(self._infoFile + "." + self.generateTimeStamp(), 'w').write(oldInfo) 68 | open(self._infoFile, 'w').write(response) 69 | # Fetching server's version 70 | if sys.version < '3': 71 | servDate = int(self.br.open(self._serverDate).read().strip()) 72 | else: 73 | servDate = int(self.br.urlopen(self._serverDate).read().strip()) 74 | open(location_manager.VERSION, 'w').write(str(servDate)) 75 | -------------------------------------------------------------------------------- /ricerous/backend/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nixers-projects/ricerous/6289bd0253a98552f6819f7a72da699b5d3feb3d/ricerous/backend/__init__.py -------------------------------------------------------------------------------- /ricerous/backend/location_manager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import os 4 | import shutil 5 | from pkg_resources import resource_filename 6 | 7 | """ 8 | The purpose of this file is to manage the location of the info.json 9 | """ 10 | 11 | try: 12 | DEFAULT_CONFIG_LOCATION = resource_filename("ricerous", "json/info.json") 13 | DEFAULT_VERSION_LOCATION = resource_filename("ricerous", "json/version") 14 | PER_USER_LOCATION = os.environ["HOME"]+"/.config/ricerous" 15 | VERSION = PER_USER_LOCATION + "/version" 16 | INFO = PER_USER_LOCATION + "/info.json" 17 | if not os.path.exists(PER_USER_LOCATION): 18 | os.mkdir(PER_USER_LOCATION) 19 | shutil.copyfile(DEFAULT_CONFIG_LOCATION, INFO) 20 | shutil.copyfile(DEFAULT_VERSION_LOCATION ,VERSION) 21 | except Exception: 22 | DEFAULT_VERSION_LOCATION = "ricerous/json/version" 23 | DEFAULT_CONFIG_LOCATION = "ricerous/json/info.json" 24 | VERSION = "backend/json/version" 25 | INFO = "backend/json/info.json" 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ricerous/backend/readme.md: -------------------------------------------------------------------------------- 1 | # Backend 2 | 3 | These files make up the backend for Ricerous, carrying out tasks such as updating and JSON reading. To understand this a little better, here is a basic class diagram 4 | 5 | ![ricer_class_diagram.jpg](ricer_class_diagram.jpg) 6 | -------------------------------------------------------------------------------- /ricerous/backend/ricer_class_diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nixers-projects/ricerous/6289bd0253a98552f6819f7a72da699b5d3feb3d/ricerous/backend/ricer_class_diagram.jpg -------------------------------------------------------------------------------- /ricerous/json/conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": 3 | {"TTY": "perl-term-extendedcolor-tty with the following colors http://somelink", "Shell": "Zsh \nconfigs http://github.com/venam/dots...", "Terminal emulator": "urxvt\nconfigs http://somelink...", "File managers": "thunar\ncatfish for search\nshortcut to open terminal in place\ndefault ranger", "GUI": "Custom version of FlatStudio Dark http://slfajdskljf.com\nIcons AnyColorYouLike\nCursor DMZ Black", "Wallpaper": "Tiles http://link to tiles", "Text editor": "vim\nconfigs: http://somestuff\nplugins: supertab, nerdtree, vim-bling, vim-surround", "Login managers": "Custom PAM module made from pam_captcha\nhttp://www.semicomplete.com/projects/pam_captcha/", "Information system": "Custom python script", "IM": "irssi\ntheme: ...\nplugins: ...", "Window manager": "2bwm, configs ...", "Web browser": "icecat with custom css\nhttp://...\naddons: vimperator and blah blah blah"} 4 | ,"selections": 5 | ["Login managers", "Shell", "TTY", "GUI", "Information system", "Wallpaper", "Window manager", "Terminal emulator", "File managers", "Text editor", "IM", "Web browser"] 6 | } 7 | -------------------------------------------------------------------------------- /ricerous/json/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "Others": { 3 | "Application launcher": "An application launcher is a program used as a kind of menu to start other programs.\nit can be a selection menu or a terminal like menu (input).\n\nSome comes built-in inside a DE taskbar (gnome-panel) some are third parties.\n\nRessources:\nhttps://wiki.archlinux.org/index.php/Category:Application_launchers\nhttps://wiki.archlinux.org/index.php/Xdg-open\n\n", 4 | "Information Displays": "Archey\nConky\nScreenfetch\nScreenfo\n\n", 5 | "Monitoring Programs": "htop\n\n", 6 | "Notification system": "Desktop notifications are pops-up that signals an event update.\nThey are used to keep you updated about multiple things. \n\nFor example:\n * Change of sound volume\n * Change of brightness\n * Change of network connection\n\nRessources:\nhttps://wiki.archlinux.org/index.php/Desktop_Notifications\nhttp://blog.z3bra.org/2014/04/pop-it-up.html\n\n", 7 | "Others": "\n", 8 | "Screen locker": "A screen locker blocks input to your machine until the right password has been entered.\n\nA lot of extravagant way can be used to achieve so:\n * Blurring the screen and adding a padlock to the middle\n * Changing the image to something else,\n * Do a futurist menu to enter your machine\n * have a nice input dialog\n * etc...\n\nRessources:\nhttps://wiki.archlinux.org/index.php/List_of_applications#Screen_lockers\n\n", 9 | "Show-off Colors": "pipes.sh \nThis repository contains all the most popular color scripts\nhttps://github.com/gstk/Color-Scripts\n\n" 10 | }, 11 | "common applications": { 12 | "Chat client": "Chat clients, instant messagers.It's extremely hard to explain how to rice them due to their variety.\n\nThe mostly riced are the irc clients: irssi and weechat.\n\nA list of things you can change in them:\n * Nickname alignement\n * Colors\n * Informations\n * Plugins\n\n", 13 | "File Managers": "The role of a file manager is to make it easy to browse your file system and manipulate files.\nThis role defines how a file manager acts.\nThere are 2 different kinds of file managers non-graphicals and graphicals.\n\nExamples of non-graphical file managers:\n * core-utils\n * ranger\n * vifm\n * commander\n * mc (midnight commander)\n\nExample of graphical file managers:\n * thunar\n * nautilus\n * dolphin\n * caja\n * gnome-commander\n\nSome file managers follow the GTK theme (icons and colors), if graphical, some doesn't. \nThe colors of the non-graphical ones can usually be riced.\n\nIt's important to configure how the file manager displays and list files.\nFor graphical file managers there are multiple ways of listing, some with preview, some with more information, etc..\n\nAnother feature some file managers adds is the ability to interact with files.\nTo execute scripts and macros by clicking them, to add a context menu when clicking on certain dir or files. Those are normally fully customizable.\n\nA file manager might also be able to access files over the network.\n\nA bunch files managers included in DE have the ability to manage the \"Desktop\", as in the icon displayed over the root window aka \"background\".\n\n", 14 | "Music/Media player": "Like all items in this section, there's a wide variety of choices for a media player.\nThere are GUI ones, Curses ones, and CLI ones.\nMost of them offer some sort of customization. The easiest ones to rice are the curses.\n\nThings that can be riced:\n * Colors\n * UI elements\n * Equalizer\n * Visualizer\n\nRessources:\nhttps://wiki.archlinux.org/index.php/Cmus\nhttps://wiki.archlinux.org/index.php/Ncmpcpp\n\n", 15 | "Terminal emulator": "Terminal emulators are graphical applications sitting between the user and the shell(isn't it a media to interact with the terminal) [ref needed]. Terminal emulators consist of a text input to interact with the shell, and with such there are only a few thing you can tweak: background, text colors, font and behavior.\n\nAs terminal emulators are graphical windows, you can change their aspect, starting by the background. \nSome terminals (like gnome-terminal, or konsole) include drop-down menus to customise most settings. \nIn case of more minimalist terminals, you'll have to use another way to modify them. Common means are either by using the X resource database (xrdb), or by modifying the application at compilation time (by modifying a file commonly named \"config.h\" or \"config\"). \nIn case of an \"xrdb compliant\" terminal, you will have to run `xrdb -merge /path/to/file` and relaunching the app to see your changes applied. For \"config.h style terminals\", a recompilation and restart of the app is needed. While drop-down menu like terminals are modified instantly.\n\nHere is a list of commonly used terminals\n\nModified via mouse menus:\n * gnome-terminal\n * konsole\n * terminator\n * yakuake\n * xfce-terminal\n\nModified via xrdb\n * rxvt-unicode\n * xterm\n * aterm\n * mterm\n\nModified via config.h/config\n * evilvte\n * st\n * termite\n\nBackground\nTerminal backgrounds consists of the rectangular area filling the whole window, behind the text. Most of the time, the default color is white (or purple, in ONE. SPECIAL. CASE). Depending on your terminal of choice, you'll be able to modify the color, transparency or image background. That's pretty much it. \n\nSpeaking of transparency, one can make a distinction between true and fake transparency. \nTrue transparency make your terminal look like a teinted glass. Move it around and you'll be able to see what's behind it. It require a composite manager [ref needed] to run in order to work. \nFake transparency is more of a hack: when the window will stop moving, it will \"copy\" your wallpaper on the background, and apply the ply the teint your specified to it. So if you place it in front of a window, you not see the window behind your terminal, but the portion of your wallpaper behind it.\n\nFont\nYou can use two types of font: \"xft\" or \"bitmap\".\nX font types (or XFT, for short) are well polished fonts. They are antialiased, scalable and well designed. They look great, but can be slow to draw sometimes. That's why bitmap fonts are still used. Those fonts are pixel based and not scalable. That's why they can be drawn faster.\nNow it's just a matter of choice. Most terminals support both rendering, so do as you please !\n\nText Colors\nA terminal usually make use of 8 differents colors: black, red, green, yellow, blue, magenta, cyan and white. Those 8 colors can come in two flavor: normal and bold. by default, bold colors are just a more flashy version of the color. It leaves use with a total of 16 different colors that we can tweak. This palette of 16 colors is commonly referred to as a \"terminal colorscheme\". \nTo tweak this, the user (you) can assign each color an hexadecimal code that will be displayed when the color is used. Before assigning this code, you must be aware of how many different colors your terminal can display, and thus, which code you can use.\n\nMost of the time, terminals supports 256 differents colors, that you can find here: http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html.\n\nBehavior\nThe behavior of the terminal is an important thing, because it's a central application on a linux desktop. Its behavior is defined by the features your terminal gives you. Some are modable via perl scripts, drop-down, have tabs, can resize font on the fly, can open URIs in your web browser, etc...\nJust try them all !\n\n", 16 | "Text editor": "The choices for text editors aren't scarce.\nThe prefered choices for ricers are: EMACS, Sublime, and Vim.\n\nThe customization goes as follow:\n * Syntax highlighting\n * Theme (for UI elements arrangement)\n * Plugins\n\nRessources:\nhttp://www.linux.org/threads/text-editors.4104/g\n\n", 17 | "Web browser": "There's a lot of variety of browsers.\n\nThings you can do with your browser are the following:\n * Change its appearance:\n * chrome.css (Firefox), and other files for other browsers\n * Move the widgets (tab bar,info,etc..)\n * Create a custom start page, a page that appears at the start of the browser.\n\n" 18 | }, 19 | "de/wm": { 20 | "Desktop Environment": "A desktop environment is usually a big packages of multiple softwares that together give the user a working environment, in the sense that everything you'll ever need comes installed with the DE (Desktop Environment).\nThe number of softwares that are installed with a desktop environment varies greatly, some of them installs everyting from the window manager to the music player passing by the bluetooth manager.\n\nIn the ricing world desktop environments are rarely used because customizing them turns out into a job of uninstalling what has been installed and reconfiguring what has been configured for you.\nDE are a great choice if you don't have any time to create your own setup.\nRemember that everything that a DE is just a bunch of programs sticked together. They can still be installed outside of it.\nHere are the most common DE:\n * Cinnamon\n * Enlightenment \n * GNOME\n * KDE\n * LXDE\n * XFCE\n * MATE\n\nYou can find a bigger list here:\nhttp://en.wikipedia.org/wiki/Comparison_of_X_Window_System_desktop_environments\n\nMore information here:\nhttps://wiki.archlinux.org/index.php/Desktop_Environment\n\n", 21 | "GUI": "Many programs written for GNU/Linux and unix-like OSs have a GUI, or Graphical User Interface. GUIs for most programs are built around a toolkit called GTK+. GTK+ is a highly-customizable platform that allows end users to tweak every part of how a GUI appears. Commonly, end users install GTK themes from the internet that they like.\n\nIcons comprise mostly all the small pictures you see while interacting with a GUI. Icon packs can be found all over the internet, and contribute highly to an attractive GNU/Linux experience. Some popular icon packs are:\n * Numix/Numix Circle\n * Flattr\n * Moka \n\nGTK Themes are the backbone of ricing GUI applications. They are the difference between a dull, stock GUI, and a sexy one. The method for changing GTK themes varies by WM. Some WMs (like xfwm4) might even support their own themes outside of GTK. However, a reliable GTK theme changer is LXDE's \"LXAppearance\" program. Some GUIs rely on an older, more liked version of GTK known as GTK2, and some rely on the newer, less liked, GTK3, and some rely on both. Nonetheless, most theme packs come with support for both. \n\nSome popular GTK themes are:\n * Iris\n * simpliX\n * Numix\n \nMany, many themes can be found elsewhere on the internet, and a quick search for what you're looking for will likely bring up a myriad of nice themes to pick from.\n\nNext, we have the most finnicky of all riceable things: fonts. Fonts (specifically typefaces) comprise everything you read and write on your computer. For that reason, finding a font you like can be a challenge. \n\nFonts come in two main styles: bitmap and stroke. \n\nBitmap fonts (the nixers font style of choice) are made up of pixels that define the shape of the character. For this reason, they're light on resources and easy to render, but don't scale well and are often only found in one or two sizes. \n\nStroke fonts, on the other hand, are made with mathematical formulas that allow them to scale to hundreds of different sizes. And within these two categories, there are hundreds of different styles. The two most common words you'll hear are sans and monospace typefaces. Sans fonts \n\nMouse cursor (kinda the same as with icons)...\n\n", 22 | "Information System": "An information system can be a status bar, a panel, a dock, a conky, or a taskbar.\nStatus bar. \n\nA status bar is a simple block of text information that stick to one of your screen side. It's suppose to show information about some things in time.\nhttps://github.com/LemonBoy/bar\nhttps://wiki.archlinux.org/index.php/Dzen\n\nA panel is similar is similar to a taskbar in the way that it sticks to a side of the screen however it has more things to it. It adds the possibility to manipulate windows (maximize, minimize, etc..). It has widgets which are clickable.\nhttps://wiki.archlinux.org/index.php/Tint2\n\nA dock is a program that regroups some widgets (like a panel) to make it easierto open up programs. It might have a feature to manipulate windows.\nhttps://wiki.archlinux.org/index.php/Cairo-Dock\n\nA taskbar is the full-fledge bar. It has all the features of a panel pluts, it has a menu, it manages programs that runs hidden in the background (not daemons but programs that have a hide feature), it manages popup messages from programs (if you want to know more about popups check the nofication system part).\nhttps://aur.archlinux.org/packages/gnome-panel/\nhttps://www.archlinux.org/packages/?name=xfce4-panel\n\nIn the ricing world the customization can be done like so:\n * Use a custom set of icons\n * Change the colors\n * Choose what informations are displayed and write scripts for them\n * Choose the Geometry (size, position, side of the screen)\n * Change the fonts\n * Customized the popups\n\n", 23 | "Wallpaper": "The wallpaper, aka background, is one of the hardest thing to choose in a setup.\nThe colors must fit with the rest of the theme, it should be coherent.\nRemember that most of the time the wallpaper will have windows on it that will hide some parts of it.\nThe wallpaper should not interfere with your workflow.\n\nThe safest way is to use a non colorful tile or a blurred background.\nIf you don't go for that you need to take extra care and time into choose the perfect wallpaper.\n\nGreat ressources for wallpapers:\nhttp://wallbase.cc\nhttp://simpledesktops.com\n\nSome programs can be used to simply setting the wallpaper instead of hardcoding it into the .xinitrc file.\n * bgs\n * esetroot\n * Feh\n * habak\n * hsetroot\n * Nitrogen\n * pybgsetter\n * wallpaperd\n * xli\n\nNote: The wallpaper isn't related to the \"icons\" on the desktop. If you want those you'll need a DE shell or a file manager that does that.\n\n", 24 | "Window manager": "A window manager (WM) is a program which has the purpose of managing windows in the graphical environement. Managing windows can range from decorating them to moving them around the screen. The two main types of window managers are tiling WMs and floating (also known as stacking) WMs. For tiling WMs, the windows in a workspace are arranged by the WM and not the user. Tiling WMs can be either manual or automatic. For manual, the window layout is set by the user, and for automatic, the layout is pre-defined by the WM.\n\nSome popular tiling WMs:\n * herbstluftwm (manual)\n * Awesome WM (automatic)\n * i3 (automatic)\n * bspwm (manual)\n * stumpwm (manual)\n\nFloating WMs allow for windows to be moved around freely and stack on top of each other . This way of managing windows is the most used in other proprietary OS like MS Windows and OSX. \n\nHere are some popular floating WMs:\n * openbox (and all *box WMs) (star bucks lol)\n * xfwm4\n * evilwm\n * 2bwm\n * cwm\n\nOther things that might differ across Wms are:\n\nThe way it is Configured. Some WMs provide GUI clients for configurations (all WMs included inside DEs, openbox), text files (i3, awesome, bspwm), scripts (awesome). \n\nThe Border/window decoration(s). Borders can often be customized for different colors, widths, and shapes by the user. The window decorations are a feature that most often allow for quick identification and control of a window. A title bar and icons to allow minimization, maximization, and closing the window are the most common window decorations.\n\nThe way it handles Keybindings. Some Wms are keyboard driven, meaning that they are designed for quick control. Some other don't even handle keys and let a third party program do the job (for example bspwm).\n\nThe way it manages workspaces.There are many types of workspace, tags, desktops... (here need to explain it a bit for the dumb user)\nA website with a long list of Wms: http://xwinman.org \n\n\nAlong with the window manger some other programs can be used along to add fancy decoration to the windows. Often a compositor manager is used. A composite manager is a program that is used to render extra shadows, blurring, and transparency to the windows. Here is a list of well known composite\n * Xcompmgr \n * Compiz \n * Compton\n * Cairo Composite Manager\n\n" 25 | }, 26 | "raw": { 27 | "Bootloader": "The program responsible to start the OS. Usually it is a Menu-Like program.\nThe most common ones are LILO and GRUB2.\nYou can configure the following in a bootloader:\n Background (https://wiki.archlinux.org/index.php/Grub#Background_image_and_bitmap_fonts)\n Menu\n Font (or size of font, changed when the screen size is set: http://www.linuxquestions.org/questions/debian-26/change-console-font-size-70181/ )\n splash screen\n Fbsplash\n Plymouth\n Splashy\n xplash\nA lot of information can be found here https://wiki.archlinux.org/index.php/Grub#Visual_configuration\nChanging the boot messages is the job of the init system.\n\n", 28 | "Login Manager": "There are many ways to identify yourself on your *nix machine\nThe default way is normally to simply use the TTY and enter your username and password\n\nSome programs called \"login managers\" or \"display managers\" are available to pretify this process.\nThey can also be used as a middle man to choose the environment you'll be dropped in after login.\nMost of them are fully themable, from the background, to the font, passing by the layout and input boxes.\n\nList of Display managers:\nhttps://wiki.archlinux.org/index.php/Display_Manager\n\nAlong with the login process you might want to use multiple ways of authentication or 2 ways authentication.\nOn GNU/Linux the PAM (Pluggable Authentication Module) can be used to create custom way to do that such as captchas.\n\n", 29 | "Shell": "The Shell is the command line interface (CLI) that lets you interact with your OS, as opposed to the GUI (graphical user interface).\nList of some available shells:\nhttp://www.labtestproject.com/list_of_linux_shell\n\nRemember that the shell is the door to your *nix world, a shell customized to your needs will make your life easier.\n\nThe most common things that are cutsomized in a shell are the following:\n * adding aliases\n * creating a custom prompt\n * adding color wrappers\n * customizing the way globing works\n * adding special completion behavior\n * customizing the behavior at specific times (inside git repo, at login, etc..)\n http://shreevatsa.wordpress.com/2008/03/30/zshbash-startup-files-loading-order-bashrc-zshrc-etc/\n\nmore documentation:\nhttp://blog.twistedcode.org/2008/03/customizing-your-bash-prompt.html\nhttps://wiki.archlinux.org/index.php/Bash\nhttps://wiki.archlinux.org/index.php/Zsh\nhttps://wiki.archlinux.org/index.php/Ksh\n\n", 30 | "TTY": "TTY, the computer terminal, is the interface that lets you send keys and commands to the kernel/System so they can be interpreted.\nThe TTY is the most basic way to interact with a *nix system. Spending a lot of time in the TTY can be harsh if it hasn't been customized, it's like fighting a beast.\n\nThe TTY only accepts some specific types of fonts. On GNU/Linux they can be found in /usr/share/kbd/console/fonts. You can show the current font using the `showconsolefont` command and change the font using the `setfont` command.\n\nYou can convert bdf fonts (tewi for example) to the font used by the TTY using tools such as what is mentioned in this post: https://bbs.archlinux.org/viewtopic.php?pid=770649#p770649\n\nThe default TTY colors are white on black. To change them you'll have to use perl-term-extendedcolor-tty (ttycolor - https://github.com/trapd00r/ttycolor) or just use `echo` with some special escape characters for colors(set them in your shell).\n\nTo make it easy to multitask in the TTY you'll have to use a terminal multiplexer, a program that lets you use multiple terminals (emulator) in the same TTY and (but not inclusive) detach programs from one terminal to another. Tmux or dtach+dvtm can do this.\n\nThe framebuffer can be used to watch videos and view images in the TTY. (fbgs, fbi, mplayer -vo fbdev and others)\n\nTo learn more about the TTY:\nhttp://www.linusakesson.net/programming/tty/index.php\n\n" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ricerous/json/info_to_json.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | This script generates the JSON information file which is used by Ricerous. 5 | If you wish to make any changes to the information displayed, please follow 6 | these steps: 7 | 8 | 1. Make desired changes to `pad_info` (markdown formatted) 9 | 2. Run this script (`python info_to_json.py`) 10 | 11 | This script will then update your changes to `info.json`, correct its file 12 | formatting using Vim, and then increment the version number meaning that 13 | people can get your additions from the update manager. 14 | """ 15 | 16 | import json 17 | from os import system 18 | from datetime import datetime 19 | 20 | my_file = open("pad_info", 'r').readlines() 21 | 22 | section = -1 23 | category = -1 24 | sections = [] 25 | categories = [] 26 | dico = {} 27 | tmp_dico = {} 28 | output = "" 29 | first_time = True 30 | 31 | for line in my_file: 32 | if line.startswith("!!!"): 33 | sections.append(line.replace("!!!", "").rstrip()) 34 | 35 | # print len(sections) 36 | 37 | for line in my_file: 38 | if line.startswith("##"): 39 | categories.append(line.replace("##", "").rstrip()) 40 | 41 | # print len(categories) 42 | 43 | for i in range(len(my_file)): 44 | if my_file[i].startswith("!!!"): 45 | # we fill the previous section 46 | if section != -1: 47 | dico[sections[section]] = tmp_dico 48 | section += 1 49 | tmp_dico = {} 50 | first_time = True 51 | 52 | # print "---NEW SECTION---" 53 | # print sections[section] 54 | # print "-----------------" 55 | 56 | elif my_file[i].startswith("##"): 57 | # we fill the previous category 58 | if category != -1 and not first_time: 59 | tmp_dico[categories[category]] = output 60 | # print categories[category] 61 | category += 1 62 | first_time = False 63 | output = "" 64 | else: 65 | output += my_file[i].replace('"', '\"') 66 | if i+1 != len(my_file) and my_file[i+1].startswith("!!!"): 67 | tmp_dico[categories[category]] = output 68 | # print categories[category] 69 | output = "" 70 | elif i+1 == len(my_file): 71 | tmp_dico[categories[category]] = output 72 | # print categories[category] 73 | dico[sections[section]] = tmp_dico 74 | 75 | 76 | jsonFile = json.JSONEncoder().encode(dico) 77 | infoFile = open('info.json', 'w').write(jsonFile) 78 | 79 | version = open('version', 'r').read() 80 | verDate = int(''.join(list(version)[0:8])) 81 | 82 | nowDate = datetime.isoformat(datetime.now()) 83 | nowDate = int(nowDate.split("T")[0].replace("-", "")) 84 | 85 | if verDate == nowDate: 86 | new_version = open('version', 'w').write(str(int(version) + 1)) 87 | else: 88 | new_version = open('version', 'w').write(str(nowDate) + "00") 89 | 90 | # Corrects formatting using Vim 91 | system('vim -c ":% !python -m json.tool" -c ":wq" info.json') 92 | -------------------------------------------------------------------------------- /ricerous/json/pad_info: -------------------------------------------------------------------------------- 1 | !!!raw 2 | 3 | ##Bootloader 4 | The program responsible to start the OS. Usually it is a Menu-Like program. 5 | The most common ones are LILO and GRUB2. 6 | You can configure the following in a bootloader: 7 | Background (https://wiki.archlinux.org/index.php/Grub#Background_image_and_bitmap_fonts) 8 | Menu 9 | Font (or size of font, changed when the screen size is set: http://www.linuxquestions.org/questions/debian-26/change-console-font-size-70181/ ) 10 | splash screen 11 | Fbsplash 12 | Plymouth 13 | Splashy 14 | xplash 15 | A lot of information can be found here https://wiki.archlinux.org/index.php/Grub#Visual_configuration 16 | Changing the boot messages is the job of the init system. 17 | 18 | ##Shell 19 | The Shell is the command line interface (CLI) that lets you interact with your OS, as opposed to the GUI (graphical user interface). 20 | List of some available shells: 21 | http://www.labtestproject.com/list_of_linux_shell 22 | 23 | Remember that the shell is the door to your *nix world, a shell customized to your needs will make your life easier. 24 | 25 | The most common things that are cutsomized in a shell are the following: 26 | * adding aliases 27 | * creating a custom prompt 28 | * adding color wrappers 29 | * customizing the way globing works 30 | * adding special completion behavior 31 | * customizing the behavior at specific times (inside git repo, at login, etc..) 32 | http://shreevatsa.wordpress.com/2008/03/30/zshbash-startup-files-loading-order-bashrc-zshrc-etc/ 33 | 34 | more documentation: 35 | http://blog.twistedcode.org/2008/03/customizing-your-bash-prompt.html 36 | https://wiki.archlinux.org/index.php/Bash 37 | https://wiki.archlinux.org/index.php/Zsh 38 | https://wiki.archlinux.org/index.php/Ksh 39 | 40 | ##TTY 41 | TTY, the computer terminal, is the interface that lets you send keys and commands to the kernel/System so they can be interpreted. 42 | The TTY is the most basic way to interact with a *nix system. Spending a lot of time in the TTY can be harsh if it hasn't been customized, it's like fighting a beast. 43 | 44 | The TTY only accepts some specific types of fonts. On GNU/Linux they can be found in /usr/share/kbd/console/fonts. You can show the current font using the `showconsolefont` command and change the font using the `setfont` command. 45 | 46 | You can convert bdf fonts (tewi for example) to the font used by the TTY using tools such as what is mentioned in this post: https://bbs.archlinux.org/viewtopic.php?pid=770649#p770649 47 | 48 | The default TTY colors are white on black. To change them you'll have to use perl-term-extendedcolor-tty (ttycolor - https://github.com/trapd00r/ttycolor) or just use `echo` with some special escape characters for colors(set them in your shell). 49 | 50 | To make it easy to multitask in the TTY you'll have to use a terminal multiplexer, a program that lets you use multiple terminals (emulator) in the same TTY and (but not inclusive) detach programs from one terminal to another. Tmux or dtach+dvtm can do this. 51 | 52 | The framebuffer can be used to watch videos and view images in the TTY. (fbgs, fbi, mplayer -vo fbdev and others) 53 | 54 | To learn more about the TTY: 55 | http://www.linusakesson.net/programming/tty/index.php 56 | 57 | ##Login Manager 58 | There are many ways to identify yourself on your *nix machine 59 | The default way is normally to simply use the TTY and enter your username and password 60 | 61 | Some programs called "login managers" or "display managers" are available to pretify this process. 62 | They can also be used as a middle man to choose the environment you'll be dropped in after login. 63 | Most of them are fully themable, from the background, to the font, passing by the layout and input boxes. 64 | 65 | List of Display managers: 66 | https://wiki.archlinux.org/index.php/Display_Manager 67 | 68 | Along with the login process you might want to use multiple ways of authentication or 2 ways authentication. 69 | On GNU/Linux the PAM (Pluggable Authentication Module) can be used to create custom way to do that such as captchas. 70 | 71 | !!!de/wm 72 | 73 | ##Desktop Environment 74 | A desktop environment is usually a big packages of multiple softwares that together give the user a working environment, in the sense that everything you'll ever need comes installed with the DE (Desktop Environment). 75 | The number of softwares that are installed with a desktop environment varies greatly, some of them installs everyting from the window manager to the music player passing by the bluetooth manager. 76 | 77 | In the ricing world desktop environments are rarely used because customizing them turns out into a job of uninstalling what has been installed and reconfiguring what has been configured for you. 78 | DE are a great choice if you don't have any time to create your own setup. 79 | Remember that everything that a DE is just a bunch of programs sticked together. They can still be installed outside of it. 80 | Here are the most common DE: 81 | * Cinnamon 82 | * Enlightenment 83 | * GNOME 84 | * KDE 85 | * LXDE 86 | * XFCE 87 | * MATE 88 | 89 | You can find a bigger list here: 90 | http://en.wikipedia.org/wiki/Comparison_of_X_Window_System_desktop_environments 91 | 92 | More information here: 93 | https://wiki.archlinux.org/index.php/Desktop_Environment 94 | 95 | ##Window manager 96 | A window manager (WM) is a program which has the purpose of managing windows in the graphical environement. Managing windows can range from decorating them to moving them around the screen. The two main types of window managers are tiling WMs and floating (also known as stacking) WMs. For tiling WMs, the windows in a workspace are arranged by the WM and not the user. Tiling WMs can be either manual or automatic. For manual, the window layout is set by the user, and for automatic, the layout is pre-defined by the WM. 97 | 98 | Some popular tiling WMs: 99 | * herbstluftwm (manual) 100 | * Awesome WM (automatic) 101 | * i3 (automatic) 102 | * bspwm (manual) 103 | * stumpwm (manual) 104 | 105 | Floating WMs allow for windows to be moved around freely and stack on top of each other . This way of managing windows is the most used in other proprietary OS like MS Windows and OSX. 106 | 107 | Here are some popular floating WMs: 108 | * openbox (and all *box WMs) (star bucks lol) 109 | * xfwm4 110 | * evilwm 111 | * 2bwm 112 | * cwm 113 | 114 | Other things that might differ across Wms are: 115 | 116 | The way it is Configured. Some WMs provide GUI clients for configurations (all WMs included inside DEs, openbox), text files (i3, awesome, bspwm), scripts (awesome). 117 | 118 | The Border/window decoration(s). Borders can often be customized for different colors, widths, and shapes by the user. The window decorations are a feature that most often allow for quick identification and control of a window. A title bar and icons to allow minimization, maximization, and closing the window are the most common window decorations. 119 | 120 | The way it handles Keybindings. Some Wms are keyboard driven, meaning that they are designed for quick control. Some other don't even handle keys and let a third party program do the job (for example bspwm). 121 | 122 | The way it manages workspaces.There are many types of workspace, tags, desktops... (here need to explain it a bit for the dumb user) 123 | A website with a long list of Wms: http://xwinman.org 124 | 125 | 126 | Along with the window manger some other programs can be used along to add fancy decoration to the windows. Often a compositor manager is used. A composite manager is a program that is used to render extra shadows, blurring, and transparency to the windows. Here is a list of well known composite 127 | * Xcompmgr 128 | * Compiz 129 | * Compton 130 | * Cairo Composite Manager 131 | 132 | ##Information System 133 | An information system can be a status bar, a panel, a dock, a conky, or a taskbar. 134 | Status bar. 135 | 136 | A status bar is a simple block of text information that stick to one of your screen side. It's suppose to show information about some things in time. 137 | https://github.com/LemonBoy/bar 138 | https://wiki.archlinux.org/index.php/Dzen 139 | 140 | A panel is similar is similar to a taskbar in the way that it sticks to a side of the screen however it has more things to it. It adds the possibility to manipulate windows (maximize, minimize, etc..). It has widgets which are clickable. 141 | https://wiki.archlinux.org/index.php/Tint2 142 | 143 | A dock is a program that regroups some widgets (like a panel) to make it easierto open up programs. It might have a feature to manipulate windows. 144 | https://wiki.archlinux.org/index.php/Cairo-Dock 145 | 146 | A taskbar is the full-fledge bar. It has all the features of a panel pluts, it has a menu, it manages programs that runs hidden in the background (not daemons but programs that have a hide feature), it manages popup messages from programs (if you want to know more about popups check the nofication system part). 147 | https://aur.archlinux.org/packages/gnome-panel/ 148 | https://www.archlinux.org/packages/?name=xfce4-panel 149 | 150 | In the ricing world the customization can be done like so: 151 | * Use a custom set of icons 152 | * Change the colors 153 | * Choose what informations are displayed and write scripts for them 154 | * Choose the Geometry (size, position, side of the screen) 155 | * Change the fonts 156 | * Customized the popups 157 | 158 | ##GUI 159 | Many programs written for GNU/Linux and unix-like OSs have a GUI, or Graphical User Interface. GUIs for most programs are built around a toolkit called GTK+. GTK+ is a highly-customizable platform that allows end users to tweak every part of how a GUI appears. Commonly, end users install GTK themes from the internet that they like. 160 | 161 | Icons comprise mostly all the small pictures you see while interacting with a GUI. Icon packs can be found all over the internet, and contribute highly to an attractive GNU/Linux experience. Some popular icon packs are: 162 | * Numix/Numix Circle 163 | * Flattr 164 | * Moka 165 | 166 | GTK Themes are the backbone of ricing GUI applications. They are the difference between a dull, stock GUI, and a sexy one. The method for changing GTK themes varies by WM. Some WMs (like xfwm4) might even support their own themes outside of GTK. However, a reliable GTK theme changer is LXDE's "LXAppearance" program. Some GUIs rely on an older, more liked version of GTK known as GTK2, and some rely on the newer, less liked, GTK3, and some rely on both. Nonetheless, most theme packs come with support for both. 167 | 168 | Some popular GTK themes are: 169 | * Iris 170 | * simpliX 171 | * Numix 172 | 173 | Many, many themes can be found elsewhere on the internet, and a quick search for what you're looking for will likely bring up a myriad of nice themes to pick from. 174 | 175 | Next, we have the most finnicky of all riceable things: fonts. Fonts (specifically typefaces) comprise everything you read and write on your computer. For that reason, finding a font you like can be a challenge. 176 | 177 | Fonts come in two main styles: bitmap and stroke. 178 | 179 | Bitmap fonts (the nixers font style of choice) are made up of pixels that define the shape of the character. For this reason, they're light on resources and easy to render, but don't scale well and are often only found in one or two sizes. 180 | 181 | Stroke fonts, on the other hand, are made with mathematical formulas that allow them to scale to hundreds of different sizes. And within these two categories, there are hundreds of different styles. The two most common words you'll hear are sans and monospace typefaces. Sans fonts 182 | 183 | Mouse cursor (kinda the same as with icons)... 184 | 185 | ##Wallpaper 186 | The wallpaper, aka background, is one of the hardest thing to choose in a setup. 187 | The colors must fit with the rest of the theme, it should be coherent. 188 | Remember that most of the time the wallpaper will have windows on it that will hide some parts of it. 189 | The wallpaper should not interfere with your workflow. 190 | 191 | The safest way is to use a non colorful tile or a blurred background. 192 | If you don't go for that you need to take extra care and time into choose the perfect wallpaper. 193 | 194 | Great ressources for wallpapers: 195 | http://wallbase.cc 196 | http://simpledesktops.com 197 | 198 | Some programs can be used to simply setting the wallpaper instead of hardcoding it into the .xinitrc file. 199 | * bgs 200 | * esetroot 201 | * Feh 202 | * habak 203 | * hsetroot 204 | * Nitrogen 205 | * pybgsetter 206 | * wallpaperd 207 | * xli 208 | 209 | Note: The wallpaper isn't related to the "icons" on the desktop. If you want those you'll need a DE shell or a file manager that does that. 210 | 211 | !!!common applications 212 | 213 | ##Terminal emulator 214 | Terminal emulators are graphical applications sitting between the user and the shell(isn't it a media to interact with the terminal) [ref needed]. Terminal emulators consist of a text input to interact with the shell, and with such there are only a few thing you can tweak: background, text colors, font and behavior. 215 | 216 | As terminal emulators are graphical windows, you can change their aspect, starting by the background. 217 | Some terminals (like gnome-terminal, or konsole) include drop-down menus to customise most settings. 218 | In case of more minimalist terminals, you'll have to use another way to modify them. Common means are either by using the X resource database (xrdb), or by modifying the application at compilation time (by modifying a file commonly named "config.h" or "config"). 219 | In case of an "xrdb compliant" terminal, you will have to run `xrdb -merge /path/to/file` and relaunching the app to see your changes applied. For "config.h style terminals", a recompilation and restart of the app is needed. While drop-down menu like terminals are modified instantly. 220 | 221 | Here is a list of commonly used terminals 222 | 223 | Modified via mouse menus: 224 | * gnome-terminal 225 | * konsole 226 | * terminator 227 | * yakuake 228 | * xfce-terminal 229 | 230 | Modified via xrdb 231 | * rxvt-unicode 232 | * xterm 233 | * aterm 234 | * mterm 235 | 236 | Modified via config.h/config 237 | * evilvte 238 | * st 239 | * termite 240 | 241 | Background 242 | Terminal backgrounds consists of the rectangular area filling the whole window, behind the text. Most of the time, the default color is white (or purple, in ONE. SPECIAL. CASE). Depending on your terminal of choice, you'll be able to modify the color, transparency or image background. That's pretty much it. 243 | 244 | Speaking of transparency, one can make a distinction between true and fake transparency. 245 | True transparency make your terminal look like a teinted glass. Move it around and you'll be able to see what's behind it. It require a composite manager [ref needed] to run in order to work. 246 | Fake transparency is more of a hack: when the window will stop moving, it will "copy" your wallpaper on the background, and apply the ply the teint your specified to it. So if you place it in front of a window, you not see the window behind your terminal, but the portion of your wallpaper behind it. 247 | 248 | Font 249 | You can use two types of font: "xft" or "bitmap". 250 | X font types (or XFT, for short) are well polished fonts. They are antialiased, scalable and well designed. They look great, but can be slow to draw sometimes. That's why bitmap fonts are still used. Those fonts are pixel based and not scalable. That's why they can be drawn faster. 251 | Now it's just a matter of choice. Most terminals support both rendering, so do as you please ! 252 | 253 | Text Colors 254 | A terminal usually make use of 8 differents colors: black, red, green, yellow, blue, magenta, cyan and white. Those 8 colors can come in two flavor: normal and bold. by default, bold colors are just a more flashy version of the color. It leaves use with a total of 16 different colors that we can tweak. This palette of 16 colors is commonly referred to as a "terminal colorscheme". 255 | To tweak this, the user (you) can assign each color an hexadecimal code that will be displayed when the color is used. Before assigning this code, you must be aware of how many different colors your terminal can display, and thus, which code you can use. 256 | 257 | Most of the time, terminals supports 256 differents colors, that you can find here: http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html. 258 | 259 | Behavior 260 | The behavior of the terminal is an important thing, because it's a central application on a linux desktop. Its behavior is defined by the features your terminal gives you. Some are modable via perl scripts, drop-down, have tabs, can resize font on the fly, can open URIs in your web browser, etc... 261 | Just try them all ! 262 | 263 | ##File Managers 264 | The role of a file manager is to make it easy to browse your file system and manipulate files. 265 | This role defines how a file manager acts. 266 | There are 2 different kinds of file managers non-graphicals and graphicals. 267 | 268 | Examples of non-graphical file managers: 269 | * core-utils 270 | * ranger 271 | * vifm 272 | * commander 273 | * mc (midnight commander) 274 | 275 | Example of graphical file managers: 276 | * thunar 277 | * nautilus 278 | * dolphin 279 | * caja 280 | * gnome-commander 281 | 282 | Some file managers follow the GTK theme (icons and colors), if graphical, some doesn't. 283 | The colors of the non-graphical ones can usually be riced. 284 | 285 | It's important to configure how the file manager displays and list files. 286 | For graphical file managers there are multiple ways of listing, some with preview, some with more information, etc.. 287 | 288 | Another feature some file managers adds is the ability to interact with files. 289 | To execute scripts and macros by clicking them, to add a context menu when clicking on certain dir or files. Those are normally fully customizable. 290 | 291 | A file manager might also be able to access files over the network. 292 | 293 | A bunch files managers included in DE have the ability to manage the "Desktop", as in the icon displayed over the root window aka "background". 294 | 295 | ##Chat client 296 | Chat clients, instant messagers.It's extremely hard to explain how to rice them due to their variety. 297 | 298 | The mostly riced are the irc clients: irssi and weechat. 299 | 300 | A list of things you can change in them: 301 | * Nickname alignement 302 | * Colors 303 | * Informations 304 | * Plugins 305 | 306 | ##Music/Media player 307 | Like all items in this section, there's a wide variety of choices for a media player. 308 | There are GUI ones, Curses ones, and CLI ones. 309 | Most of them offer some sort of customization. The easiest ones to rice are the curses. 310 | 311 | Things that can be riced: 312 | * Colors 313 | * UI elements 314 | * Equalizer 315 | * Visualizer 316 | 317 | Ressources: 318 | https://wiki.archlinux.org/index.php/Cmus 319 | https://wiki.archlinux.org/index.php/Ncmpcpp 320 | 321 | ##Text editor 322 | The choices for text editors aren't scarce. 323 | The prefered choices for ricers are: EMACS, Sublime, and Vim. 324 | 325 | The customization goes as follow: 326 | * Syntax highlighting 327 | * Theme (for UI elements arrangement) 328 | * Plugins 329 | 330 | Ressources: 331 | http://www.linux.org/threads/text-editors.4104/g 332 | 333 | ##Web browser 334 | There's a lot of variety of browsers. 335 | 336 | Things you can do with your browser are the following: 337 | * Change its appearance: 338 | * chrome.css (Firefox), and other files for other browsers 339 | * Move the widgets (tab bar,info,etc..) 340 | * Create a custom start page, a page that appears at the start of the browser. 341 | 342 | !!!Others 343 | 344 | ##Show-off Colors 345 | pipes.sh 346 | This repository contains all the most popular color scripts 347 | https://github.com/gstk/Color-Scripts 348 | 349 | ##Notification system 350 | Desktop notifications are pops-up that signals an event update. 351 | They are used to keep you updated about multiple things. 352 | 353 | For example: 354 | * Change of sound volume 355 | * Change of brightness 356 | * Change of network connection 357 | 358 | Ressources: 359 | https://wiki.archlinux.org/index.php/Desktop_Notifications 360 | http://blog.z3bra.org/2014/04/pop-it-up.html 361 | 362 | ##Information Displays 363 | Archey 364 | Conky 365 | Screenfetch 366 | Screenfo 367 | 368 | ##Monitoring Programs 369 | htop 370 | 371 | ##Application launcher 372 | An application launcher is a program used as a kind of menu to start other programs. 373 | it can be a selection menu or a terminal like menu (input). 374 | 375 | Some comes built-in inside a DE taskbar (gnome-panel) some are third parties. 376 | 377 | Ressources: 378 | https://wiki.archlinux.org/index.php/Category:Application_launchers 379 | https://wiki.archlinux.org/index.php/Xdg-open 380 | 381 | ##Screen locker 382 | A screen locker blocks input to your machine until the right password has been entered. 383 | 384 | A lot of extravagant way can be used to achieve so: 385 | * Blurring the screen and adding a padlock to the middle 386 | * Changing the image to something else, 387 | * Do a futurist menu to enter your machine 388 | * have a nice input dialog 389 | * etc... 390 | 391 | Ressources: 392 | https://wiki.archlinux.org/index.php/List_of_applications#Screen_lockers 393 | 394 | ##Others 395 | 396 | -------------------------------------------------------------------------------- /ricerous/json/readme.md: -------------------------------------------------------------------------------- 1 | # JSON 2 | This directory contains the JSON formatted data used by Ricerous. Here's a quick run down over what it does. 3 | 4 | ## conf.json 5 | The personal config file. 6 | 7 | ## info.json & associated 8 | This file contains all the ricing date read by the program. It has several files associated with it to ensure that it can be updated smoothly. Please DO NOT modify this file directly. 9 | 10 | ### pad_info 11 | This markdown document is the base for all the info. If you wish to make changes to the displayed information, make them in this file. 12 | 13 | ### info_to_json.py 14 | After making changes, run this script. This will update the JSON file and correct it's formatting using Vim. See the file header for futher usage information. 15 | 16 | ### version 17 | This is the version date-tag for the JSON file, used by the program to determine if a newer version is available for download. It is incremented automatically by the python script. 18 | -------------------------------------------------------------------------------- /ricerous/json/version: -------------------------------------------------------------------------------- 1 | 2016040500 -------------------------------------------------------------------------------- /ricerous/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nixers-projects/ricerous/6289bd0253a98552f6819f7a72da699b5d3feb3d/ricerous/plugins/__init__.py -------------------------------------------------------------------------------- /ricerous/plugins/bbcode.py: -------------------------------------------------------------------------------- 1 | 2 | def getName(): 3 | return "bbcode" 4 | 5 | 6 | def output(state, information): 7 | categories = information.listCategories() 8 | selections = state.selected 9 | toSave = "" 10 | firstOne = True 11 | for category in categories: 12 | found = 0 13 | for selection in selections: 14 | if information.getCategory(selection) == category: 15 | if state.comments[selection]: 16 | found += 1 17 | if found == 1: 18 | if not firstOne: 19 | toSave += "[/list]\n" 20 | toSave += "\n[size=9]" + category + "[/size]\n[list]\n\n" 21 | firstOne = False 22 | toSave += "[*][size=5]" + selection+"[/size]\n" 23 | commentLines = state.comments[selection].split("\n") 24 | for line in commentLines: 25 | toSave += " "+line+"\n" 26 | toSave += "[/list]"+"\n" 27 | return toSave 28 | -------------------------------------------------------------------------------- /ricerous/plugins/html.py: -------------------------------------------------------------------------------- 1 | def getName(): 2 | return "html" 3 | 4 | 5 | def output(state, information): 6 | categories = information.listCategories() 7 | selections = state.selected 8 | toSave = """ 9 | 10 | 11 | 12 | 13 | \n 14 | """ 15 | firstOne = True 16 | for category in categories: 17 | found = 0 18 | for selection in selections: 19 | if information.getCategory(selection) == category: 20 | if state.comments[selection]: 21 | found += 1 22 | if found == 1: 23 | if not firstOne: 24 | toSave += "\n" 25 | toSave += "

" + category + "

\n
    \n" 26 | firstOne = False 27 | toSave += "\n
  • \n

    " + selection + "


    \n" 28 | commentLines = state.comments[selection].split("\n") 29 | for line in commentLines: 30 | toSave += line + "
    \n" 31 | toSave += "
  • \n" 32 | toSave += "
\n" 33 | toSave += "\n" 34 | toSave += "\n" 35 | return toSave 36 | -------------------------------------------------------------------------------- /ricerous/plugins/latex.py: -------------------------------------------------------------------------------- 1 | 2 | def getName(): 3 | return "latex" 4 | 5 | 6 | def output(state, information): 7 | categories = information.listCategories() 8 | selections = state.selected 9 | toSave = """\\documentclass{article} 10 | \\title{Ricing Information} 11 | \\date{\\today} 12 | \\author{Your Name} 13 | \\begin{document} 14 | \\maketitle 15 | """ 16 | for category in categories: 17 | found = 0 18 | for selection in selections: 19 | if information.getCategory(selection) == category: 20 | if state.comments[selection]: 21 | found += 1 22 | if found == 1: 23 | toSave += "\n\\section{" + category + "}\n\n" 24 | toSave += "\\subsection{" + selection + "}\n" 25 | commentLines = state.comments[selection].split("\n") 26 | for line in commentLines: 27 | toSave += line+"\n" 28 | 29 | return toSave+"\n\\end{document}" 30 | -------------------------------------------------------------------------------- /ricerous/plugins/markdown.py: -------------------------------------------------------------------------------- 1 | 2 | def getName(): 3 | return "markdown" 4 | 5 | 6 | def output(state, information): 7 | categories = information.listCategories() 8 | selections = state.selected 9 | toSave = "" 10 | 11 | for category in categories: 12 | found = 0 13 | for selection in selections: 14 | if information.getCategory(selection) == category: 15 | if state.comments[selection]: 16 | found += 1 17 | if found == 1: 18 | toSave += "\n#" + category + "\n\n" 19 | toSave += "* " + selection + "\n" 20 | commentLines = state.comments[selection].split("\n") 21 | for line in commentLines: 22 | toSave += " " + line + "\n" 23 | return toSave 24 | -------------------------------------------------------------------------------- /ricerous/plugins/readme.md: -------------------------------------------------------------------------------- 1 | # Plugins 2 | 3 | This directory contains plugins which export the data given to Ricerous. When making a plugin remember to include both ```getName()``` and ```output(state, information)``` functions or the program will not mark the plugin as a 'good' plugin, and so it will not be imported. 4 | -------------------------------------------------------------------------------- /ricerous/rice.kv: -------------------------------------------------------------------------------- 1 | #:kivy 1.8.0 2 | 3 | : 4 | orientation: "horizontal" 5 | size_hint_y: 0.05 6 | canvas: 7 | Color: 8 | rgba: 0.35, 0.35, 0.35, 1 9 | Rectangle: 10 | size: self.size 11 | pos: self.pos 12 | 13 | Prompt: 14 | size_hint_x: 0.3 15 | size: self.width, root.height 16 | halign: 'right' 17 | center_x: root.center_x 18 | center_y: root.height - self.texture_size[1] 19 | 20 | Label: 21 | # size_hint_x: 0.05 22 | text: "Ricerous" 23 | font_size: '28sp' 24 | halign: 'center' 25 | size: self.width, self.height 26 | 27 | 28 | : 29 | BoxLayout: 30 | size: root.size 31 | pos: root.pos 32 | orientation: "vertical" 33 | FileChooserListView: 34 | id: filechooser 35 | 36 | BoxLayout: 37 | size_hint_y: None 38 | height: 30 39 | Button: 40 | text: "Cancel" 41 | on_release: root.cancel() 42 | 43 | Button: 44 | text: "Load" 45 | on_release: root.load(filechooser.path, filechooser.selection) 46 | 47 | : 48 | text_input: text_input 49 | BoxLayout: 50 | size: root.size 51 | pos: root.pos 52 | orientation: "vertical" 53 | FileChooserListView: 54 | id: filechooser 55 | on_selection: text_input.text = self.selection and self.selection[0] or '' 56 | 57 | TextInput: 58 | id: text_input 59 | size_hint_y: None 60 | height: 30 61 | multiline: False 62 | 63 | BoxLayout: 64 | size_hint_y: None 65 | height: 30 66 | Button: 67 | text: "Cancel" 68 | on_release: root.cancel() 69 | 70 | Button: 71 | text: "Save" 72 | on_release: root.save(filechooser.path, text_input.text) 73 | 74 | : 75 | size_hint_y: 0.05 76 | orientation: "horizontal" 77 | 78 | Button: 79 | text: "Import" 80 | on_release: root.showImport() 81 | 82 | Button: 83 | text: "Export" 84 | on_release: root.showExport() 85 | 86 | Button: 87 | text: "Output" 88 | on_release: root.showOutput() 89 | 90 | Button: 91 | text: "Update" 92 | on_release: root.showUpdate() 93 | 94 | Button: 95 | text: "Help" 96 | on_release: root.showHelp() 97 | 98 | : 99 | orientation: "horizontal" 100 | accordion: acco 101 | 102 | canvas: 103 | Color: 104 | rgba: 0.15, 0.15, 0.15, 0 105 | Rectangle: 106 | size: root.width, root.height*0.05 107 | pos: self.x, root.center_y 108 | 109 | AccordionThing: 110 | id: acco 111 | 112 | size_hint_x: 0.3 113 | 114 | Widget: 115 | size_hint_x: 0.01 116 | canvas: 117 | Color: 118 | rgba: 0.35, 0.35, 0.35, 1 119 | Rectangle: 120 | size: self.size 121 | pos: self.pos 122 | 123 | : 124 | header: head 125 | riced: riceCheckBox 126 | size_hint_y: 0.05 127 | 128 | Label: 129 | id: head 130 | # size_hint_y: 0.05 131 | font_size: "20sp" 132 | size: root.width/2, root.height 133 | pos: root.center_x - self.width/2, root.center_y - root.height/2 134 | 135 | CheckBox: 136 | id: riceCheckBox 137 | size: root.width/2, root.height 138 | pos: root.width - self.width/6, root.center_y - self.height/2 139 | 140 | Label: 141 | text: "Riced" 142 | font_size: "20sp" 143 | size: root.width/2, root.height 144 | pos: root.width, root.center_y - self.height/2 145 | 146 | #: 147 | # orientation: "vertical" 148 | # txts: txt 149 | # 150 | # ScrollView: 151 | # size_hint: 1, 1 152 | # size: width, height 153 | # 154 | # TextInput: 155 | # id: txt 156 | # background_color: 0.15, 0.15, 0.15, 1 157 | # foreground_color: 1, 1, 1, 1 158 | # multiline: True 159 | # readonly: True 160 | # size_hint: 1.0, None 161 | -------------------------------------------------------------------------------- /ricerous/run_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | try: 4 | from backend import Outputer, JsonInfoReader, State 5 | except Exception: 6 | #exits when not called as a test script 7 | sys.exit(1) 8 | import random 9 | 10 | out = Outputer.Outputer("plugins") 11 | state = State.State() 12 | info = JsonInfoReader.JsonInfoReader("json/info.json") 13 | state.addSelect("Bootloader") 14 | state.addComment("Bootloader", "I use a magenta... blah blah") 15 | state.addSelect("Window manager") 16 | state.addComment("Window manager", "2bwm ftw") 17 | state.addSelect("GUI") 18 | state.addComment("GUI", "gtk theme: a modified version of flatstudio that can be found here\nhttp://example.com") 19 | out.output(random.choice(out.getAvailable()), state, info, "savedOutputTest") 20 | -------------------------------------------------------------------------------- /ricerous/unit_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | import sys 4 | try: 5 | from backend import JsonInfoReader 6 | from backend import State 7 | from backend import Outputer 8 | except Exception: 9 | sys.exit(1) 10 | import unittest 11 | 12 | 13 | class RicerTest(unittest.TestCase): 14 | 15 | def testInfoReader(self): 16 | info = JsonInfoReader.JsonInfoReader("ricerous/json/info.json") 17 | self.assertTrue(len(info.listCategories()) > 1) 18 | self.assertTrue(len(info.listInsideCategories("raw")) > 1) 19 | self.assertFalse(len(info.listInsideCategories("Not Real Category")) > 0) 20 | self.assertTrue(len(info.getInfo("Bootloader")) > 10) 21 | self.assertFalse(len(info.getInfo("Not Real Info")) > 0) 22 | self.assertTrue(info.getCategory("Bootloader") == "raw") 23 | self.assertFalse(info.getCategory("Not Real Category") == "raw") 24 | self.assertFalse(info.getCategory("Not Real Category") != "") 25 | 26 | def testState(self): 27 | state = State.State() 28 | state.addSelect("Bootloader") 29 | state.addComment("Bootloader", "I use a magenta... blah blah") 30 | self.assertTrue(len(state.comments) == 1) 31 | self.assertTrue(len(state.selected) == 1) 32 | state.addSelect("Window manager") 33 | state.addComment("Window manager", "SuperWM ftw") 34 | self.assertTrue(len(state.comments) == 2) 35 | self.assertTrue(len(state.selected) == 2) 36 | state.addSelect("GUI") 37 | state.addComment("GUI", "gtk theme: a modified version of XXX that can be found here\nhttp://example.com") 38 | self.assertTrue(len(state.comments) == 3) 39 | self.assertTrue(len(state.selected) == 3) 40 | state.unComment("Not Real Comment") 41 | self.assertTrue(len(state.comments) == 3) 42 | self.assertTrue(len(state.selected) == 3) 43 | state.unComment("GUI") 44 | self.assertTrue(len(state.comments) == 2) 45 | self.assertTrue(len(state.selected) == 3) 46 | state.unSelect("GUI") 47 | self.assertTrue(len(state.comments) == 2) 48 | self.assertTrue(len(state.selected) == 2) 49 | state.comments = {} 50 | state.selected = [] 51 | state.load("ricerous/json/conf.json") 52 | self.assertTrue(len(state.comments) > 0) 53 | self.assertTrue(len(state.selected) > 0) 54 | 55 | def testOutputer(self): 56 | out = Outputer.Outputer("ricerous/plugins") 57 | self.assertTrue(len(out.getAvailable()) > 0) 58 | 59 | 60 | def main(): 61 | unittest.main() 62 | 63 | if __name__ == '__main__': 64 | main() 65 | -------------------------------------------------------------------------------- /scripts/ricerous: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from kivy.app import App 4 | from kivy.uix.widget import Widget 5 | from kivy.uix.button import Button 6 | from kivy.uix.label import Label 7 | from kivy.uix.boxlayout import BoxLayout 8 | from kivy.uix.stacklayout import StackLayout 9 | from kivy.uix.checkbox import CheckBox 10 | from kivy.uix.togglebutton import ToggleButton 11 | from kivy.uix.accordion import Accordion, AccordionItem 12 | from kivy.uix.textinput import TextInput 13 | from kivy.uix.scrollview import ScrollView 14 | from kivy.uix.floatlayout import FloatLayout 15 | from kivy.factory import Factory 16 | from kivy.uix.popup import Popup 17 | from kivy.lang import Builder 18 | from kivy.core.window import Window 19 | from kivy.graphics import Color, Rectangle 20 | from kivy.properties import StringProperty, ObjectProperty 21 | from getpass import getuser 22 | from socket import gethostname 23 | from pkg_resources import resource_filename 24 | import time 25 | import os 26 | 27 | 28 | from ricerous.backend import location_manager 29 | from ricerous.backend import JsonInfoReader 30 | from ricerous.backend import State 31 | from ricerous.backend import Outputer 32 | 33 | 34 | jfile = JsonInfoReader.JsonInfoReader(location_manager.INFO) 35 | state = State.State() 36 | out = Outputer.Outputer(resource_filename("ricerous", "plugins")) 37 | 38 | subButtons = {} 39 | 40 | DEFAULT_ON_OPEN = "Bootloader" 41 | 42 | DEFAULT_COMMENT = "Insert a comment here\n\n" 43 | UPDATE_SUCC_TEXT = "Update Successful! :)" 44 | UPDATE_UNSUCC_TEXT = "Update Unsuccessful! :( " 45 | NO_UPDATE_TEXT = "No new update available" 46 | HELP_TEXT = """ 47 | Check info about riceable things. 48 | Mark them as riced. 49 | Comment on them about what you've done. 50 | Export or import your setup to use in the program later. 51 | Output to different visual formats. 52 | """ 53 | 54 | 55 | class LoadDialog(FloatLayout): 56 | load = ObjectProperty(None) 57 | cancel = ObjectProperty(None) 58 | 59 | 60 | class SaveDialog(FloatLayout): 61 | save = ObjectProperty(None) 62 | text_input = ObjectProperty(None) 63 | cancel = ObjectProperty(None) 64 | 65 | 66 | class TitleBar(BoxLayout): 67 | 68 | def __init__(self, **kwargs): 69 | super(TitleBar, self).__init__(**kwargs) 70 | 71 | 72 | class Prompt(Label): 73 | 74 | def __init__(self, **kwargs): 75 | super(Prompt, self).__init__(**kwargs) 76 | self.text = getuser() + "@" + gethostname() 77 | 78 | 79 | class SwitchScreen(BoxLayout): 80 | accordion = ObjectProperty(None) 81 | 82 | def __init__(self, **kwargs): 83 | super(SwitchScreen, self).__init__(**kwargs) 84 | self.accordion.bind(selected=self.viewitem) 85 | self.infos = InfoScreen(DEFAULT_ON_OPEN) 86 | self.add_widget(self.infos) 87 | 88 | def viewitem(self, object, text): 89 | self.remove_widget(self.infos) 90 | self.infos = InfoScreen(text) 91 | self.add_widget(self.infos) 92 | 93 | 94 | class InfoScreen(BoxLayout): 95 | # txts = ObjectProperty(None) 96 | 97 | def __init__(self, value="", **kwargs): 98 | super(InfoScreen, self).__init__(**kwargs) 99 | self.value = value 100 | self.orientation = "vertical" 101 | if not self.value: 102 | return 103 | width = self.width 104 | height = self.height 105 | 106 | self.add_widget(HeadInfo(self.value)) 107 | 108 | global jfile 109 | inst = jfile 110 | 111 | inf = inst.getInfo(self.value) 112 | txts = TextInput(text=inf, background_color=(0.15, 0.15, 0.15, 1), 113 | foreground_color=(1, 1, 1, 1), multiline=True, 114 | readonly=True, size_hint=(1.0, None)) 115 | txts.bind(minimum_height=txts.setter('height')) 116 | txts.text = inf 117 | scroll = ScrollView(size_hint=(1, 1), size=(width, height)) 118 | scroll.add_widget(txts) 119 | self.add_widget(scroll) 120 | 121 | scroll2 = ScrollView(size_hint=(1, 0.2), size=(width, height)) 122 | comments = TextInput(multiline=True, size_hint=(1.0, None), 123 | foreground_color=[0.9, 0.9, 0.9, 1], 124 | background_color=(0.5, 0.5, 0.5, 1)) 125 | comments.bind(minimum_height=comments.setter('height')) 126 | if self.value in state.comments.keys(): 127 | comments.text = state.comments[self.value] 128 | else: 129 | comments.text = DEFAULT_COMMENT 130 | 131 | comments.bind(text=self.on_text) 132 | 133 | scroll2.add_widget(comments) 134 | self.add_widget(scroll2) 135 | 136 | self.add_widget(ButtonBar()) 137 | 138 | def on_text(self, instance, newText): 139 | # remove trailing spaces 140 | newText = newText.rstrip() 141 | whiteSpace = [" ", "\n"] 142 | for char in whiteSpace: 143 | defaultWOSpace = DEFAULT_COMMENT.replace(char, "") 144 | newTextWOSpace = newText.replace(char, "") 145 | if newTextWOSpace in defaultWOSpace or newTextWOSpace == "": 146 | if self.value in state.comments.keys(): 147 | del(state.comments[self.value]) 148 | else: 149 | state.comments[self.value] = newText 150 | 151 | 152 | class HeadInfo(Widget): 153 | header = ObjectProperty(None) 154 | 155 | def __init__(self, value, **kwargs): 156 | super(HeadInfo, self).__init__(**kwargs) 157 | self.header.text = value 158 | self.value = value 159 | if self.value in state.selected: 160 | self.riced.active = True 161 | else: 162 | self.riced.active = False 163 | self.riced.bind(active=self.on_checkbox_active) 164 | 165 | def resetState(self): 166 | if self.value in state.selected: 167 | self.riced.active = True 168 | else: 169 | self.riced.active = False 170 | if self.header.text in self.state.comments.keys(): 171 | self.riced.text = self.state.comments[self.header.text] 172 | 173 | def on_checkbox_active(self, checkbox, value): 174 | if value: 175 | if self.header.text not in state.selected: 176 | state.selected.append(self.header.text) 177 | subButtons[self.header.text].color = [0.306, 0.464, 0.80, 1] 178 | else: 179 | if self.header.text in state.selected: 180 | state.selected.remove(self.header.text) 181 | subButtons[self.header.text].color = [1.0, 1.0, 1.0, 1] 182 | 183 | 184 | class AccordionThing(Accordion): 185 | selected = StringProperty("") 186 | 187 | def __init__(self, **kwargs): 188 | super(AccordionThing, self).__init__(**kwargs) 189 | self.orientation = 'vertical' 190 | self.blades = [] 191 | subButtons = [] 192 | self.draw() 193 | 194 | def switch(self, object): 195 | self.selected = object.text 196 | 197 | def draw(self): 198 | global jfile 199 | inst = jfile 200 | 201 | for cat in inst.listCategories(): 202 | self.blades.append(AccordionItem(title=cat, font_size="20sp")) 203 | box = BoxLayout(orientation='vertical') 204 | subs = inst.listInsideCategories(cat) 205 | 206 | for sub in subs: 207 | butt = Button(text=sub, background_color=[0.35, 0.35, 0.35, 1], 208 | font_size="16sp", size_hint_y=0.1) 209 | butt.bind(on_press=self.switch) 210 | subButtons[sub] = butt 211 | box.add_widget(butt) 212 | 213 | self.blades[-1].add_widget(box) 214 | self.add_widget(self.blades[-1]) 215 | 216 | self.blades[-1].collapse = True 217 | self.blades[0].collapse = False 218 | 219 | 220 | class ButtonBar(BoxLayout): 221 | 222 | def __init__(self, **kwargs): 223 | super(ButtonBar, self).__init__(**kwargs) 224 | self.outputing = False 225 | 226 | def showImport(self): 227 | content = LoadDialog(load=self.load, cancel=self.dismiss_popup) 228 | self._popup = Popup(title="Import config", content=content, 229 | size_hint=(0.9, 0.9)) 230 | self._popup.open() 231 | 232 | def showExport(self): 233 | content = SaveDialog(save=self.save, cancel=self.dismiss_popup) 234 | self._popup = Popup(title="Save", content=content, 235 | size_hint=(0.9, 0.9)) 236 | self._popup.open() 237 | 238 | def save(self, path, filename): 239 | try: 240 | if self.outputing is True: 241 | selected = "" 242 | for choice in self.allChoices: 243 | if choice.state == 'down': 244 | selected = choice.text 245 | break 246 | out.output(selected, state, jfile, 247 | os.path.join(path, filename)) 248 | else: 249 | state.save(os.path.join(path, filename)) 250 | self.dismiss_popup() 251 | except Exception: 252 | self.error("Could not save to file") 253 | 254 | def showHelp(self): 255 | content = BoxLayout(orientation='vertical') 256 | content.add_widget(Label(text=HELP_TEXT)) 257 | closeButton = Button(text='Close', size_hint_y=0.15) 258 | content.add_widget(closeButton) 259 | self._popup = Popup(title='Help', content=content, 260 | size_hint=(0.9, 0.9)) 261 | closeButton.bind(on_press=self._popup.dismiss) 262 | self._popup.open() 263 | 264 | def showUpdate(self): 265 | try: 266 | status = jfile.update() 267 | content = BoxLayout(orientation='vertical') 268 | if status == 0: 269 | content.add_widget(Label(text=UPDATE_SUCC_TEXT)) 270 | elif status == -1: 271 | content.add_widget(Label(text=UPDATE_UNSUCC_TEXT)) 272 | else: 273 | content.add_widget(Label(text=NO_UPDATE_TEXT)) 274 | self._popup = Popup(title='Update', content=content, 275 | size_hint=(0.6, 0.6)) 276 | self._popup.open() 277 | except Exception: 278 | self.error("Could not perform update") 279 | 280 | def showOutput(self): 281 | content = BoxLayout(orientation='vertical') 282 | 283 | box = BoxLayout(orientation='vertical') 284 | availables = out.getAvailable() 285 | first = True 286 | self.allChoices = [] 287 | for available in availables: 288 | checkbox = ToggleButton(text=available, group='output') 289 | self.allChoices.append(checkbox) 290 | if first: 291 | checkbox.state = 'down' 292 | first = False 293 | box.add_widget(checkbox) 294 | content.add_widget(box) 295 | 296 | menu = BoxLayout(orientation="horizontal", size_hint_y=0.2) 297 | cancelButton = Button(text="Cancel") 298 | outputButton = Button(text="Output") 299 | menu.add_widget(outputButton) 300 | menu.add_widget(cancelButton) 301 | content.add_widget(menu) 302 | 303 | self._popup = Popup(title="Output", content=content, 304 | size_hint=(0.9, 0.9)) 305 | cancelButton.bind(on_release=self.cancelOutput) 306 | self.outputing = True 307 | outputButton.bind(on_release=self.saveOutput) 308 | self._popup.open() 309 | 310 | def cancelOutput(self, what): 311 | self.dismiss_popup() 312 | 313 | def saveOutput(self, what): 314 | self.dismiss_popup() 315 | self.outputing = True 316 | self.showExport() 317 | 318 | def load(self, path, filename): 319 | try: 320 | state.load(os.path.join(path, filename[0])) 321 | # reset the buttons 322 | for subButton in subButtons.values(): 323 | subButton.color = [1.0, 1.0, 1.0, 1] 324 | for select in state.selected: 325 | subButtons[select].color = [0.306, 0.464, 0.80, 1] 326 | self.dismiss_popup() 327 | except Exception: 328 | self.error("Could not load config file") 329 | 330 | def error(self, message): 331 | self.dismiss_popup() 332 | content = BoxLayout(orientation='vertical') 333 | content.add_widget(Label(text=message)) 334 | closeButton = Button(text='OK', size_hint_y=0.15) 335 | content.add_widget(closeButton) 336 | self._popup = Popup(title='Error', content=content, 337 | size_hint=(0.5, 0.5)) 338 | closeButton.bind(on_press=self._popup.dismiss) 339 | self._popup.open() 340 | 341 | def dismiss_popup(self): 342 | self.outputing = False 343 | try: 344 | self._popup.dismiss() 345 | except Exception: 346 | return 347 | 348 | 349 | class MainScreen(BoxLayout): 350 | 351 | def __init__(self, **kwargs): 352 | super(MainScreen, self).__init__(**kwargs) 353 | self.orientation = 'vertical' 354 | titleb = TitleBar() 355 | switch = SwitchScreen() 356 | switch.viewitem(object, DEFAULT_ON_OPEN) 357 | self.add_widget(titleb) 358 | self.add_widget(switch) 359 | 360 | 361 | class RiceApp(App): 362 | 363 | def build(self): 364 | self.root = Builder.load_file(resource_filename("ricerous","rice.kv")) 365 | win = MainScreen() 366 | Window.clearcolor = (0.15, 0.15, 0.15, 1) 367 | return win 368 | 369 | 370 | if __name__ == '__main__': 371 | RiceApp().run() 372 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | setup( 5 | name = "ricerous", 6 | version = "0.0.1", 7 | description = ("Portable wiki for ricing"), 8 | packages = ["ricerous", "ricerous.backend", "ricerous.plugins"], 9 | classifiers = [ 10 | "Development Status :: 3 - Alpha", 11 | "Operating System :: POSIX" 12 | ], 13 | package_data = { 14 | "ricerous":[ 15 | "rice.kv", 16 | "plugins/*.py", 17 | "json/*" 18 | ] 19 | }, 20 | scripts = [ 21 | "scripts/ricerous" 22 | ] 23 | ) 24 | --------------------------------------------------------------------------------