Advertisement
Guest User

Untitled

a guest
Mar 4th, 2011
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.87 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # Restores a bunch of settings, like:
  4. # o home folder directory structure
  5. # o XDG settings
  6. # o nautilus bookmarks
  7. # o wallpaper
  8. # o and other bits of desktop configuration the user may have "accidentally" set
  9. #
  10. # Use Startup Applications to run this script
  11. #
  12. # Last updated: 2010.august.21
  13.  
  14. DIR_STRUCTURE_FILE=/.x/config/directory.structure
  15. WALLPAPER_FILE=/.x/config/wallpaper.jpg
  16.  
  17. SRC_XDG_FILE=/.x/config/original.xdg
  18. SRC_BOOKMARKS_FILE=/.x/config/original.bookmarks
  19.  
  20. DST_XDG_FILE=/home/user/.config/user-dirs.dirs
  21. DST_BOOKMARKS_FILE=/home/user/.gtk-bookmarks
  22.  
  23. # loop to infinity
  24. while :
  25. do
  26.  
  27.   # do the restore once every 60 seconds
  28.   sleep 60
  29.  
  30.   # restore default directory structure if they were modified by the user
  31.   while read DIR_NAME ;
  32.   do
  33.     if [ ! -d "$DIR_NAME" ] ;
  34.     then
  35.       mkdir "$DIR_NAME"
  36.     fi
  37.   done < $DIR_STRUCTURE_FILE
  38.  
  39.   # force restore of user directories
  40.   cp $SRC_XDG_FILE $DST_XDG_FILE
  41.  
  42.   # force restore of bookmarks
  43.   cp $SRC_BOOKMARKS_FILE $DST_BOOKMARKS_FILE
  44.  
  45.   # force restore of wallpaper settings
  46.   gconftool-2 --type string --set /desktop/gnome/background/color_shading_type solid
  47.   gconftool-2 --type bool --set /desktop/gnome/background/draw_background true
  48.   gconftool-2 --type string --set /desktop/gnome/background/picture_filename $WALLPAPER_FILE
  49.   gconftool-2 --type int --set /desktop/gnome/background/picture_opacity 100
  50.   gconftool-2 --type string --set /desktop/gnome/background/picture_options zoom
  51.   gconftool-2 --type string --set /desktop/gnome/background/primary_color '#000000000000'
  52.   gconftool-2 --type string --set /desktop/gnome/background/secondary_color '#000000000000'
  53.  
  54.   # other settings we need to enforce put them after this line
  55.  
  56.   # we don't want mousekeys enabled
  57.   gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/mousekeys_enable false
  58.  
  59. done
  60.  
  61. # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement