wok-current view aurorials-theme/receipt @ rev 18888
Add aurorials-theme and madeirado-theme (Art by Leonardo Laporte, theme switchers mine)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Feb 12 15:51:10 2016 +0200 (2016-02-12) |
parents | |
children | f8b381f96ad6 |
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"
13 DEPENDS="gtk2-engine-murrine openbox slim"
14 BUILD_DEPENDS="imagemagick"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 A=Aurorials
20 s=$install/usr/share/slim/themes
21 t=$install/usr/share/themes
22 i=$install/usr/share/images
23 mkdir -p $s $t $i
25 # SLiM theme
26 cp -a $src/Slim/$A $s
27 (
28 cd $s/$A;
29 convert background.png background.jpg;
30 rm background.png
31 )
33 # GTK theme
34 cp -a $src/GTK2/$A $t
35 # (fix warnings about unsupported options)
36 sed -i 's|^.*gradients|#&|' $t/$A/gtk-2.0/gtkrc
38 # wallpaper
39 ln -s ../slim/themes/$A/background.jpg $i/$A.jpg
40 }
42 # Rules to gen a SliTaz package suitable for Tazpkg.
43 genpkg_rules()
44 {
45 cp -a $install/* $fs
46 }
48 post_install()
49 {
50 # Set GTK+ Theme
51 for i in $1/etc/xdg/lxsession/*/desktop.conf \
52 $1/home/*/.config/lxsession/*/desktop.conf; do
53 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Aurorials|' $i
54 done
55 pgrep lxsession && lxsession -r
57 # Set Openbox theme
58 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
59 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>Aurorials<|' $i
60 done
61 pgrep openbox && openbox --reconfigure
63 # Set SLiM theme
64 chroot "$1/" slim-theme -s Aurorials
66 # Set PCManFM wallpaper
67 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
68 $1/home/*/.config/pcmanfm/*/*.conf; do
69 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/Aurorials.jpg|' $i
70 done
71 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
72 # Change wallpaper for current PCManFM session right now
73 su -c 'pcmanfm -w /usr/share/images/Aurorials.jpg' \
74 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
75 fi
76 }
78 pre_remove() {
79 # Restore GTK+ Theme (Clearlooks Human)
80 for i in $1/etc/xdg/lxsession/*/desktop.conf \
81 $1/home/*/.config/lxsession/*/desktop.conf; do
82 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Clearlooks Human|' $i
83 done
84 pgrep lxsession && lxsession -r
86 # Restore Openbox theme (SliTaz)
87 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
88 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>SliTaz<|' $i
89 done
90 pgrep openbox && openbox --reconfigure
92 # Restore SLiM theme
93 chroot "$1/" slim-theme -f Madeirado
95 # Restore PCManFM wallpaper (slitaz-background.jpg)
96 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
97 $1/home/*/.config/pcmanfm/*/*.conf; do
98 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/slitaz-background.jpg|' $i
99 done
100 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
101 # Change wallpaper for current PCManFM session right now
102 su -c 'pcmanfm -w /usr/share/images/slitaz-background.jpg' \
103 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
104 fi
105 }