Hey all,
I’ve never used the sleep button in the kickoff menu so I decided to embark on a mission to remove it and build a “boot to windows” button instead.
Now I’ve found the LeaveButtons.qml file and I’ve removed the hibernate/suspend from kicker/systemFavorites and added a custom button in the qml for rebooting.
looks fine so far:
![]()
however I’m struggling with the functionality.
RowLayout {
id: buttonsRepeaterRow
// HACK Can't use `visible` property, as the layout needs to be
// visible to be able to update its implicit size, which in turn is
// be used to set collapseActionButtons.
enabled: !root.__layout.collapseActionButtons
opacity: !root.__layout.collapseActionButtons ? 1 : 0
spacing: parent.spacing
PC3.ToolButton {
icon.name: "windows-logo-white"
text: i18n("Restart to Windows")
display: Plasmoid.configuration.showActionButtonCaptions ? PC3.AbstractButton.TextBesideIcon : PC3.AbstractButton.IconOnly;
onClicked: {
// something goes here
}
PC3.ToolTip.text: text
PC3.ToolTip.delay: Kirigami.Units.toolTipDelay
PC3.ToolTip.visible: display === PC3.AbstractButton.IconOnly && hovered
so in the “onClicked” section I want to basically run a script or trigger a command
ENTRY_NAME="Windows Boot Manager (on /dev/sdc1)"
sudo grub-reboot "$ENTRY_NAME" && systemctl reboot
I’ve configured this so it wouldn’t need the sudo password prompt but for the life of me I cant get this to work. I’ve tried Qt.External task with file and script with file and .desktop and lots of other ways, however as you may be able to tell I’m not a qml/c/c++ or other dev.
Can I actually in some way launch a command here, or do I need to build some .co that I somehow import. I’m at wits end, any help would be appreciated.