Flavour settings for Mate
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mate-cheatcodes 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/sh
  2. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  3. NAME="mate-cheatcodes"
  4. if [ -r /etc/default/distro ]; then
  5. . /etc/default/distro
  6. fi
  7. . /lib/lsb/init-functions
  8. . /lib/init/fll
  9. if [ -r /etc/default/fll-locales ]; then
  10. . /etc/default/fll-locales
  11. fi
  12. FLL_LIVE_USER_HOME=$(getent passwd ${FLL_LIVE_USER} | cut -d \: -f 6)
  13. ###
  14. # cheatcode handling
  15. ###
  16. for param in $(cat /proc/cmdline); do
  17. case "${param}" in
  18. flldebug=*)
  19. if [ "${param#flldebug=}" = "${NAME}" ] || [ "${param#flldebug=}" = "all" ]; then
  20. fll_redirect
  21. fi
  22. ;;
  23. nointro)
  24. NOINTRO="nointro"
  25. ;;
  26. mate)
  27. MATE_SESSION_TYPE="['mate-classic']"
  28. ;;
  29. esac
  30. done
  31. change_mate_session() {
  32. if [ -n "${MATE_SESSION_TYPE}" ] ; then
  33. if [ ! -d /etc/glib-2.0/schemas ]; then
  34. mkdir -p /etc/glib-2.0/schemas
  35. fi
  36. mount --bind /usr/share/glib-2.0/schemas /etc/glib-2.0/schemas
  37. sed -i "s@default-session=.*@default-session='${MATE_SESSION_TYPE}'@" /etc/glib-2.0/schemas/92_org.mate.session.gschema.override
  38. # we rebuild schema
  39. glib-compile-schemas /etc/glib-2.0/schemas
  40. umount /etc/glib-2.0/schemas
  41. fi
  42. }
  43. no_intro() {
  44. if [ -z "${NOINTRO}" ] ; then
  45. [ ! -f ${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop ] && sudo -u ${FLL_LIVE_USER} ln -sf "${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop" \
  46. "${FLL_LIVE_USER_HOME}/.config/autostart/"
  47. elif [ -e "${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop" ]; then
  48. # toram + persistency
  49. rm -f "${FLL_LIVE_USER_HOME}/.config/autostart/${FLL_DISTRO_NAME}.desktop"
  50. fi
  51. }
  52. do_start() {
  53. if [ -f ${FLL_LIVE_USER_HOME}/Desktop/${FLL_DISTRO_NAME}.desktop ]; then
  54. no_intro
  55. fi
  56. # change_mate_session
  57. }
  58. case "${1}" in
  59. start)
  60. log_daemon_msg "${NAME}"
  61. do_start
  62. log_end_msg "${?}"
  63. ;;
  64. stop)
  65. ;;
  66. restart|force-reload)
  67. echo "Error: argument '${1}' not supported" >&2
  68. exit 3
  69. ;;
  70. *)
  71. echo "Usage: ${NAME} {start|stop}" >&2
  72. exit 3
  73. ;;
  74. esac