Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/sh
  2.  
  3. # hide mouse cursor
  4. unclutter --noevents -b
  5.  
  6. systemsetting="batocera-settings"
  7.  
  8. # set the keyboard
  9. settings_lang="`$systemsetting -command load -key system.language`"
  10.  
  11. # not always true (en_US for us), but it's really better than always english
  12. map_name=$(echo $settings_lang | cut -c 1-2)
  13. setxkbmap "${map_name}"
  14.  
  15. # disable dpms to prevent screen from blanking
  16. xset -dpms
  17. xset s off
  18.  
  19. # environment
  20. export HOME=/userdata/system
  21. export LC_ALL="${settings_lang}.UTF-8"
  22. export LANG=${LC_ALL}
  23.  
  24. # because of xinerama breaking es, enable only one screen at a time
  25. settings_output="`$systemsetting -command load -key global.videooutput`"
  26. batocera-resolution setOutput "${settings_output}" # empty or invalid values defaults to the first valid
  27.  
  28. # dpi override for nvidia gpus
  29. settings_output="`$systemsetting -command load -key global.dpi`"
  30. [ ! -z "${settings_output}" ] && batocera-resolution setDPI "${settings_output}"
  31.  
  32. #####################
  33. ## CUSTOMISATIONS ###
  34. # to customize your display, you can copy this file to ~/.xinitrc and then modify it
  35.  
  36. # rotate the screen
  37. # xrandr -o left
  38. # xrandr -o right
  39. # xrandr -o inverted
  40.  
  41. # change the resolution
  42. xrandr -s 640x480
  43.  
  44. # change the resolution and the Hz
  45. # xrandr -s 640x480 -r 59.94
  46.  
  47. ### PAL ###
  48. xrandr --newmode "PAL 768x576 (50Hz)" 14.750 768 790 859 944 576 581 586 625 -HSync -VSync interlace
  49. xrandr --addmode DVI-I-1 "PAL 768x576 (50Hz)"
  50. xrandr --output DVI-I-1 --mode "PAL 768x576 (50Hz)"
  51.  
  52. ### NTSC ###
  53. xrandr --newmode "NTSC 640x480 (60Hz)" 12.336 640 662 720 784 480 488 494 525 -HSync -VSync interlace
  54. xrandr --addmode DVI-I-1 "NTSC 640x480 (60Hz)"
  55. # xrandr --output DVI-I-1 --mode "NTSC 640x480 (60Hz)"
  56.  
  57. ### Amiga ###
  58. xrandr --newmode "Amiga 752x576 (50Hz)" 14.25 752 768 840 928 576 579 589 616 -HSync -VSync interlace
  59. xrandr --addmode DVI-I-1 "Amiga 752x576 (50Hz)"
  60. # xrandr --output DVI-I-1 --mode "Amiga 752x576 (50Hz)"
  61.  
  62. #####################
  63. #####################
  64.  
  65. # set user desired resolution
  66. # nice workaround for displays which tell X11 to use strange resolutions
  67. settings_output="`$systemsetting -command load -key global.videomode`"
  68. [ ! -z "${settings_output}" ] && batocera-resolution setMode "${settings_output}"
  69.  
  70. batocera-resolution minTomaxResolution
  71.  
  72. # allow coredumps for ES
  73. ulimit -H -c unlimited
  74. ulimit -S -c unlimited emulationstation
  75.  
  76. cd /userdata # es needs a PWD
  77. openbox --config-file /etc/openbox/rc.xml --startup "emulationstation --windowed"
  78.