Skip to content

Instantly share code, notes, and snippets.

@robertely
Last active August 29, 2015 14:14
Show Gist options
  • Save robertely/82d288f83d08916200cf to your computer and use it in GitHub Desktop.
Save robertely/82d288f83d08916200cf to your computer and use it in GitHub Desktop.
Plex: Actually shut down when shutdown is issued.
#!/bin/sh
export XBMC_HOME=/opt/plexhometheater/share/XBMC
#Use export AE_ENGINE=SOFT to disable pulse audio
#export AE_ENGINE=SOFT
# VERY STUPID HACK TO MAKE SURE IT STARTS ON THE SECOND SCREEN.
wmctrl -k on
xdotool mousemove 2823 849 click 1
#Stupid hack for non-fucking-up-dual-screens full screen.
(sleep 1; wmctrl -r "XBMC Media Center" -e '0,1920,0,1920,1080') &
(sleep 2; wmctrl -r "XBMC Media Center" -b toggle,fullscreen) &
/opt/plexhometheater/bin/plexhometheater
#Stupid hack to make sure plex actually shuts down the machine.
if [ $? -eq 64 ]; then
/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
fi
@robertely
Copy link
Author

Plex won't actually shutdown if you press shutdown. However it will exit with a status of "64" because of reasons.

@robertely
Copy link
Author

Added boarder-less full screen start to prevent it fucking up my display setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment