From 690a9b9ceb3d8e1083d94adcb28524b4ffe5542b Mon Sep 17 00:00:00 2001 From: claudiux Date: Mon, 31 Jul 2023 17:05:41 +0200 Subject: [PATCH] Updated write-applet.xml - New example (Cin from 4.6 to 5.8+ --- docs/reference/cinnamon-tutorials/write-applet.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/cinnamon-tutorials/write-applet.xml b/docs/reference/cinnamon-tutorials/write-applet.xml index 1eba23214f..eb6f828034 100644 --- a/docs/reference/cinnamon-tutorials/write-applet.xml +++ b/docs/reference/cinnamon-tutorials/write-applet.xml @@ -100,9 +100,9 @@ /** * Variables (and other constants) */ - var user = GLib.getenv("USER"); // acts like the shell command: echo -n $USER - - user = user.charAt(0).toUpperCase() + user.slice(1); // Capitalize 'user' + var user = GLib.get_user_name(); + // String.capitalize() is a function implemented by Cinnamon. + user = user.capitalize(); // Turns the first character into uppercase. /** * Declaration of the 'NotifyMe' class, which extends