Linux mint cinnamon 19 desklets3/10/2024 ![]() ![]() The behaviour of the desklet still needs to be coded to have all the desired features, will be documented in a future post. Finally, the function main returns an instance of MyDesklet Next stepsīy this point there is a working desklet. The method setupUI() contains the behaviour of the desklet, see comments in the code above. Using MyDesklet.prototype allows us to add new methods to the object constructors. The function MyDesklet is the constructor for our desklet, it takes metadata (dictionary) with the metadata of the desklet, and desklet_id (int) which is the instance id of the desklet. The Shell Toolkit is imported at imports.gi.St, it is a clutter-based toolkit that allows to add GUI elements to the desklet, St documentation can be found here. The latest version allows you to select the type. The applet detects which device youre currently using, and simply exports a graph using vnstati. First, the Desklet class is imported from. How it does it: The vnstat daemon runs in the background and collects info about your Internet usage all the time the machine is running and maintains a data set from once it is initially activated. St function MyDesklet ( metadata, desklet_id ) Ĭonstants are declared with const, and cannot be re-declared nor changed. Metadata.json: As it names indicates, this has the metadata for the desklet and additional options such as max-instances to allow multiple instances of the desklet.Ĭonst Desklet = imports. For example desklet requires at least two files: Then, create a directory with the name this is the UUID of the desklet. Cinnamon is a linux desktop environment forked from Gnome Shell by Linux Mint. The files described in this section can be downloaded from here.įirst desklet, it prints "Hello Desktop" and can have multiple instancesįirst of all, the desklets are located at ~/.local/share/cinnamon/desklets, where each desklet has its own directory. When finished, it should look like the image below. Ok, with the previous information in mind, here a simple desklet is created and explained. More information about desklets can be find in the official repository. Moreover, desklets as well as other graphical elements in Cinnamon are written in JavaScript 3, and use the Cinnamon's JavaScript interpreter (CJS) 4. "Desklets are little programs which you can place on your desktop, on top of your desktop background" 2. At the moment of writing, Cinnamon 4.4.8 on Arch Linux was used. Because the information to develop a desklet is outdated 1, I decided to document the process, this is the first part of that process. ![]() A good day I was going through the available Desklets for Cinnamon, looking for an desklet to display graphs about the current state of the system (CPU, RAM, disks, etc.), although I found the nice desklets such as Simple monitor system, CPU Load and Disk Space, none of them quite do what I need.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |