Skip to content

Instantly share code, notes, and snippets.

@janwillemm
Forked from hermanbanken/tv-autostart.bash
Last active December 21, 2015 10:39
Show Gist options
  • Save janwillemm/6293457 to your computer and use it in GitHub Desktop.
Save janwillemm/6293457 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Het grote 'zet-de-tv-goed-beunscript'
# Copyrighties belong to me :)
# TO DO BEFORE USAGE
# Hide Unity Launcher
# Install Firefox
# Setup exception for wrong certificates of CH
# Set enabled=0 in /etc/default/apport to prevent error messages
# SCRIPT
export DISPLAY=:0
sleep 5 # Zorg dat alles opgestart is
# TV binnen - overscan/underscan
aticonfig --set-dispattrib=dfp2,sizeX:1920
aticonfig --set-dispattrib=dfp2,sizeY:1080
aticonfig --set-dispattrib=dfp2,positionX:0
aticonfig --set-dispattrib=dfp2,positionY:0
# TV buiten - overscan/underscan
aticonfig --set-dispattrib=dfp1,sizeX:1838
aticonfig --set-dispattrib=dfp1,sizeY:1042
aticonfig --set-dispattrib=dfp1,positionX:42
aticonfig --set-dispattrib=dfp1,positionY:21
# Setup browsers correctly
pkill firefox
sleep 1
# Open Firefoxes
#firefox -new-window https://frans.chnet/staff/tv/index.php?tv=1 -P TV1 &
firefox -new-window http://wisv.ch/tv/index.php?tv=1 -P TV1 &
sleep 2
#firefox -new-window https://frans.chnet/staff/tv/index.php?tv=2 -P TV2 &
firefox -new-window http://wisv.ch/tv/index.php?tv=2 -P TV2 &
# Wait
sleep 1
# Move screens
wmctrl -r "CH TV nr 1" -e '0,0,0,1920,1080'
wmctrl -r "CH TV nr 2" -e '0,-1920,0,1920,1080'
sleep 1
wmctrl -r "CH TV nr 1" -b add,fullscreen
wmctrl -r "CH TV nr 2" -b add,fullscreen
# Press shift every 30 seconds
sh `while sleep 30 ; do xdotool keydown Shift_L keyup Shift_L ; done` &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment