OSDN Git Service

[add] : Added lxde hooks.
authorhayao <shun819.mail@gmail.com>
Tue, 30 Jun 2020 10:19:36 +0000 (19:19 +0900)
committerhayao <shun819.mail@gmail.com>
Tue, 30 Jun 2020 10:19:36 +0000 (19:19 +0900)
stable/alterlinux-wallpapers/PKGBUILD
stable/alterlinux-wallpapers/alterlinux-wallpapers-lxde [new file with mode: 0755]
stable/alterlinux-wallpapers/alterlinux-wallpapers-lxde-blue.hook [new file with mode: 0644]

index cfacf8a..43f2664 100644 (file)
@@ -1,7 +1,8 @@
 # Maintainer : Yamada Hayao <development@fascode.net>
 # Maintainer : lap1sid <development@fascode.net>
+
 pkgname=alterlinux-wallpapers
-pkgver=4.0
+pkgver=5.0
 pkgrel=1
 pkgdesc='AlterLinux wallpapers'
 arch=('any')
@@ -14,7 +15,12 @@ source=("alter.png"
         "alterlinux-wallpapers-xfce"
         "alterlinux-wallpapers-xfce-blue.hook"
         "alterlinux-wallpapers-xfce-stripes.hook"
-        "alterlinux-wallpapers-xfce-teal.hook")
+        "alterlinux-wallpapers-xfce-teal.hook"
+
+        "alterlinux-wallpapers-lxde"
+        "alterlinux-wallpapers-lxde-blue.hook"
+        )
+    
 md5sums=('75bbf3e0c33d0d7f4e09e9a5489691ff'
         '42b477468bc5d88825b41e8522552ad3'
         'ca58c394911aa211c5712fabbad23fe2'
@@ -23,16 +29,29 @@ md5sums=('75bbf3e0c33d0d7f4e09e9a5489691ff'
         "845f106696fbac435126babebd728185"
         "e05b85d07afede613e2a3f7e8e5ee2d4"
         "1c55857c4ab27651ce4db065814df1f0"
-        "768f565556b2a8bb92696cb16565e06a")
+        "768f565556b2a8bb92696cb16565e06a"
+
+        "05124dd7026d6a7c2c9fe7dc70c22ee4"
+        "b46be67cdc617d5aff42d13308d9ef91"
+)
 package() {
+    # Install images
     cd "${srcdir}"
-    install -Dm644 "${srcdir}/alter.png" "${pkgdir}/usr/share/backgrounds/alter.png"
-    install -Dm644 "${srcdir}/alter-old.png" "${pkgdir}/usr/share/backgrounds/alter-old.png"
-    install -Dm644 "${srcdir}/alter-jiju.png" "${pkgdir}/usr/share/backgrounds/alter-jiju.png"
-    install -Dm644 "${srcdir}/alter-nochr.png" "${pkgdir}/usr/share/backgrounds/alter-nochr.png"
+    for image in $(ls ${srcdir}/alter-*.png); do
+       install -Dm644 "${srcdir}/$(basename ${image})" "${pkgdir}/usr/share/backgrounds/$(basename ${image})"
+    done
+
+    # OLD CODE
+    #install -Dm644 "${srcdir}/alter.png" "${pkgdir}/usr/share/backgrounds/alter.png"
+    #install -Dm644 "${srcdir}/alter-old.png" "${pkgdir}/usr/share/backgrounds/alter-old.png"
+    #install -Dm644 "${srcdir}/alter-jiju.png" "${pkgdir}/usr/share/backgrounds/alter-jiju.png"
+    #install -Dm644 "${srcdir}/alter-nochr.png" "${pkgdir}/usr/share/backgrounds/alter-nochr.png"
 
+    # Install Scripts
     install -Dm755 "${srcdir}/alterlinux-wallpapers-xfce" "${pkgdir}/usr/share/libalpm/scripts/alterlinux-wallpapers-xfce"
+    install -Dm755 "${srcdir}/alterlinux-wallpapers-lxde" "${pkgdir}/usr/share/libalpm/scripts/alterlinux-wallpapers-lxde"
 
+    # Install hooks
     local hook
     for hook in $(ls ${srcdir}/*.hook); do
         install -Dm644 "${srcdir}/$(basename ${hook})" "${pkgdir}/usr/share/libalpm/hooks/$(basename ${hook})"
diff --git a/stable/alterlinux-wallpapers/alterlinux-wallpapers-lxde b/stable/alterlinux-wallpapers/alterlinux-wallpapers-lxde
new file mode 100755 (executable)
index 0000000..1a8492d
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+# Delete file only if file exists
+# remove <file1> <file2> ...
+function remove () {
+    local _list
+    local _file
+    _list=($(echo "$@"))
+    for _file in "${_list[@]}"; do
+        if [[ -f ${_file} ]]; then
+            rm -f "${_file}"
+        elif [[ -d ${_file} ]]; then
+            rm -rf "${_file}"
+        fi
+    done
+}
+
+image="${1}"
+replace="${2}"
+
+# Replace wallpaper.
+remove 
+ln -s "/usr/share/backgrounds/${replace}.png" "/usr/share/lxde/wallpapers/lxde_${image}.jpg"
+chmod 644 "/usr/share/backgrounds/${replace}.png"
\ No newline at end of file
diff --git a/stable/alterlinux-wallpapers/alterlinux-wallpapers-lxde-blue.hook b/stable/alterlinux-wallpapers/alterlinux-wallpapers-lxde-blue.hook
new file mode 100644 (file)
index 0000000..a8bd28a
--- /dev/null
@@ -0,0 +1,13 @@
+[Trigger]
+Type = Path
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/share/lxde/wallpapers/lxde_blue.jpg
+
+[Action]
+Description = Optimizing wallpaper (xfce-blue) ...
+When = PostTransaction
+Depends=alterlinux-wallpapers
+Exec = /usr/share/libalpm/scripts/alterlinux-wallpapers-lxde blue alter
+NeedsTargets