wok-next view aurorials-theme/receipt @ rev 19001
Use variables in $TARBALL
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Mar 23 11:51:37 2016 +0200 (2016-03-23) |
parents | e068415d64ee |
children | 887b3b11683d |
line source
1 # SliTaz package receipt.
3 PACKAGE="aurorials-theme"
4 VERSION="20130704"
5 CATEGORY="misc"
6 SHORT_DESC="Aurorials theme for GTK2, Openbox, SLiM, and wallparer"
7 MAINTAINER="al.bobylev@gmail.com"
8 LICENSE="GPL3"
9 WEB_SITE="http://holkfoor.deviantart.com/art/Aurorials-pack-themes-382752941"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WGET_URL="https://dl.dropboxusercontent.com/s/urt40kxaladwpeu/Aurorials_GTK2_Openbox_Slim_Wallpaper.tar.bz2"
12 TAGS="holkfoor openbox slim wallpaper"
14 DEPENDS="gtk2-engine-murrine openbox slim"
15 BUILD_DEPENDS="wget imagemagick"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 A=Aurorials
21 s=$install/usr/share/slim/themes
22 t=$install/usr/share/themes
23 i=$install/usr/share/images
24 mkdir -p $s $t $i
26 # SLiM theme
27 cp -a $src/Slim/$A $s
28 (
29 cd $s/$A;
30 convert background.png background.jpg;
31 rm background.png
32 )
34 # GTK theme
35 cp -a $src/GTK2/$A $t
36 # (fix warnings about unsupported options)
37 sed -i 's|^.*gradients|#&|' $t/$A/gtk-2.0/gtkrc
39 # wallpaper
40 ln -s ../slim/themes/$A/background.jpg $i/$A.jpg
41 }
43 # Rules to gen a SliTaz package suitable for Tazpkg.
44 genpkg_rules()
45 {
46 cp -a $install/* $fs
47 }
49 post_install()
50 {
51 # Set GTK+ Theme
52 for i in $1/etc/xdg/lxsession/*/desktop.conf \
53 $1/home/*/.config/lxsession/*/desktop.conf; do
54 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Aurorials|' $i
55 done
56 pgrep lxsession >/dev/null && lxsession -r
58 # Set Openbox theme
59 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
60 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>Aurorials<|' $i
61 done
62 pgrep openbox >/dev/null && openbox --reconfigure
64 # Set SLiM theme
65 chroot "$1/" slim-theme -s Aurorials
67 # Set PCManFM wallpaper
68 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
69 $1/home/*/.config/pcmanfm/*/*.conf; do
70 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/Aurorials.jpg|' $i
71 done
72 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
73 # Change wallpaper for current PCManFM session right now
74 su -c 'pcmanfm -w /usr/share/images/Aurorials.jpg' \
75 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
76 fi
77 }
79 pre_remove() {
80 # Restore GTK+ Theme (Clearlooks Human)
81 for i in $1/etc/xdg/lxsession/*/desktop.conf \
82 $1/home/*/.config/lxsession/*/desktop.conf; do
83 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Clearlooks Human|' $i
84 done
85 pgrep lxsession >/dev/null && lxsession -r
87 # Restore Openbox theme (SliTaz)
88 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
89 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>SliTaz<|' $i
90 done
91 pgrep openbox >/dev/null && openbox --reconfigure
93 # Restore SLiM theme
94 chroot "$1/" slim-theme -f Madeirado
96 # Restore PCManFM wallpaper (slitaz-background.jpg)
97 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
98 $1/home/*/.config/pcmanfm/*/*.conf; do
99 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/slitaz-background.jpg|' $i
100 done
101 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
102 # Change wallpaper for current PCManFM session right now
103 su -c 'pcmanfm -w /usr/share/images/slitaz-background.jpg' \
104 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
105 fi
106 }