Skip to content

Commit

Permalink
Added shutdown cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodmg committed Nov 20, 2023
1 parent a508167 commit df43088
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions player.pro
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ RESOURCES += \
DISTFILES += \
README.md \
scale-skin.sh \
shutdown.sh \
styles/controlbuttonswidget.shuffleButton.4x.qss
3 changes: 3 additions & 0 deletions shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

sudo shutdown now

0 comments on commit df43088

Please sign in to comment.