wok view madeirado-theme/receipt @ rev 18984

clementine: update bdeps
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Mar 16 21:28:57 2016 +0200 (2016-03-16)
parents e068415d64ee
children 887b3b11683d
line source
1 # SliTaz package receipt.
3 PACKAGE="madeirado-theme"
4 VERSION="20130702"
5 CATEGORY="misc"
6 SHORT_DESC="Madeirado theme for GTK2, Openbox, SLiM, and wallparer"
7 MAINTAINER="al.bobylev@gmail.com"
8 LICENSE="GPL3"
9 WEB_SITE="http://holkfoor.deviantart.com/art/Madeirado-Pack-Theme-382214228"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WGET_URL="https://dl.dropboxusercontent.com/s/ax6iqx6aa344fsu/Madeirado_GTK2_Openbox_Slim_Wallpaper.tar.bz2"
12 TAGS="holkfoor openbox slim wallpaper"
14 DEPENDS="gtk-clearlooks openbox slim"
15 BUILD_DEPENDS="wget imagemagick"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 M=Madeirado
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/$M $s
28 (
29 cd $s/$M
30 convert background.png background.jpg
31 rm background.png
32 )
34 # GTK theme
35 cp -a $src/theme/$M $t
36 # (fix warnings about unsupported options)
37 sed -i 's|^.*menuitemstyle|#&|; s|^.*listviewitemstyle|#&|;
38 s|^.*progressbarstyle|#&|' $t/$M/gtk-2.0/gtkrc
40 # wallpaper
41 ln -s ../slim/themes/$M/background.jpg $i/$M.jpg
42 }
44 # Rules to gen a SliTaz package suitable for Tazpkg.
45 genpkg_rules()
46 {
47 cp -a $install/* $fs
48 }
50 post_install()
51 {
52 # Set GTK+ Theme
53 for i in $1/etc/xdg/lxsession/*/desktop.conf \
54 $1/home/*/.config/lxsession/*/desktop.conf; do
55 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Madeirado|' $i
56 done
57 pgrep lxsession >/dev/null && lxsession -r
59 # Set Openbox theme
60 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
61 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>Madeirado<|' $i
62 done
63 pgrep openbox >/dev/null && openbox --reconfigure
65 # Set SLiM theme
66 chroot "$1/" slim-theme -s Madeirado
68 # Set PCManFM wallpaper
69 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
70 $1/home/*/.config/pcmanfm/*/*.conf; do
71 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/Madeirado.jpg|' $i
72 done
73 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
74 # Change wallpaper for current PCManFM session right now
75 su -c 'pcmanfm -w /usr/share/images/Madeirado.jpg' \
76 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
77 fi
78 }
80 pre_remove() {
81 # Restore GTK+ Theme (Clearlooks Human)
82 for i in $1/etc/xdg/lxsession/*/desktop.conf \
83 $1/home/*/.config/lxsession/*/desktop.conf; do
84 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Clearlooks Human|' $i
85 done
86 pgrep lxsession >/dev/null && lxsession -r
88 # Restore Openbox theme (SliTaz)
89 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
90 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>SliTaz<|' $i
91 done
92 pgrep openbox >/dev/null && openbox --reconfigure
94 # Restore SLiM theme
95 chroot "$1/" slim-theme -f Madeirado
97 # Restore PCManFM wallpaper (slitaz-background.jpg)
98 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
99 $1/home/*/.config/pcmanfm/*/*.conf; do
100 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/slitaz-background.jpg|' $i
101 done
102 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
103 # Change wallpaper for current PCManFM session right now
104 su -c 'pcmanfm -w /usr/share/images/slitaz-background.jpg' \
105 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
106 fi
107 }