script-user-reset-desktop 865 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. # Reset default desktop preferences
  3. # Copyright Bryan C. Roessler
  4. parent="${BASH_SOURCE[0]}"
  5. parent=${parent%/*}
  6. [[ -f $parent/script-functions ]] && . "$parent"/script-functions || exit 1
  7. echo "This script will only work for the current user"
  8. [[ $EUID -eq 0 ]] && echo "Do not run as root (do not use sudo)" && exit 1
  9. to_reset=(
  10. /org/mate/panel/
  11. /org/mate/panel/objects/
  12. /org/mate/desktop/background/
  13. /org/mate/desktop/font-rendering/
  14. /org/mate/desktop/interface/
  15. /org/mate/desktop/screensaver/
  16. /org/mate/desktop/media-handling/
  17. /org/mate/desktop/screensaver/
  18. /org/mate/mate-menu/
  19. /org/mate/marco/general/
  20. /org/mate/caja/desktop/
  21. /org/mate/caja/preferences/
  22. /org/mate/notification-daemon/
  23. )
  24. echo "Resetting desktop for user $(whoami)"
  25. for p in "${to_reset[@]}"; do
  26. dconf reset -f "$p"
  27. done
  28. mate-panel --reset