Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # script to copy gtk-3.0 to ~/.config/
- # by Mr Green & darktux
- # paths
- user_home=/home/${USER}
- theme_name=$1
- theme_dir=${user_home}/.themes
- system_theme_dir=/usr/share/themes
- # Test if theme name given or list [-l]
- if [ $# -ne 1 ]
- then
- echo "Usage: `basename $0` {theme name} or -l to list gtk3 themes"
- exit
- elif [ $1 = "-l" ]; then
- echo
- find ${system_theme_dir} ${theme_dir} -type d -name 'gtk-3.0' | awk -F'/' '{print $5}'
- echo
- exit
- fi
- # Check if theme exists then copy it if it does
- flag=0
- for x in $system_theme_dir $theme_dir; do
- if [ -d ${x}/${theme_name}/gtk-3.0 ]; then
- cp -a ${x}/${theme_name}/gtk-3.0 ${user_home}/.config
- echo "Gtk3 theme ${theme_name} installed"
- flag=1
- fi
- done
- # Theme not found
- if [ "$flag" -eq 0 ]; then
- echo "${theme_name} not found"
- else
- # Option to tweak theme with lxappearance (after theme instalation)
- read -p "Tweak theme with Lxappearance ? (Y/n) " yn
- case $yn in
- [Nn]* ) exit ;;
- * ) lxappearance && clear ;;
- esac
- fi
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement