2020-05-05, 01:30
Hi,
This is more of a HOW-TO as I have figured out how to permanently hide the Shutdown and Reboot menu items..
I have just installed Kodi in standalone mode on Ubuntu 18, running Kodi v18.6.
I wanted to remove the Shutdown/Reboot menu options as the server it runs on also does other stuff - and after searching many forums etc, the most common solution appeared to be remove from the .xml files - but this I saw as an issue as every time I updated I would need to do it again. Additionally I'm using various web interfaces as well, and some of these could allow shutdowns which would be a pain.
My solution was to create a new file at with the following contents:
At next restart, Kodi detects it's no longer allowed to shutdown or reboot, and the menu items disappear!
I figured this out looking at the source code, but now it's done, it works well.
I'm running my Kodi as a service based on the files here: https://github.com/graysky2/kodi-standalone-service
This is more of a HOW-TO as I have figured out how to permanently hide the Shutdown and Reboot menu items..
I have just installed Kodi in standalone mode on Ubuntu 18, running Kodi v18.6.
I wanted to remove the Shutdown/Reboot menu options as the server it runs on also does other stuff - and after searching many forums etc, the most common solution appeared to be remove from the .xml files - but this I saw as an issue as every time I updated I would need to do it again. Additionally I'm using various web interfaces as well, and some of these could allow shutdowns which would be a pain.
My solution was to create a new file at
Code:
/etc/polkit-1/localauthority/50-local.d/restrict-login-powermgmt.pkla
Code:
# From: https://askubuntu.com/questions/453479/h...m-in-14-04
[Disable lightdm PowerMgmt]
Identity=unix-user:*
Action=org.freedesktop.login1.reboot;org.freedesktop.login1.reboot-multiple-sessions;org.freedesktop.login1.power-off;org.freedesktop.login1.power-off-multiple-sessions;org.freedesktop.login1.suspend;org.freedesktop.login1.suspend-multiple-sessions;org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
ResultAny=no
ResultInactive=no
ResultActive=no
At next restart, Kodi detects it's no longer allowed to shutdown or reboot, and the menu items disappear!
I figured this out looking at the source code, but now it's done, it works well.
I'm running my Kodi as a service based on the files here: https://github.com/graysky2/kodi-standalone-service