From ec0b7920d8ff99ef079fd5fd532d2def38e9d3d2 Mon Sep 17 00:00:00 2001 From: tinfoil-hat Date: Thu, 25 Jan 2024 17:39:22 +0100 Subject: Initial Commit --- .github/blue_dark.jpg | Bin 0 -> 243479 bytes .github/blue_light.jpg | Bin 0 -> 224518 bytes .github/monochrome_dark.jpg | Bin 0 -> 222564 bytes .github/monochrome_light.jpg | Bin 0 -> 221803 bytes LICENSE | 674 ++++++++++++++++++++++++++++++++++++ README.md | 53 +++ abstract.lua | 454 +++++++++++++++++++++++++ colors.lua | 193 +++++++++++ conkyrc | 25 ++ rc/gauge.lua | 792 +++++++++++++++++++++++++++++++++++++++++++ settings.lua | 86 +++++ start.lua | 184 ++++++++++ 12 files changed, 2461 insertions(+) create mode 100644 .github/blue_dark.jpg create mode 100644 .github/blue_light.jpg create mode 100644 .github/monochrome_dark.jpg create mode 100644 .github/monochrome_light.jpg create mode 100644 LICENSE create mode 100644 README.md create mode 100644 abstract.lua create mode 100644 colors.lua create mode 100644 conkyrc create mode 100644 rc/gauge.lua create mode 100644 settings.lua create mode 100644 start.lua diff --git a/.github/blue_dark.jpg b/.github/blue_dark.jpg new file mode 100644 index 0000000..68a8c60 Binary files /dev/null and b/.github/blue_dark.jpg differ diff --git a/.github/blue_light.jpg b/.github/blue_light.jpg new file mode 100644 index 0000000..9a1dee2 Binary files /dev/null and b/.github/blue_light.jpg differ diff --git a/.github/monochrome_dark.jpg b/.github/monochrome_dark.jpg new file mode 100644 index 0000000..1ce12b8 Binary files /dev/null and b/.github/monochrome_dark.jpg differ diff --git a/.github/monochrome_light.jpg b/.github/monochrome_light.jpg new file mode 100644 index 0000000..e4dd5ed Binary files /dev/null and b/.github/monochrome_light.jpg differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ebebd49 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ad78091 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Auzia-conky + +Auzia is a conky theme that displays system resources usage in rings. + +## Screenshots + +### For dark themes + +##### monochrome dark + +![monochrome dark](.github/monochrome_dark.jpg) + +##### blue dark + +![blue dark](.github/blue_dark.jpg) + +*** + +### For light themes + +##### monochrome light + +![monochrome light](.github/monochrome_light.jpg) + + +##### blue light + +![blue light](.github/blue_light.jpg) + + + +More colors schemes are available. Choose a color from the `settings.lua` file and restart conky to take effect. + +*** + +## Download and Launch Auzia + +```sh +git clone https://www.github.com/SZinedine/auzia-conky +cd auzia-conky +conky -c conkyrc +``` + +Edit `settings.lua` to choose your network interface, Internet speed and other settings. + +*** + +## Dependencies + +- Conky 1.10+ +- cairo +- imlib2 + diff --git a/abstract.lua b/abstract.lua new file mode 100644 index 0000000..7a38bb3 --- /dev/null +++ b/abstract.lua @@ -0,0 +1,454 @@ +---------------------------------- +-- Author: Zineddine SAIBI +-- Software: Namoudaj Conky +-- Type: Template for Conky +-- Version: 0.4 +-- License: GPL-3.0 +-- Repository: https://www.github.com/SZinedine/namoudaj-conky +---------------------------------- + +require("cairo") +require("imlib2") +require("settings") + +function image(x, y, file) + if file == nil then return end + + local show = imlib_load_image(file) + if show == nil then return end + + imlib_context_set_image(show) + imlib_render_image_on_drawable(x, y) + imlib_free_image() + show = nil +end + + +function line(startx, starty, endx, endy, thick, color, alpha) + cairo_set_line_width (cr, thick) + cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT) + cairo_set_source_rgba (cr, color_convert(color, alpha)) + cairo_move_to (cr, startx, starty) + cairo_line_to (cr, endx, endy) + cairo_stroke (cr) +end + + +function ring_clockwise(x, y, radius, thickness, angle_begin, angle_end, value_str, max_value, fg_color) + local value = tonumber(value_str) + if value > max_value then value = max_value end + + angle_begin = angle_begin * (2 * math.pi / 360) - (math.pi / 2) + angle_end = angle_end * (2 * math.pi / 360) - (math.pi / 2) + local progress = (value / max_value) * (angle_end - angle_begin) + + cairo_set_line_width (cr, thickness) + cairo_set_source_rgba (cr, color_convert(colors.bg, colors.bg_alpha)) + cairo_arc (cr, x, y, radius, angle_begin, angle_end) + cairo_stroke (cr) + + cairo_set_line_width (cr, thickness) + cairo_set_source_rgba (cr, color_convert(fg_color, colors.fg_alpha)) + cairo_arc(cr, x, y, radius, angle_begin, angle_begin + progress) + cairo_stroke (cr) +end + + +function ring_anticlockwise(x, y, radius, thickness, angle_begin, angle_end, value_str, max_value, fg_color) + local value = tonumber(value_str) + if value > max_value then value = max_value end + + angle_begin = angle_begin * (2 * math.pi / 360) - (math.pi / 2) + angle_end = angle_end * (2 * math.pi / 360) - (math.pi / 2) + local progress = (value / max_value) * (angle_end - angle_begin) + + cairo_set_line_width (cr, thickness) + cairo_set_source_rgba (cr, color_convert(colors.bg, colors.bg_alpha)) + cairo_arc_negative (cr, x, y, radius, angle_begin, angle_end) + cairo_stroke (cr) + + cairo_set_line_width (cr, thickness) + cairo_set_source_rgba (cr, color_convert(fg_color, colors.fg_alpha)) + cairo_arc_negative (cr, x, y, radius, angle_begin, angle_begin + progress) + cairo_stroke (cr) +end + + +function rectangle_leftright(x, y, len, thick, value_str, max_value, color) + local value = tonumber(value_str) + if value > max_value then value = max_value end + + cairo_set_source_rgba(cr, color_convert(colors.bg, colors.bg_alpha)) + cairo_rectangle(cr, x, y, len, thick) + cairo_fill(cr) + + local progress = (len / max_value) * value + cairo_set_source_rgba(cr, color_convert(color, colors.fg_alpha)) + cairo_rectangle(cr, x, y, progress, thick) + cairo_fill(cr) +end + + +function rectangle_rightleft(x, y, len, thick, value_str, max_value, color) + rectangle_leftright(x, y, -len, thick, value_str, max_value, color) +end + + +function rectangle_bottomup(x, y, len, thick, value_str, max_value, color) + local value = tonumber(value_str) + if value > max_value then value = max_value end + + cairo_set_source_rgba(cr, color_convert(colors.bg, colors.bg_alpha)) + cairo_rectangle(cr, x, y, thick, -len) + cairo_fill(cr) + cairo_set_source_rgba(cr, color_convert(color, colors.fg_alpha)) + + local progress = (len / max_value) * value + cairo_rectangle(cr, x, y, thick, -progress) + cairo_fill(cr) +end + + +function rectangle_upbottom(x, y, len, thick, value_str, max_value, color) + rectangle_bottomup(x, y, -len, thick, value_str, max_value, color) +end + + +function write(x, y, text, font_size, color) + _write_(x, y, text, main_font, font_size, color, 1, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL) +end + + +function write_bold(x, y, text, font_size, color) + -- convinience function to write in bold font + _write_(x, y, text, main_font, font_size, color, 1, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD) +end + + +function _write_(x, y, text, font_name, font_size, color, alpha, font_slant, font_face) + cairo_select_font_face (cr, font_name, font_slant, font_face); + cairo_set_font_size (cr, font_size) + cairo_set_source_rgba (cr, color_convert(color, alpha)) + cairo_move_to (cr, x, y) + cairo_show_text (cr, text) + cairo_stroke (cr) +end + + +-- return a process according to its CPU consumption +function getProcessN(n) + local name = parse("top name " .. n) + local value = parse("top cpu " .. n) + return name .. value .. "%" +end + + +-- return a process according to its memory consumption +function getMemoryN(n) + local name = parse("top_mem name " .. n) + local value = parse("top_mem mem_res " .. n) + return name .. value +end + + +function write_list_proccesses_cpu(x, y, interval, nb_todisplay, font_size, color) + local array = {} + for i = 1, nb_todisplay do + table.insert(array, getProcessN(i)) + end + write_line_by_line(x, y, interval, array, color, font_size, false) +end + + +-- convenience function to write a list of running processes +function write_list_proccesses_mem(x, y, interval, nb_todisplay, font_size, color) + local array = {} + for i = 1, nb_todisplay do + table.insert(array, getMemoryN(i)) + end + write_line_by_line(x, y, interval, array, color, font_size, false) +end + + +-- write text in multiple lines. +-- the text is contained in `content_array` where each entry is a line separated with `interval` +function write_line_by_line(x, y, interval, content_array, color, font_size, bold) + if bold == nil then bold = false end + local yy = y + for i in pairs(content_array) do + if bold then write_bold(x, yy, content_array[i], font_size, color) + else write(x, yy, content_array[i], font_size, color) + end + yy = yy + interval + end +end + + +-- convinience function +function parse(str) + return conky_parse(string.format("${%s}", str)) +end + + +-- return a color according to the provided value (threshold) +-- the colors are defined in "settings.lua" +function color_frompercent(percent) + local perc = tonumber(percent) + if perc > threshold_critical then return colors.critic + elseif perc > threshold_warning then return colors.warn + else return colors.fg + end +end + + +-- used for battery rate or other decreasing values +-- for example, change the color when the battery is low +function color_frompercent_reverse(percent) + local perc = tonumber(percent) + if perc < battery_threshold_critical then return colors.critic + elseif perc < battery_threshold_warning then return colors.warn + else return colors.fg + end +end + + +function color_convert(colour, alpha) + -- input hexadecimal color code, returns its corresponding RGB+Alpha representation + return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha +end + + +-- Variable definitions to avoir repeating the same string concatenations +local _download_speed = "downspeed " .. net_interface +local _download_speed_kb = "downspeedf " .. net_interface +local _download_total = "totaldown " .. net_interface +local _upload_speed = "upspeed " .. net_interface +local _upload_speed_kb = "upspeedf " .. net_interface +local _upload_total = "totalup " .. net_interface +local _ssid = "wireless_essid " .. net_interface +local _wifi_signal = "wireless_link_qual_perc " .. net_interface +local _local_ip = "addr " .. net_interface + +-- functions to fetch some important system info +-- for other variables, see: +function updates() return parse("updates") end +function kernel() return parse("kernel") end -- ex: 5.10.32-1-lts +function system_name() return parse("sysname") end -- ex: Linux +function arch() return parse("machine") end -- ex: x86_64 +function desktops() return parse("desktop_number") end -- total number of desktops +function desktop() return parse("desktop") end -- ex: 3 (current desktop) +function desktop_name() return parse("desktop_name") end -- ex: Desktop 3 +function username() return parse("user_names") end +function running_threads() return parse("running_threads") end +function memory() return parse("mem") end +function memory_percent() return parse("memperc") end +function memory_max() return parse("memmax") end +function memory_cached() return parse("cached") end +function memory_buffers() return parse("buffers") end +function swap() return parse("swap") end +function swap_max() return parse("swapmax") end +function swap_percent() return parse("swapperc") end +function download_speed() return parse(_download_speed) end -- ex: 930B or 3kb +function download_speed_kb() return parse(_download_speed_kb) end -- ex: 0.9 or 3.0 +function download_total() return parse(_download_total) end +function upload_speed() return parse(_upload_speed) end -- ex: 930B or 3kb +function upload_speed_kb() return parse(_upload_speed_kb) end -- ex: 0.9 or 3.0 +function upload_total() return parse(_upload_total) end +function ssid() return parse(_ssid) end +function wifi_signal() return parse(_wifi_signal) end -- value in % +function local_ip() return parse(_local_ip) end +function uptime() return parse("uptime") end -- ex: 2d 13h 40m +function uptime_short() return parse("uptime_short") end -- ex: 2d 13h +function time_hrmin() return parse("time %R") end -- ex: 15:40 +function time_hrminsec() return parse("time %T") end -- ex: 15:30:25 +function time_hr12minsec() return parse("time %R") end -- ex: 03:30:25 PM +function time_hour24() return parse("time %H") end -- ex: 15 +function time_hour12() return parse("time %I") end -- ex: 3 +function time_minute() return parse("time %M") end -- ex: 30 +function time_second() return parse("time %S") end -- ex: 25 +function time_am_pm_upper() return parse("time %p") end -- ex: PM +function time_am_pm_lower() return parse("time %P") end -- ex: pm +function time_day() return parse("time %A") end -- ex: saturday +function time_day_short() return parse("time %a") end -- ex: sat +function time_day_number() return parse("time %d") end -- ex: 1 +function time_month() return parse("time %H") end -- ex: january +function time_month_short() return parse("time %h") end -- ex: jan +function time_month_number() return parse("time %m") end -- ex: 1 +function time_year() return parse("time %Y") end -- ex: 2021 +function time_year_short() return parse("time %y") end -- ex: 21 +function utime() return parse("utime") end -- UCT time -- ex: 2021-05-29 17:31:01 +function diskio(device) return parse("diskio " .. device) end -- device ex: /dev/sda +function diskio_read(device) return parse("diskio_read " .. device) end +function diskio_write(device) return parse("diskio_write " .. device) end +function cpu_temperature() return parse("acpitemp") end -- temperature in C° +function cpu_temperature_sensors() -- this function uses the command 'sensors' to obtain the cpu temperature + local file = io.popen("sensors | awk '/CPU: / {printf substr($2,2,2)}' 2> /dev/null") + if not file then + io.stderr:write("Error while executing a command containing 'sensors' and 'awk'. Defaulting to cpu_temperature()\n") + return cpu_temperature() + end + + local result = file:read("*a") + file:close() + + if tonumber(result) == nil then + io.stderr:write("Error. Invalid result from 'sensors'. Defaulting to cpu_temperature()\n") + return cpu_temperature() + end + + return result +end +function cpu_percent(n) + if n == nil or n == 0 or n == "" then return parse("cpu") end + if n > 0 and n <= 32 then return parse("cpu cpu" .. n) + else return nil end +end +function fs_used(fs) + if fs == nil then return nil + else return parse("fs_used " .. fs) + end +end +function fs_used_perc(fs) + if fs == nil then return nil + else return parse("fs_used_perc " .. fs) + end +end +function fs_size(fs) + if fs == nil then return nil + else return parse("fs_size " .. fs) + end +end +function fs_free_perc(fs) + if fs == nil then return nil + else return parse("fs_free_perc " .. fs) + end +end +function fs_free(fs) + if fs == nil then return nil + else return parse("fs_free " .. fs) + end +end + + +public_ip = nil -- variable that will hold the IP adress +function get_public_ip() return public_ip end +function set_public_ip(ip) + if not ip then public_ip = "No Address" + else public_ip = tostring(ip) + end +end + +--[[ + Don't call this function every seconde because it is slow and public IP doesn't change much anyway. + Warning: if your internet connection is disfunctioning, this function may prevent the whole conky from launching +]] +function update_public_ip() + if not use_public_ip then + print("Warning: Turn on the variable use_public_ip (set it to true) in settings.lua before calling the function update_public_ip()") + public_ip = nil + end + + -- fetch IP from the internet. other websites: "ifconfig.me/ip", "ident.me", "api.ipify.org" + local file = io.popen("curl -s http://ipinfo.io/ip") + if not file then + set_public_ip(nil) + return nil + end + + local output = file:read("*a") + file:close() + if output == nil or output == "" or string.len(output) > 15 then + set_public_ip(nil) + return nil + end + + set_public_ip(output) + return output +end + + +--[[ + The following will define multiple variables and functions according to the machine where it is ran + the default value is a nil, so it is necessary to check in case you want to use the second battery. +]] +has_battery = nil -- boolean +has_second_battery = nil -- boolean +battery1_percent = nil -- function for the first battery. nil if it doesn't exist +battery2_percent = nil -- function for the second battery if it exists. nil if it doesn't +battery_percent = nil -- function that returns the value of the battery. adapts to single or double batteries. nil if no battery +battery1_index = nil -- index of the first battery. nil if there is no battery. This is the number that follows 'BAT' ex: 'BAT0' +battery2_index = nil -- index of the second battery. nil if there is no battery or no second battery +discharging_battery = function() return false end -- check if the battery is discharging or not +initialized_battery = false -- check if the function `init_battery()` has already been called +local called_init_battery_once = false -- sometimes, conky doesn't detect the battery the first time we require it. + +--[[ + check if there is a battery or multiple batteries + define the functions that return battery values + define discharging_battery() according to the number of batteries + NOTE: before calling this function, first check if the variable `initialized_battery` is false. +]] +function init_battery() + if not called_init_battery_once then + called_init_battery_once = true + else + initialized_battery = true + end + + local bat_indexes = {} + local size = 0 -- how many batteries found + + -- determine how many batteries by calling them (even if it will print out error messages) + local bt0 = parse("battery_percent BAT0") + local bt1 = parse("battery_percent BAT1") + local bt2 = parse("battery_percent BAT2") + + if bt0 ~= nil and bt0 ~= "0" then + table.insert(bat_indexes, 0) + size = size + 1 + end + if bt1 ~= nil and bt1 ~= "0" then + table.insert(bat_indexes, 1) + size = size + 1 + end + if bt2 ~= nil and bt2 ~= "0" then + table.insert(bat_indexes, 2) + size = size + 1 + end + + if size == 0 then + has_battery = false + has_second_battery = false + elseif size >= 1 then + has_battery = true + battery1_index = bat_indexes[1] + battery1_percent = function () return parse("battery_percent BAT" .. bat_indexes[1]) end + + if size == 1 then + battery_percent = function() return tonumber(battery1_percent()) end + discharging_battery = function() return string.match(parse("battery BAT" .. battery1_index), "discharging") end + end + + if size >= 2 then + has_second_battery = true + battery2_index = bat_indexes[2] + + battery2_percent = function() + return parse("battery_percent BAT" .. bat_indexes[2]) + end + + battery_percent = function() + local b0 = tonumber(battery1_percent()) + local b1 = tonumber(battery2_percent()) + return math.floor((b0 + b1)/2) + end + + discharging_battery = function() + if string.match(parse("battery BAT" .. battery1_index), "discharging") then return true end + if string.match(parse("battery BAT" .. battery2_index), "discharging") then return true end + return false + end + end + end +end + diff --git a/colors.lua b/colors.lua new file mode 100644 index 0000000..846129c --- /dev/null +++ b/colors.lua @@ -0,0 +1,193 @@ +local dark_text_color = 0xD1CDD5 +local light_text_color = 0x1D1D1D + +local dark_or_light = "dark" -- dark / light + +function build_color(bg, fg, text, warn, critic, bg_alpha, fg_alpha) + return { + bg = bg, + fg = fg, + text = text, + warn = warn or 0xFF9000, + critic = critic or 0xFF0000, + bg_alpha = bg_alpha or 0.2, + fg_alpha = fg_alpha or 0.8, + } +end + +C = { + blue = { + dark = build_color(0xA6A6A6, 0x5594FF, dark_text_color), + light = build_color(0x252525, 0x151515, light_text_color), + }, + deepblue = { + dark = build_color(0xA6A6A6, 0x0000a8, 0x55ffff, nil, nil, 0.1), + light = build_color(0x180047, 0x00008B, 0x180047, nil, nil, 0.1), + }, + green = { + dark = build_color(0xA6A6A6, 0x00ff00, dark_text_color), + light = build_color(0x252525, 0x00ff00, light_text_color), + }, + emerald = { + dark = build_color(0xD3FACD, 0x539950, 0xD3FACD, nil, nil, 0.1), + light = build_color(0x8bff85, 0x3f753d, 0x1a3019, nil, nil, 0.1), + }, + yellow = { + dark = build_color(0xA6A6A6, 0xfafa37, dark_text_color), + light = build_color(0x252525, 0xfdff00, light_text_color), + }, + purple = { + dark = build_color(0xA6A6A6, 0xbc00bc, dark_text_color), + light = build_color(0x252525, 0x800080, light_text_color), + }, + violet = { + dark = build_color(0xA6A6A6, 0x7028E5, dark_text_color), + light = build_color(0x252525, 0x5329AE, light_text_color), + }, + crimson = { + dark = build_color(0xA6A6A6, 0xdc143c, dark_text_color), + light = build_color(0x252525, 0xd11339, light_text_color), + }, + orange = { + dark = build_color(0xA6A6A6, 0xffa500, dark_text_color, 0xff4f00), + light = build_color(0x252525, 0xffa500, light_text_color, 0xff4f00), + }, + maroon = { + dark = build_color(0xA6A6A6, 0xae0000, dark_text_color), + light = build_color(0x252525, 0x940000, light_text_color), + }, + pink = { + dark = build_color(0xffccdd, 0xff3377, 0xffccdd), + light = build_color(0xffccdd, 0xff3377, 0xff0055), + }, + cyan = { + dark = build_color(0xA6A6A6, 0x48FFE7, dark_text_color), + light = build_color(0x252525, 0x00C9AF, light_text_color), + }, + aquamarine = { + dark = build_color(0xA6A6A6, 0x76EDC3, dark_text_color), + light = build_color(0x252525, 0x64C8A5, light_text_color), + }, + monochrome = { + dark = build_color(0x484848, 0xDEDEDE, 0xDEDEDE, 0xFF0000, 0xDEDEDE), + light = build_color(0x252525, 0x151515, 0x151515, 0xFF0000, 0x1D1D1D) + }, + gruvbox = { + dark = build_color(0x282828, 0xEBDBB2, 0xFBF1C7, 0xFE8019, 0xCC241D), + light = build_color(0xFBF1C7, 0x3C3836, 0x282828, 0xD65D0E, 0xCC241D), + }, + contrast = { + dark = build_color(0x000000, 0xffffff, 0xffffff, 0xf36910, 0xFF0000, 0.5, 1), + light = build_color(0xffffff, 0x000000, 0x000000, 0xf36910, 0xFF0000, 0.3, 1) + }, +} + + + +function choose_random_theme() + dark_themes = dark_themes or {} + light_themes = dark_themes or {} + + if #dark_themes == 0 and #light_themes == 0 then + for _, v in pairs(C) do + for kk, vv in pairs(v) do + if kk == "dark" then + dark_themes[#dark_themes + 1] = vv + elseif kk == "light" then + light_themes[#dark_themes + 1] = vv + end + end + end + end + + if dark_or_light == "dark" then + return dark_themes[math.random(#dark_themes)] + end + + return light_themes[math.random(#light_themes)] +end + + +function get_color_table(theme) + if type(theme) ~= "string" then + io.stderr:write("No theme provided. Defaulting to blue dark") + return C.blue.dark + end + + theme = string.lower(theme) + + if string.find(theme, "light") then + dark_or_light = "light" + else + dark_or_light = "dark" + end + + if theme == "monochrome dark" then + return C.monochrome.dark + elseif theme == "monochrome light" then + return C.monochrome.light + elseif theme == "blue dark" then + return C.blue.dark + elseif theme == "blue light" then + return C.blue.light + elseif theme == "deepblue dark" then + return C.deepblue.dark + elseif theme == "deepblue light" then + return C.deepblue.light + elseif theme == "green dark" then + return C.green.dark + elseif theme == "green light" then + return C.green.light + elseif theme == "emerald dark" then + return C.emerald.dark + elseif theme == "emerald light" then + return C.emerald.light + elseif theme == "yellow dark" then + return C.yellow.dark + elseif theme == "yellow light" then + return C.yellow.light + elseif theme == "purple dark" then + return C.purple.dark + elseif theme == "purple light" then + return C.purple.light + elseif theme == "violet dark" then + return C.violet.dark + elseif theme == "violet light" then + return C.violet.light + elseif theme == "crimson dark" then + return C.crimson.dark + elseif theme == "crimson light" then + return C.crimson.light + elseif theme == "orange dark" then + return C.orange.dark + elseif theme == "orange light" then + return C.orange.light + elseif theme == "maroon dark" then + return C.maroon.dark + elseif theme == "maroon light" then + return C.maroon.light + elseif theme == "pink dark" then + return C.pink.dark + elseif theme == "pink light" then + return C.pink.light + elseif theme == "cyan dark" then + return C.cyan.dark + elseif theme == "cyan light" then + return C.cyan.light + elseif theme == "aquamarine dark" then + return C.aquamarine.dark + elseif theme == "aquamarine light" then + return C.aquamarine.light + elseif theme == "gruvbox dark" then + return C.gruvbox.dark + elseif theme == "gruvbox light" then + return C.gruvbox.light + elseif theme == "contrast dark" then + return C.contrast.dark + elseif theme == "contrast light" then + return C.contrast.light + else + io.stderr:write("ERROR. the provided theme does not exist. Defaulting to 'blue dark") + return C.blue.dark + end +end diff --git a/conkyrc b/conkyrc new file mode 100644 index 0000000..d4191d2 --- /dev/null +++ b/conkyrc @@ -0,0 +1,25 @@ +conky.config = { + minimum_height = 720, + minimum_width = 1240, + gap_y = 40, + gap_x = 2, + alignment = 'middle_middle', + lua_load = "settings.lua start.lua", + lua_draw_hook_pre = "main", + text_buffer_size = 2048, + double_buffer = true, + background = true, + update_interval = 1, + own_window = true, + own_window_class = 'Conky', + own_window_type = 'normal', + own_window_transparent = true, + own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', + own_window_argb_visual = true, + own_window_argb_value = 0, + use_xft = true, + override_utf8_locale = true, +} + +conky.text = [[]] + diff --git a/rc/gauge.lua b/rc/gauge.lua new file mode 100644 index 0000000..347ad78 --- /dev/null +++ b/rc/gauge.lua @@ -0,0 +1,792 @@ + +local S = { + mem = { + x = 1020, + y = 200, + radius = 160, + text = { + indicators = { x = 950, y = 40 }, + process_title = { x = 930, y = 150 }, + processes = { x = 945, y = 170 }, + ring_title = { x = 990, y = 320 }, + } + }, + + + battery = { + x = 610, + y = -900, + radius = 1600, + width = 3, + begin = -160, + end_ = -200, + text = { + perc = { x = 1160, y = 608 }, + title = { x = 570, y = 720 }, + }, + }, + + + clock = { + x = 600, + y = 300, + width = 10, + radius = 140, + font_height = 110, + font_m = 84, + hr = { x = 510, y = 290 }, + mn = { x = 590, y = 380 }, + dt = { x = 550, y = 310 }, + ut = { x = 550, y = 410 }, + }, + + + disk = { + x = 840, + y = 500, + radius = 120, + thickness = 18, + begin_angle = 20, + end_angle = -260, + text = { + + } + }, + + net = { + x = 360, + y = 500, + width = 10, + radius = 120, + begin_angle = 0, + end_angle = 320, + indicators = { + down = {x = 295, y = 385}, + up = {x = 295, y = 405}, + }, + total = { + down = {x = 360, y = 510}, + up = {x = 360, y = 490}, + }, + list = {x = 10, y = 440}, + }, + + + cpu = { + x = 200, + y = 200, + begin_angle = 0, + end_angle = -260, + + cores = { + _0cores = { -- display only total cpu usage + total = { + number = 0, + radius = 130, + thickness = 35, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 75, + post_particle = "%" + } + }, + temperature = { + number = -1, + radius = 163, + thickness = 10, + max_value = 95, + begin_angle = 45, + end_angle = -300, + text = { + x = 315, + y = 110, + post_particle = "°C" + } + }, + + }, + + _2cores = { + core1 = { + number = 1, + radius = 123, + thickness = 24, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 80, + post_particle = "%" + } + }, + core2 = { + number = 2, + radius = 150, + thickness = 26, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 55, + post_particle = "%" + } + }, + total = { + number = 0, + radius = 171, + thickness = 10, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + temperature = { + number = -1, + radius = 183, + thickness = 3, + max_value = 95, + begin_angle = 45, + end_angle = -300, + text = { + x = 330, + y = 90, + post_particle = "°C" + } + }, + + }, + + _4cores = { + core1 = { + number = 1, + radius = 103, + thickness = 15, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 100, + post_particle = "%" + } + }, + core2 = { + number = 2, + radius = 120, + thickness = 16, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 85, + post_particle = "%" + } + }, + core3 = { + number = 3, + radius = 139, + thickness = 18, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 68, + post_particle = "%" + } + }, + core4 = { + number = 4, + radius = 160, + thickness = 20, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 45, + post_particle = "%" + } + }, + total = { + number = 0, + radius = 175, + thickness = 5, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + temperature = { + number = -1, + radius = 183, + thickness = 3, + max_value = 95, + begin_angle = 45, + end_angle = -300, + text = { + x = 330, + y = 90, + post_particle = "°C" + } + }, + }, + + _6cores = { + core1 = { + number = 1, + radius = 94, + thickness = 12, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 110, + post_particle = "%" + } + }, + core2 = { + number = 2, + radius = 107, + thickness = 12, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 95, + post_particle = "%" + } + }, + core3 = { + number = 3, + radius = 121, + thickness = 14, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 80, + post_particle = "%" + } + }, + core4 = { + number = 4, + radius = 137, + thickness = 15, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 63, + post_particle = "%" + } + }, + core5 = { + number = 5, + radius = 154, + thickness = 16, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 45, + post_particle = "%" + } + }, + core6 = { + number = 6, + radius = 172, + thickness = 17, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 27, + post_particle = "%" + } + }, + total = { + number = 0, + radius = 184, + thickness = 4, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + temperature = { + number = -1, + radius = 190, + thickness = 3, + max_value = 95, + begin_angle = 45, + end_angle = -300, + text = { + x = 337, + y = 89, + post_particle = "°C" + } + }, + }, + + _8cores = { + core1 = { + number = 1, + radius = 88, + thickness = 9, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 119, + post_particle = "%" + } + }, + core2 = { + number = 2, + radius = 99, + thickness = 9, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 106, + post_particle = "%" + } + }, + core3 = { + number = 3, + radius = 109, + thickness = 9, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 94, + post_particle = "%" + } + }, + core4 = { + number = 4, + radius = 120, + thickness = 10, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 82, + post_particle = "%" + } + }, + core5 = { + number = 5, + radius = 132, + thickness = 11, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 70, + post_particle = "%" + } + }, + core6 = { + number = 6, + radius = 145, + thickness = 12, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 56, + post_particle = "%" + } + }, + core7 = { + number = 7, + radius = 159, + thickness = 13, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 40, + post_particle = "%" + } + }, + core8 = { + number = 8, + radius = 174, + thickness = 14, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 27, + post_particle = "%" + } + }, + total = { + number = 0, + radius = 184, + thickness = 4, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + temperature = { + number = -1, + radius = 190, + thickness = 3, + max_value = 95, + begin_angle = 45, + end_angle = -300, + text = { + x = 337, + y = 89, + post_particle = "°C" + } + }, + }, + + _10cores = { + core1 = { + number = 1, + radius = 81, + thickness = 6, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 125, + post_particle = "%" + } + }, + core2 = { + number = 2, + radius = 88, + thickness = 6, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + core3 = { + number = 3, + radius = 96, + thickness = 7, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 110, + post_particle = "%" + } + }, + core4 = { + number = 4, + radius = 105, + thickness = 8, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 95, + post_particle = "%" + } + }, + core5 = { + number = 5, + radius = 115, + thickness = 9, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + core6 = { + number = 6, + radius = 126, + thickness = 10, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 80, + post_particle = "%" + } + }, + core7 = { + number = 7, + radius = 138, + thickness = 11, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 66, + post_particle = "%" + } + }, + core8 = { + number = 8, + radius = 151, + thickness = 12, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 52, + post_particle = "%" + } + }, + core9 = { + number = 9, + radius = 165, + thickness = 13, + max_value = 98, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 39, + post_particle = "%" + } + }, + core10 = { + number = 10, + radius = 180, + thickness = 14, + max_value = 98, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 23, + post_particle = "%" + } + }, + total = { + number = 0, + radius = 192, + thickness = 5, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + temperature = { + number = -1, + radius = 199, + thickness = 3, + max_value = 95, + begin_angle = 45, + end_angle = -300, + text = { + x = 345, + y = 85, + post_particle = "°C" + } + }, + }, + + _12cores = { + core1 = { + number = 1, + radius = 82, + thickness = 5, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 125, + post_particle = "%" + } + }, + core2 = { + number = 2, + radius = 88, + thickness = 5, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + core3 = { + number = 3, + radius = 94, + thickness = 6, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 110, + post_particle = "%" + } + }, + core4 = { + number = 4, + radius = 102, + thickness = 8, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + core5 = { + number = 5, + radius = 111, + thickness = 8, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 95, + post_particle = "%" + } + }, + core6 = { + number = 6, + radius = 120, + thickness = 9, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + core7 = { + number = 7, + radius = 130, + thickness = 9, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 80, + post_particle = "%" + } + }, + core8 = { + number = 8, + radius = 141, + thickness = 10, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 65, + post_particle = "%" + } + }, + core9 = { + number = 9, + radius = 152, + thickness = 10, + max_value = 98, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 52, + post_particle = "%" + } + }, + core10 = { + number = 10, + radius = 163, + thickness = 10, + max_value = 98, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 40, + post_particle = "%" + } + }, + core11 = { + number = 11, + radius = 174, + thickness = 10, + max_value = 98, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 28, + post_particle = "%" + } + }, + core12 = { + number = 12, + radius = 186, + thickness = 11, + max_value = 98, + begin_angle = 0, + end_angle = -260, + text = { + x = 205, + y = 17, + post_particle = "%" + } + }, + total = { + number = 0, + radius = 195, + thickness = 2, + max_value = 100, + begin_angle = 0, + end_angle = -260, + text = nil + }, + temperature = { + number = -1, + radius = 199, + thickness = 2, + max_value = 95, + begin_angle = 45, + end_angle = -300, + text = { + x = 345, + y = 85, + post_particle = "°C" + } + }, + }, + } + } +} + +return S diff --git a/settings.lua b/settings.lua new file mode 100644 index 0000000..b0f84ed --- /dev/null +++ b/settings.lua @@ -0,0 +1,86 @@ +require("colors") + +--[[ +possible values of THEME + blue dark blue light + deepblue dark deepblue light + green dark green light + emerald dark emerald light + yellow dark yellow light + purple dark purple light + violet dark violet light + crimson dark crimson light + maroon dark maroon light + pink dark pink light + cyan dark cyan light + aquamarine dark aquamarine light + monochrome dark monochrome light + gruvbox dark gruvbox light + contrast dark contrast light +]] +THEME = "monochrome dark" -- choose one of the above + +--[[ +waiting time before starting conky +this prevents issues when conky is launched at startup +]] +startup_delay = 5 -- secondes + +--[[ +change colors when a value exceeds defined thresholds +]] +change_color_on_threshold = true + +--[[ +CPU Cores (threads really) +valid values are: 0, 2, 4, 6, 8, 10, 12 +]] +cpu_cores = 16 + +--[[ +EDIT THIS to match your network interface. +You can find out by executing `ifconfig` or `ip link`. +It might be "wlan0", "eth0", "wlp3s0" or something else +]] +net_interface = "enp6s0" + +--[[ +this depends on your own internet speed +]] +download_rate_maximum = 1000 -- kb +upload_rate_maximum = 1000 -- kb + +--[[ +Default font used by the convinient functions like write() and write_bold() +You can use _write() to choose another font +]] +main_font = "Mono" + +--[[ +the public ip is fetched from the internet. +There is no need to refresh it every second like the other values +advice: use the variable public_ip instead of the function public_ip() +which is called every `public_ip_refresh_rate` secondes + +WARNING: this feature exploits third party services, +therefore we cannot garantee your privacy if you turn it on +]] +use_public_ip = false +public_ip_refresh_rate = 60 -- secondes + +---------------------------------------------- + +colors = get_color_table(THEME) + +if change_color_on_threshold == false then + colors.warn = colors.fg + colors.critic = colors.fg +end + +-- threshold variables are used to change the colors of the indicators +-- by using the functions color_frompercent(perc) and color_frompercent_reverse(perc) +threshold_warning = 60 +threshold_critical = 80 +battery_threshold_warning = 30 +battery_threshold_critical = 18 + diff --git a/start.lua b/start.lua new file mode 100644 index 0000000..c7a1e3e --- /dev/null +++ b/start.lua @@ -0,0 +1,184 @@ +---------------------------------- +-- Author: Zineddine SAIBI +-- Software: Auzia Conky +-- Type: Conky Theme +-- Version: 0.4 +-- License: GPL-3.0 +-- repository: https://www.github.com/SZinedine/auzia-conky +---------------------------------- +require("abstract") + +local S = require("rc/gauge") +local to_draw_titles = true + +-- set the appropriate cpu object according to the chosen value for `cpu_cores` +local ncores = nil +if cpu_cores == 0 then ncores = S.cpu.cores._0cores +elseif cpu_cores == 2 then ncores = S.cpu.cores._2cores +elseif cpu_cores == 4 then ncores = S.cpu.cores._4cores +elseif cpu_cores == 6 then ncores = S.cpu.cores._6cores +elseif cpu_cores == 8 then ncores = S.cpu.cores._8cores +elseif cpu_cores == 10 then ncores = S.cpu.cores._10cores +elseif cpu_cores == 12 then ncores = S.cpu.cores._12cores +else + print("ERROR. the provided value of cpu_cores is not valid. Defaulting to 4 cores") + ncores = S.cpu.cores._4cores +end + +function start() + draw_cpu() + draw_memory() + draw_clock() + draw_disks() + draw_battery() + draw_titles() + draw_net() +end + + +function draw_single_cpu_core(coreN) + local val = nil + if coreN.number >= 0 then val = cpu_percent(coreN.number) + else val = cpu_temperature_sensors() -- shoul + end + + ring_anticlockwise(S.cpu.x, S.cpu.y, coreN.radius, coreN.thickness, coreN.begin_angle, coreN.end_angle, val, coreN.max_value, color_frompercent(tonumber(val))) + + if coreN.text ~= nil then + write(coreN.text.x, coreN.text.y, val .. coreN.text.post_particle, 12, colors.text) + end +end + + +function draw_cpu() + for i in pairs(ncores) do + draw_single_cpu_core(ncores[i]) + end + + write_list_proccesses_cpu(160, 147, 20, 4, 12, colors.text) +end + + +function draw_memory() + local memperc = memory_percent() + local swpperc = swap_percent() + local usedmem = string.format("Usage: %s / %s (%s%s)", memory(), memory_max(), memperc, "%") + + ring_clockwise(S.mem.x, S.mem.y, S.mem.radius, 18, 0, 320, memperc, 100, color_frompercent(tonumber(memperc))) + ring_clockwise(S.mem.x, S.mem.y, S.mem.radius-18, 14, 0, 320, swpperc, 100, color_frompercent(tonumber(swpperc))) + write(S.mem.text.indicators.x, S.mem.text.indicators.y, "ram: " ..memperc .. "%", 12, colors.text) + write(S.mem.text.indicators.x, S.mem.text.indicators.y+22, "swap: " ..swpperc .. "%", 12, colors.text) + + write(S.mem.text.process_title.x, S.mem.text.process_title.y, usedmem, 12, colors.text) + write_list_proccesses_mem(S.mem.text.processes.x, S.mem.text.processes.y, 20, 5, 12, colors.text) +end + + +function draw_clock() + local s = time_second() + local m = time_minute() + local h = time_hour24() + local date = string.format("%s, %s %s, %s", time_day_short(), time_month_short(), time_day_number(), time_year()) + + ring_clockwise(S.clock.x, S.clock.y, S.clock.radius, S.clock.width/4, 60, 420, s, 59, colors.fg) + ring_clockwise(S.clock.x, S.clock.y, S.clock.radius+7, S.clock.width/2, -60, 300, m, 59, colors.fg) + ring_clockwise(S.clock.x, S.clock.y, S.clock.radius+18, S.clock.width, 0, 360, h, 23, colors.fg) + + write_bold(S.clock.hr.x, S.clock.hr.y, h, S.clock.font_height, colors.text) + write(S.clock.mn.x, S.clock.mn.y, m, S.clock.font_m, colors.text) + write(S.clock.dt.x, S.clock.dt.y, date, 12, colors.text) + write(S.clock.ut.x, S.clock.ut.y, "Uptime: " .. uptime_short(), 11, colors.text) +end + + +function draw_disks() + local rt = fs_used_perc("/") + local hm = fs_used_perc("/home") + local rt_text = string.format("Root: %s / %s (%s)", fs_used("/"), fs_size("/"), fs_free("/")) + local hm_text = string.format("Home: %s / %s (%s)", fs_used("/home"), fs_size("/home"), fs_free("/home")) + + ring_anticlockwise(S.disk.x, S.disk.y, S.disk.radius, S.disk.thickness, S.disk.begin_angle, S.disk.end_angle, rt, 100, color_frompercent(tonumber(rt))) + ring_anticlockwise(S.disk.x, S.disk.y, S.disk.radius-22, S.disk.thickness, S.disk.begin_angle, S.disk.end_angle, hm, 100, color_frompercent(tonumber(hm))) + + write(S.disk.x+45, S.disk.y-S.disk.radius+10, rt_text, 11, colors.text) + write(S.disk.x+40, S.disk.y-S.disk.radius+35, hm_text, 11, colors.text) + + local dsk_info = { + "Read: " .. diskio_read(""), + "Write: " .. diskio_write(""), + } + write_line_by_line(S.disk.x-40, S.disk.y-10, 20, dsk_info, colors.text, 12) + +end + + +function draw_net() + ring_clockwise(S.net.x, S.net.y, S.net.radius, 15, S.net.begin_angle, S.net.end_angle, download_speed_kb(), download_rate_maximum, colors.fg) + ring_clockwise(S.net.x, S.net.y, S.net.radius-18, 15, S.net.begin_angle, S.net.end_angle, upload_speed_kb(), upload_rate_maximum, colors.fg) + + write(S.net.indicators.down.x, S.net.indicators.down.y, "▼ ".. download_speed(), 12, colors.text) + write(S.net.indicators.up.x, S.net.indicators.up.y, "▲ "..upload_speed(), 12, colors.text) + + write(S.net.total.down.x-50, S.net.y, "Total ", 12, colors.text) + write(S.net.total.down.x, S.net.total.down.y, "▼".. download_total(), 12, colors.text) + write(S.net.total.up.x, S.net.total.up.y, "▲"..upload_total(), 12, colors.text) + + local inf = {} + -- table.insert(inf, "SSID: " .. string.sub(ssid(), 0, 15)) + -- table.insert(inf, "Wifi Signal: " .. wifi_signal() .. "%") + table.insert(inf, "Local IP: " .. local_ip()) + if use_public_ip then + if public_ip == nil or (updates()%public_ip_refresh_rate) == 0 then + update_public_ip() + end + table.insert(inf, "Public IP: " .. get_public_ip()) + end + write_line_by_line(S.net.list.x, S.net.list.y, 20, inf, colors.text, 12) +end + + +function draw_battery() + if not has_battery then return end + if not initialized_battery and tonumber(updates()) > startup_delay + 6 then + init_battery() + end + local bat = battery_percent() + ring_anticlockwise(S.battery.x, S.battery.y, S.battery.radius, S.battery.width , S.battery.begin, S.battery.end_, bat, 100, color_frompercent_reverse(tonumber(bat))) + write(S.battery.text.perc.x, S.battery.text.perc.y, bat .. "%", 15, colors.text) + write(S.battery.text.title.x, S.battery.text.title.y, "Battery", 15, colors.text) +end + + +function draw_titles() + if not to_draw_titles then return end + write(180, 270, "CPU", 18, colors.text) + write(325, S.net.y+80, "Internet", 15, colors.text) + write(S.mem.text.ring_title.x, S.mem.text.ring_title.y, "Memory", 18, colors.text) + write(S.disk.x+100, S.disk.y-S.disk.radius+130, "Hard Disk", 15, colors.text) +end + + +function conky_main() + if conky_window == nil then + return + elseif colors == nil then + io.stderr:write("Fatal Error. Please define a theme") + end + + local updates_ = tonumber(updates()) + if initialized_battery == false and updates_ > startup_delay then + init_battery() + end + + local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, + conky_window.visual, conky_window.width, + conky_window.height) + cr = cairo_create(cs) + + start() + + cairo_destroy(cr) + cairo_surface_destroy(cs) + cr = nil +end + -- cgit v1.2.3