Commit fe56e82a authored by Philip Müller's avatar Philip Müller

[scripts] add makefile and xml

parent 13ef5c23
#!/usr/bin/make -f
THEME = wallpapers-2018
DTHEME = wallpapers-2018
PREFIX = /usr
DPATH = $(DESTDIR)$(PREFIX)/share/backgrounds/$(DTHEME)
DXMLGNOME = $(DESTDIR)$(PREFIX)/share/gnome-background-properties
DXMLMATE = $(DESTDIR)$(PREFIX)/share/mate-background-properties
DEL = rm -Rf
INSTD = install -Dm644 -t
install:
./backgrounds-xml.sh
mkdir -p $(DXMLGNOME)
cp -f $(THEME).xml $(DXMLGNOME)
mkdir -p $(DXMLMATE)
cp -f $(THEME).xml $(DXMLMATE)
$(INSTD) $(DPATH) *.jpg
uninstall:
$(DEL) $(DPATH)
rm -f $(DXMLGNOME)/$(THEME).xml
rm -f $(DXMLMATE)/$(THEME).xml
#!/bin/bash
#set variable
THEME=$(awk '/THEME/ {print $3; exit}' Makefile ) #set automatically name of theme from Makefile
ABSPATH=/usr/share/backgrounds/$THEME/
if [ -e $THEME.xml ]; then
rm $THEME.xml
fi
# creating the head of backgrounds.xml
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE wallpapers SYSTEM \"gnome-wp-list.dtd\">
<wallpapers>" > $THEME.xml
# looking for all pictures in DIRECTORY
echo "OK. Now we are creating $THEME.xml"
# This script is looking for .png and .jpg files only, but you can add here another file types. The "<options>stretched</options>" should work best for unknow sized files.
for i in $(ls *jpg); do #Note if we add png files simply add $(ls *png)
echo "<wallpaper deleted="\"false\"">
<name>${i::(-4)}</name>
<filename>${ABSPATH}$i</filename>
<options>stretched</options>
<pcolor>#ffffff</pcolor>
<scolor>#000000</scolor>
<shade_type>solid</shade_type>
</wallpaper>" >> $THEME.xml
done
# creating the bottom of backgrounds.xml
echo "</wallpapers>" >> $THEME.xml
echo
echo "#################################"
echo "DONE xml file created"
echo "#################################"
echo
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment