From df43088c165f532e934266229097f0c03abab7d3 Mon Sep 17 00:00:00 2001 From: Rodrigo Mendez Date: Sun, 19 Nov 2023 22:14:53 -0600 Subject: [PATCH] Added shutdown cmd --- mainwindow.cpp | 5 ++++- player.pro | 1 + shutdown.sh | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 shutdown.sh diff --git a/mainwindow.cpp b/mainwindow.cpp index b258984..ad11e82 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -153,6 +153,9 @@ void MainWindow::showShutdownModal() void MainWindow::shutdown() { + QString appPath = QCoreApplication::applicationDirPath(); + QString cmd = appPath + "/shutdown.sh"; + shutdownProcess = new QProcess(this); - shutdownProcess->start("/usr/bin/sudo" "shutdown -r now"); + shutdownProcess->start(cmd); } diff --git a/player.pro b/player.pro index 25aaac1..a5ae3b2 100644 --- a/player.pro +++ b/player.pro @@ -68,4 +68,5 @@ RESOURCES += \ DISTFILES += \ README.md \ scale-skin.sh \ + shutdown.sh \ styles/controlbuttonswidget.shuffleButton.4x.qss diff --git a/shutdown.sh b/shutdown.sh new file mode 100755 index 0000000..3ddd483 --- /dev/null +++ b/shutdown.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sudo shutdown now