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