wok view madeirado-theme/receipt @ rev 19941

memtest: remove help command line, useless
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu May 04 12:47:15 2017 +0200 (2017-05-04)
parents 887b3b11683d
children 4ce52a0b72fd
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 # Rules to configure and make the package.
19 compile_rules()
20 {
21 M=Madeirado
22 s=$install/usr/share/slim/themes
23 t=$install/usr/share/themes
24 i=$install/usr/share/images
25 mkdir -p $s $t $i
27 # SLiM theme
28 cp -a $src/slim/$M $s
29 (
30 cd $s/$M
31 convert background.png background.jpg
32 rm background.png
33 )
35 # GTK theme
36 cp -a $src/theme/$M $t
37 # (fix warnings about unsupported options)
38 sed -i 's|^.*menuitemstyle|#&|; s|^.*listviewitemstyle|#&|;
39 s|^.*progressbarstyle|#&|' $t/$M/gtk-2.0/gtkrc
41 # wallpaper
42 ln -s ../slim/themes/$M/background.jpg $i/$M.jpg
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 cp -a $install/* $fs
49 }
51 post_install()
52 {
53 # Set GTK+ Theme
54 for i in $1/etc/xdg/lxsession/*/desktop.conf \
55 $1/home/*/.config/lxsession/*/desktop.conf; do
56 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Madeirado|' $i
57 done
58 pgrep lxsession >/dev/null && lxsession -r
60 # Set Openbox theme
61 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
62 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>Madeirado<|' $i
63 done
64 pgrep openbox >/dev/null && openbox --reconfigure
66 # Set SLiM theme
67 chroot "$1/" slim-theme -s Madeirado
69 # Set PCManFM wallpaper
70 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
71 $1/home/*/.config/pcmanfm/*/*.conf; do
72 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/Madeirado.jpg|' $i
73 done
74 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
75 # Change wallpaper for current PCManFM session right now
76 su -c 'pcmanfm -w /usr/share/images/Madeirado.jpg' \
77 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
78 fi
79 }
81 pre_remove() {
82 # Restore GTK+ Theme (Clearlooks Human)
83 for i in $1/etc/xdg/lxsession/*/desktop.conf \
84 $1/home/*/.config/lxsession/*/desktop.conf; do
85 [ -f "$i" ] && sed -i 's|sNet/ThemeName=.*|sNet/ThemeName=Clearlooks Human|' $i
86 done
87 pgrep lxsession >/dev/null && lxsession -r
89 # Restore Openbox theme (SliTaz)
90 for i in /etc/xdg/openbox/rc.xml /home/*/.config/openbox/rc.xml; do
91 [ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>SliTaz<|' $i
92 done
93 pgrep openbox >/dev/null && openbox --reconfigure
95 # Restore SLiM theme
96 chroot "$1/" slim-theme -f Madeirado
98 # Restore PCManFM wallpaper (slitaz-background.jpg)
99 for i in $1/etc/xdg/pcmanfm/default/pcmanfm.conf \
100 $1/home/*/.config/pcmanfm/*/*.conf; do
101 [ -f "$i" ] && sed -i 's|wallpaper[0-9]*=.*|wallpaper=/usr/share/images/slitaz-background.jpg|' $i
102 done
103 if [ -z "$1" -a -n "$(pgrep pcmanfm)" ]; then
104 # Change wallpaper for current PCManFM session right now
105 su -c 'pcmanfm -w /usr/share/images/slitaz-background.jpg' \
106 $(ps aux | grep '[p]cmanfm' | awk 'END{print $2}')
107 fi
108 }