Suspend button behaviour
#1
Hi,
Since i reinstalled my mediacenter, i have different behaviour with some system buttons. Before the suspend button showed a menu with a question what i want. I chose suspend, then playback stops and the system suspended. That was in ubuntu 14.04 andere xbmc 13. Now i reinstalled with Ubuntu 14.04 and kodi 14rc. The shutdown button now seems tot be handled Ubuntu, and the system suspends immidiatly. The playback is nog stopped causing vdpau tot crash when i resume. I alsof noticed that the volume up and down are now handled by Ubuntu instead of kodi. I remember these was an option before tot enable/disable this behaviour, and always let kodi handle all buttons. I cant find this option anymore. Is this option still available?


The setting i am looking for is 'Enable system keys in fullscreen (Linux only)'. I found it on the wiki. Its nog in my kodi installation though....
Henk

Edit: fixed autocorrection
Reply
#2
I found on github that this funtionality has been dropped...Sad My suspend button is now seriously broken. Anyone else having issues with this?

https://github.com/notspiff/kodi-cmake/c...2c0340cbd6
Reply
#3
1st: that repo is not official kodi.
2nd: there is nothing we can do, if your window manager eats the keypress. You have to disable those keyboard shortcuts in your window manager. As soon as kodi sees the keypress, you can map it to "Shutdownmenu()"
Reply
#4
It would have been more appropriate to say something along the line "we do not want to steal key presses from window manager and therefore enablesystemkeys is not supported anymore".

If the OP uses the computer also w/o KODI running and wants to continue to use Window Manager to catch the button press, he would possibly write a script to
  • check if KODI is running and then run a modified script as below (see http://kodi.wiki/view/JSON-RPC_API/v6#System.Suspend . IMHO there is no JSON RPC API for the shutdown menu)

  • or if KODI is not running, then run the suspend command directly (e.g. through "pm suspend" in Ubuntu).

I did something similar to start or quit KODI. It could all be done in python, I just prefer bash for scripting in general and used python only because I found some examples for KODI API...

Code:
#!/bin/bash
# Quit or Start KODI (easier than in GUI)
# Assign it to a keyboard key press to launch from XFCE
# script name mk_xbmc-toggle.sh

LOG="/tmp/$(basename $0).log"
rm -rf "$LOG" 2>/dev/null

echo "$0: Starting script" | tee -a $LOG

if pidof kodi.bin ; then
    echo "$0: KODI is running, closing now!" | tee -a $LOG
    /usr/local/bin/mk_xbmc-quit.py | tee -a $LOG
else
    echo "$0: KODI is not running... Starting it." | tee -a $LOG
    exec /usr/bin/kodi &
fi

echo "$0: Script finished" | tee -a $LOG
exit 0


Code:
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# script name mk_xbmc-quit.py

import warnings
warnings.filterwarnings("ignore", category=UserWarning, module='urllib2')

import time

from xbmcjson import XBMC, PLAYER_VIDEO
if __name__ == "__main__":
        xbmc = XBMC("http://localhost:8080/jsonrpc", "xbmc", "myth01")
        print xbmc.GUI.ShowNotification({ "title": "Exiting", "message": "Leaving KODI, be patient pls...", "displaytime": 5000 }, id="1")
        time.sleep(0.2) # Time in seconds. Needed otherwise the notification will not even get displayed.
        print xbmc.Application.Quit()
Reply

Logout Mark Read Team Forum Stats Members Help
Suspend button behaviour0