wok-6.x view madeirado-theme/receipt @ rev 25375
Update some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jul 30 08:30:06 2022 +0000 (2022-07-30) |
parents | 40fab26c175d |
children | 7f7bd3c9775e |
line source
1 # SliTaz package receipt.
3 PACKAGE="madeirado-theme"
4 VERSION="20130702"
5 CATEGORY="customization"
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"
13 #HOST_ARCH="any" # imagemagick missing in arm
15 DEPENDS="gtk-clearlooks openbox slim"
16 BUILD_DEPENDS="wget imagemagick"
18 # What is the latest version available today?
19 current_version()
20 {
21 wget -O - $WEB_SITE 2>/dev/null | \
22 sed 's|}|}\n|g;s|</|</\n|g' | sed '/dateTime=/!d;s|.*dateTime=.||;s|T.*||;s|-||g;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 M=Madeirado
29 s=$install/usr/share/slim/themes
30 t=$install/usr/share/themes
31 i=$install/usr/share/images
32 mkdir -p $s $t $i
34 # SLiM theme
35 cp -a $src/slim/$M $s
36 (
37 cd $s/$M
38 convert background.png background.jpg
39 rm background.png
40 )
42 # GTK theme
43 cp -a $src/theme/$M $t
44 # (fix warnings about unsupported options)
45 sed -i 's|^.*menuitemstyle|#&|; s|^.*listviewitemstyle|#&|;
46 s|^.*progressbarstyle|#&|' $t/$M/gtk-2.0/gtkrc
48 # wallpaper
49 ln -s ../slim/themes/$M/background.jpg $i/$M.jpg
50 }
52 # Rules to gen a SliTaz package suitable for Tazpkg.
53 genpkg_rules()
54 {
55 cp -a $install/* $fs
56 }
58 post_install()
59 {
60 # Set GTK+ Theme
61 for i in $1/etc/xdg/lxsession/*/desktop.conf \
62 $1/home/*/.config/lxsession/*/desktop.conf; do
63 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Madeirado|' $i
64 done
65 pgrep lxsession >/dev/null && lxsession -r
67 # Set Openbox theme
68 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
69 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>Madeirado<|' $i
70 done
71 pgrep openbox >/dev/null && openbox --reconfigure
73 # Set SLiM theme
74 chroot "$1/" slim-theme -s Madeirado
76 # Set PCManFM wallpaper
77 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
78 $1/home/*/.config/pcmanfm/*/*.conf; do
79 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/Madeirado.jpg|' $i
80 done
81 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
82 # Change wallpaper for current PCManFM session right now
83 su -c 'pcmanfm -w /usr/share/images/Madeirado.jpg' \
84 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
85 fi
86 }
88 pre_remove() {
89 # Restore GTK+ Theme (Clearlooks Human)
90 for i in $1/etc/xdg/lxsession/*/desktop.conf \
91 $1/home/*/.config/lxsession/*/desktop.conf; do
92 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Clearlooks Human|' $i
93 done
94 pgrep lxsession >/dev/null && lxsession -r
96 # Restore Openbox theme (SliTaz)
97 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
98 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>SliTaz<|' $i
99 done
100 pgrep openbox >/dev/null && openbox --reconfigure
102 # Restore SLiM theme
103 chroot "$1/" slim-theme -f Madeirado
105 # Restore PCManFM wallpaper (slitaz-background.jpg)
106 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
107 $1/home/*/.config/pcmanfm/*/*.conf; do
108 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/slitaz-background.jpg|' $i
109 done
110 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
111 # Change wallpaper for current PCManFM session right now
112 su -c 'pcmanfm -w /usr/share/images/slitaz-background.jpg' \
113 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
114 fi
115 }