Warning, /plasma/plasma-welcome/README.md is written in an unsupported language. File is not indexed.

0001 <!--
0002     SPDX-License-Identifier: CC0-1.0
0003     SPDX-FileCopyrightText: 2022-Nate Graham <nate@kde.org>
0004 -->
0005 # Plasma Welcome App
0006 
0007 A Friendly onboarding wizard for Plasma
0008 
0009 Welcome Center is the perfect introduction to KDE Plasma! It can help you learn how to connect to the internet, install apps, customize the system, and more!
0010 
0011 There are two usage modes:
0012 - Run the app normally and it will show a welcome/onboarding wizard.
0013 - Run the app with the `--after-upgrade-to` argument to show a post-upgrade message. For example: `plasma-welcome --after-upgrade-to 5.25`.
0014 
0015 
0016 ## Screenshots
0017 ![First page](https://cdn.kde.org/screenshots/plasma-welcome/plasma-welcome-page-1.png)
0018 
0019 ![Second page](https://cdn.kde.org/screenshots/plasma-welcome/plasma-welcome-page-2.png)
0020 
0021 ![Sixth page](https://cdn.kde.org/screenshots/plasma-welcome/plasma-welcome-page-6.png)
0022 
0023 
0024 # Extending Welcome Center with custom pages
0025 Custom distro-specific pages can be embedded in the app, and will appear right before the "Get Involved" page. Only content that is safely skippable should be added, since the user can close the app at any time, potentially before they see your custom pages.
0026 
0027 To make custom pages visible to the app, place them in `/usr/share/plasma-welcome-extra-pages/`, prefixed with a number and a dash. For example if you define two pages with the following names:
0028 
0029 - 01-WelcomeToDistro.qml
0030 - 02-InstallMediaCodecs.qml
0031 
0032 These two pages will be added into the wizard, with WelcomeToDistro shown first, and then InstallMediaCodecs.
0033 
0034 Custom pages are QML files with a root item that inherits from Kirigami.Page. Any content within the page is supported, though to maintain visual consistency with existing pages, it is recommended to use `GenericPage` or `KCM` as the root item and set the `heading` and `description` properties, with any custom content going beneath them.
0035 
0036 Because pages are written in QML without support for C++ support code, only functions that can be performed entirely with QML are available. Here are some examples:
0037 
0038 ## Open a URL in the default web browser
0039 Example:
0040 ```
0041 Kirigami.Icon {
0042     source: "media-default-track"
0043     HoverHandler {
0044         cursorShape: Qt.PointingHandCursor
0045     }
0046     TapHandler {
0047         onTapped: Qt.openUrlExternally("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
0048     }
0049 }
0050 ```
0051 
0052 ## Open an external app
0053 ```
0054 Kirigami.Icon {
0055     source: "document-open-folder"
0056     HoverHandler {
0057         cursorShape: Qt.PointingHandCursor
0058     }
0059     TapHandler {
0060         onTapped: Controller.launchApp("org.kde.dolphin")
0061     }
0062 }
0063 ```
0064 
0065 ## Run a terminal command
0066 ```
0067 Kirigami.Icon {
0068     source: "notification"
0069     HoverHandler {
0070         cursorShape: Qt.PointingHandCursor
0071     }
0072     TapHandler {
0073         onTapped: Controller.runCommand("notify-send foo bar")
0074     }
0075 }
0076 ```
0077 
0078 ## Embed a KCM in the page
0079 Example:
0080 ```
0081 KCM {
0082     heading: i18nc("@title: window", "Learn about Activities")
0083     description: i18nc("@info:usagetip", "Activities can be used to separate high-level projects or tasks so you can focus on one at a time. You can set them up in System Settings, and also right here.")
0084 
0085     Module {
0086         id: moduleActivities
0087         path: "kcm_activities"
0088     }
0089     kcm: moduleActivities.kcm
0090     internalPage: moduleActivities.kcm.mainUi
0091     }
0092 ```
0093 
0094 
0095 If you find that your specific use case can't be supported with these tools, please file a bug report at https://bugs.kde.org/enter_bug.cgi?product=Welcome%20Center detailing the use case and what would be needed to support it.
0096 
0097 ## Example custom page
0098 
0099 Name this file `01-NateOS.qml` and place it in `/usr/share/plasma-welcome-extra-pages/`:
0100 
0101 ```
0102 /*
0103  *  SPDX-FileCopyrightText: 2021 Felipe Kinoshita <kinofhek@gmail.com>
0104  *  SPDX-FileCopyrightText: 2022 Nate Graham <nate@kde.org>
0105  *
0106  *  SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0107  */
0108 
0109 import QtQuick 2.15
0110 import QtQuick.Controls 2.15 as QQC2
0111 import QtQuick.Layouts 1.15
0112 import org.kde.kirigami 2.15 as Kirigami
0113 import QtGraphicalEffects 1.15
0114 
0115 import org.kde.welcome 1.0
0116 import org.kde.plasma.welcome 1.0
0117 
0118 GenericPage {
0119     heading: i18nc("@info:window", "Welcome to NateOS")
0120     description: i18nc("@info:usagetip", "It's the best distro in the world, until it explodes.")
0121 
0122     Kirigami.Icon {
0123         id: image
0124         anchors.centerIn: parent
0125         anchors.verticalCenterOffset: -Kirigami.Units.gridUnit * 4
0126         width: Kirigami.Units.gridUnit * 10
0127         height: Kirigami.Units.gridUnit * 10
0128         source: "granatier"
0129 
0130         HoverHandler {
0131             id: hoverhandler
0132             cursorShape: Qt.PointingHandCursor
0133         }
0134         TapHandler {
0135             onTapped: showPassiveNotification(i18n("Why on earth would you click this!?"));
0136         }
0137 
0138         QQC2.ToolTip {
0139             visible: hoverhandler.hovered
0140             text: i18nc("@action:button", "Detonating the bomb in 3... 2... 1...")
0141         }
0142 
0143         layer.enabled: true
0144         layer.effect: DropShadow {
0145             transparentBorder: true
0146             horizontalOffset: 0
0147             verticalOffset: 1
0148             radius: 20
0149             samples: 20
0150             color: Qt.rgba(0, 0, 0, 0.2)
0151         }
0152     }
0153 
0154     Kirigami.Heading {
0155         anchors.horizontalCenter: parent.horizontalCenter
0156         anchors.top: image.bottom
0157         text: i18nc("@title the name of the 'System Exploder' app", "Someone set up us the bomb")
0158         wrapMode: Text.WordWrap
0159         level: 3
0160     }
0161 }
0162 ```