Advertisement
Mr_Green

gtk3theme

May 16th, 2012
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.05 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # script to copy gtk-3.0 to ~/.config/
  4. # by Mr Green & darktux
  5.  
  6. # paths
  7. user_home=/home/${USER}
  8. theme_name=$1
  9. theme_dir=${user_home}/.themes
  10. system_theme_dir=/usr/share/themes
  11.  
  12. # Test if theme name given or list [-l]
  13. if [ $# -ne 1 ]
  14. then
  15.   echo "Usage: `basename $0` {theme name} or -l to list gtk3 themes"
  16.   exit
  17. elif [ $1 = "-l" ]; then
  18.     echo
  19.     find ${system_theme_dir} ${theme_dir} -type d -name 'gtk-3.0' | awk -F'/' '{print $5}'
  20.     echo
  21.     exit
  22. fi
  23.  
  24. # Check if theme exists then copy it if it does
  25. flag=0
  26. for x in $system_theme_dir $theme_dir; do
  27.     if [ -d ${x}/${theme_name}/gtk-3.0 ]; then
  28.     cp -a ${x}/${theme_name}/gtk-3.0 ${user_home}/.config
  29.     echo "Gtk3 theme ${theme_name} installed"
  30.     flag=1
  31.     fi
  32. done
  33.  
  34. # Theme not found
  35. if [ "$flag" -eq 0 ]; then
  36.   echo "${theme_name} not found"
  37. else
  38. # Option to tweak theme with lxappearance (after theme instalation)
  39.   read -p "Tweak theme with Lxappearance ? (Y/n) " yn
  40.   case $yn in
  41.     [Nn]* ) exit ;;
  42.     * )   lxappearance  && clear ;;
  43.   esac
  44. fi
  45.  
  46. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement