.profile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # ~/.bashrc: executed by bash(1) for non-login shells.
  2. # Note: PS1 and umask are already set in /etc/profile. You should not
  3. # need this unless you want different defaults for root.
  4. # PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
  5. # umask 022
  6. # You may uncomment the following lines if you want `ls' to be colorized:
  7. export TERM=xterm
  8. export LS_OPTIONS='--color=auto'
  9. #eval "`dircolors`"
  10. alias ls='ls $LS_OPTIONS'
  11. alias ll='ls $LS_OPTIONS -l'
  12. alias l='ls $LS_OPTIONS -lA'
  13. #
  14. # Some more alias to avoid making mistakes:
  15. # alias rm='rm -i'
  16. # alias cp='cp -i'
  17. # alias mv='mv -i'
  18. # Alias functions for compatibility
  19. volume_get() {
  20. volume get "$@"
  21. }
  22. volume_set() {
  23. volume set "$@"
  24. }
  25. brightness_get() {
  26. brightness get "$@"
  27. }
  28. brightness_set() {
  29. brightness set "$@"
  30. }
  31. notif_set() {
  32. notif set "$@"
  33. }
  34. start_audio_amp() {
  35. audio_amp "$@"
  36. }
  37. cancel_sched_powerdown() {
  38. powerdown handle
  39. }
  40. # Relocate HOME into the r/w partition
  41. export HOME=/mnt/FunKey
  42. mkdir -p "${HOME}"
  43. export MEDNAFEN_HOME=$HOME/.mednafen
  44. mkdir -p "${MEDNAFEN_HOME}"
  45. cp "/usr/games/lynxboot.img" "/usr/games/mednafen-09x.cfg" "${MEDNAFEN_HOME}/"
  46. export GMENU2X_HOME="$HOME/.gmenu2x"
  47. mkdir -p "${GMENU2X_HOME}"
  48. export RETROFE_HOME="$HOME/.retrofe"
  49. mkdir -p "${RETROFE_HOME}"
  50. mkdir -p "${RETROFE_HOME}/layouts"
  51. # Resize the console to the terminal dimensions
  52. resize() {
  53. if [[ -t 0 && $# -eq 0 ]]; then
  54. local IFS='[;' escape geometry x y
  55. echo -ne '\e7\e[r\e[999;999H\e[6n\e8'
  56. read -sd R escape geometry
  57. x=${geometry##*;} y=${geometry%%;*}
  58. if [[ ${COLUMNS} -eq ${x} && ${LINES} -eq ${y} ]]; then
  59. echo "${TERM} ${x}x${y}"
  60. else
  61. echo "${COLUMNS}x${LINES} -> ${x}x${y}"
  62. stty cols ${x} rows ${y}
  63. fi
  64. else
  65. print 'Usage: resize'
  66. fi
  67. }
  68. # Restore saved volume
  69. echo "Restore saved volume"
  70. volume set $(volume get) >/dev/null 2>&1
  71. # Restore saved brightness
  72. echo "Restore saved brightness"
  73. brightness set $(brightness get) >/dev/null 2>&1
  74. # Start Assembly tests (blocking process)
  75. assembly_tests >/dev/null 2>&1
  76. # Restart saved application/game if any
  77. instant_play load
  78. # Start frontend
  79. echo "Start frontend"
  80. frontend init >/dev/null 2>&1 &