XBMC

From Network Security Wiki
Jump to navigation Jump to search


Kodi Shortcuts

Kodi/XBMC Shortcuts

Feature Shorcut Key
Audio delay control A
Play P
Stop X
Rewind (2x, 4x) R
Fast forward F
Rewind 30s
Forward 30s
Seek forward 10min, Next track
Step back 10min, Previous track
Variable seek backwards Ctrl+←
Variable seek forward Ctrl+→
Move subtitles up Ctrl+↑
Move subtitles down Ctrl+↓
Toggle Subtitles T
Previous Menu or Home Screen Esc
Volume Down, Volume Up, Mute + plus, – minus, F8
Shut down Menu S
Pause / Play Space bar / P
Zoom / Aspect Ratio Z
Add to Queue Q
Page up PageUp
Page down PageDown
Jump to that time in playback 1+2+3+4+Enter will jump to 12 min 34s
Jump backward in amount of time 1+0+← will jump back 10 seconds
Jump forward in amount of time 1+0+→ will jump forward 10 seconds
Jump to that letter in a list Shift + Letter
Zoom Picture Level 1-9 Picture View
Next Picture . period Picture View
Previous Picture , comma Picture View
Zoom In, Zoom Out + plus, – minus Picture View


OpenELEC Dual Boot

How to dual boot(actually Triple boot) OpenELEC with Ubuntu and Windows.

  • OpenELEC itself requires at least 2 partitions.
  • Create the first partition, EXT4
  • Label it 'OE_SYSTEM', size 512MB to 1GB.
  • The OE_SYSTEM partition must be flagged as bootable.
  • Both operating system files, SYSTEM and KERNEL, must be placed into the OE_SYSTEM partition (assume /dev/sda6)
  • Create the second partition, EXT4
  • Label it 'OE_DATA', size.
  • Here all local OpenELEC/XBMC data will be placed, such as databases and thumbnails (assume /dev/sda7)
  • Write down the linux drive letters & update the below file with it
  • Unlike Grub, Grub2 starts partition counting from 1 not 0.
  • Now update Grub2:
sudo gedit /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
#
menuentry "OpenELEC" {
   search --set=root --label OE_SYSTEM --hint hd0,msdos6
   linux /KERNEL boot=LABEL=OE_SYSTEM disk=LABEL=OE_DATA quiet
}
menuentry "OpenELEC debugging" {
   search --set=root --label OE_SYSTEM --hint hd0,msdos6
   linux /KERNEL boot=LABEL=OE_SYSTEM disk=LABEL=OE_DATA debugging
}

Now finalize the grub menu additions:

sudo update-grub



LibreElec Shutdown Button

Pi shutdown switch.png

Source: libreelec.tv, lowpowerlab.com, libreelec.tv

  • Install Raspberry Pi Tools from libreELEC UI:
Program ---> Get more ... ---> Raspberry Pi Tools ---> install
  • Create shutdown script:
nano /storage/.config/shutdown_pi.py
#!/bin/python  
import RPi.GPIO as GPIO  
import time  
import os
import sys

sys.path.append("/storage/.kodi/addons/virtual.rpi-tools/lib")

# Use the Broadcom SOC Pin numbers  
# Setup the Pin with Internal pullups enabled and PIN in reading mode.  
GPIO.setmode(GPIO.BCM)  
GPIO.setup(3, GPIO.IN, pull_up_down = GPIO.PUD_UP)  
 
# Our function on what to do when the button is pressed  
def Shutdown(channel):  
  os.system("poweroff")  
 
# Add our function to execute when the button pressed event happens  
GPIO.add_event_detect(3, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)  
 
# Now wait!  
while 1:  
  time.sleep(1)
  • Create Autostart Script:
nano /storage/.config/autostart.sh
#!/bin/bash
(
/storage/.config/shutdown_pi.py
)&
  • Make files executable
chmod +x shutdown_pi.py 
chmod +x autostart.sh
  • Enable UART for the Status LED:
mount -o remount,rw /flash
nano /flash/config.txt
enable_uart=1
  • Reboot


OSMC

OSMC Shutdown Button

Source: discourse.osmc.tv

Pi shutdown switch.png
  • Install Raspberry Pi Tools from CLI:
sudo su
apt-get update
apt-get install python-pip python-dev gcc python-setuptools wheel
pip install rpi.gpio
  • Create shutdown script:
nano /home/osmc/.config/shutdown_pi.py
#!/usr/bin/python  
import RPi.GPIO as GPIO  
import time  
import os
import sys

sys.path.append("/storage/.kodi/addons/virtual.rpi-tools/lib")

# Use the Broadcom SOC Pin numbers  
# Setup the Pin with Internal pullups enabled and PIN in reading mode.  
GPIO.setmode(GPIO.BCM)  
GPIO.setup(3, GPIO.IN, pull_up_down = GPIO.PUD_UP)  
 
# Our function on what to do when the button is pressed  
def Shutdown(channel):  
  os.system("poweroff")  
 
# Add our function to execute when the button pressed event happens  
GPIO.add_event_detect(3, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)  
 
# Now wait!  
while 1:  
  time.sleep(1)


  • Make files executable
chmod +x shutdown_pi.py 
  • Test Script:
./home/osmc/.config/shutdown_pi.py
  • Auto Start as a Service

Create systemd service file:

nano /lib/systemd/system/shutdownpi.service
[Unit]
Description = GPIO shutdown button

[Service]
Type = idle
ExecStart = /home/osmc/.config/shutdown_pi.py

[Install]
WantedBy = multi-user.target

Enable the service:

systemctl enable shutdownpi

Start the service:

systemctl start shutdownpi


  • Enable UART for the Status LED:
nano /boot/config.txt
enable_uart=1
  • Reboot




blog comments powered by Disqus