#!/bin/sh
# test we are root
if [ "$(id -u)" != "0" ]; then
   echo "run as root now exitting"
   exit 1
fi

P=oxy-neon-cursor-theme
V=0.2
SRC=oxy-neon
USER=`cat /etc/sysconfig/tcuser`
LIST="submitqc "			
for Z in $LIST 
    do 
    su -c "tce-load -i $Z" $USER
done

cd /tmp
# fails
D1=https://dllb2.pling.com/api/files/download/j
D2=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjE0NjA3MzU0NTciLCJ1IjpudWxsLCJsdCI6ImRvd25sb2FkIiwicyI6IjIwNTczNjI0NDFmNDhhYjQyODc2YjMzZTllNTBkMWZmYjk4NDQ1YmExMzFkODM0MzJlMzViMmYyYWM4MDcwNmY3NDg0YWM1ZDdmOTUxYWU1YjE0OGE3YTJmYmEzMzEwOTRiNTRkNWZjZGRhMzQ1MDE4NzdhNGIyMjdmMjNmYjgxIiwidCI6MTU5NjQ0MzA5MCwic3RmcCI6IjIzOWE1YTRlYmNmYjdhYTJkMmMyYzYwNWNiMTFjMDg4Iiwic3RpcCI6IjE4MC4xNTAuODAuMjQ2In0.YQex9mR86cxtomvXMi-OzTxYeQjFA4gbSzCcjz2hz2Q
D3=137109-oxy-neon-0.2.tar.gz

# su -c "/usr/local/bin/wget -nc --no-check-certificate \
# $D1/$D2/$D3" $USER  
tar xvf 137109-oxy-neon-0.2.tar.gz
mkdir -p $P/usr/local/share/icons
mv $SRC $P/usr/local/share/icons

# no licence found


# TCZ them
#######
LIST="$P "
for Z in $LIST
do
	mksquashfs $Z $Z.tcz
	md5sum $Z.tcz > $Z.tcz.md5.txt
	cd $Z
	find usr -not -type d > /tmp/$Z.tcz.list
    sed 's|usr|/usr|g' -i /tmp/$Z.tcz.list
	cd /tmp
done

ls -hal


echo 'Title:          oxy-neon-cursor-theme.tcz  
Description:    gtk2 or gtk3 cursor theme
Version:        0.2
Author:         Leonardo Totaro  
Original-site:  https://www.gnome-look.org/p/999997/
Copying-policy: opensource
Size:           252K		
Extension_by:   aus9 
Tags:           cursor theme
Comments:       Edit gtk3 config if interested for
                ~/.config/gtk-3.0/settings.ini 
                gtk-cursor-theme-name = oxy-neon
                
                Edit gtk2 config if interested for 
                ~/.gtkrc-2.0/
                gtk-cursor-theme-name="oxy-neon"
                
                You will need to exit and restart
                the gtk app to see the changes 
                
Change-log:     2020/08/03 Original 0.2 on 11x
Current:        2020/08/03 ' > $P.tcz.info


submitqc --libs
