summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWeitian Leung2018-03-05 22:05:05 +0800
committerWeitian Leung2018-03-05 22:05:05 +0800
commit6f5ef7712007ce45a44de9b0ac7cb25833eeb788 (patch)
tree642548646f9bbea33db7830efa80f3e918ce89d0
parenta79743c1a1710100aac81a23c8742475eea5a0a1 (diff)
downloadaur-6f5ef7712007ce45a44de9b0ac7cb25833eeb788.tar.gz
Switch to golang
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD38
-rwxr-xr-xbing-wallpaper-autostart.sh18
-rw-r--r--bing-wallpaper-git.install8
-rw-r--r--bing-wallpaper.desktop12
5 files changed, 32 insertions, 60 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 39842769aa48..8cf12a47aa4c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,21 @@
# Generated by mksrcinfo v8
-# Sun Dec 24 13:26:16 UTC 2017
+# Mon Mar 5 13:50:55 UTC 2018
pkgbase = bing-wallpaper-git
- pkgdesc = Change wallpaper from Bing daily
- pkgver = r40
+ pkgdesc = Bing Wallpaper of the Day as your Linux Desktop's wallpaper
+ pkgver = r46
pkgrel = 1
url = https://github.com/marguerite/linux-bing-wallpaper
+ install = bing-wallpaper-git.install
arch = any
license = GPL3
makedepends = git
- depends = curl
- depends = bc
+ makedepends = go
optdepends = xfconf: for xfce4 support
optdepends = pcmanfm-qt: for lxqt support
+ optdepends = xdotool: for kde4 support
+ optdepends = gettext: for kde4 support
source = bing-wallpaper-git::git+https://github.com/marguerite/linux-bing-wallpaper.git
- source = bing-wallpaper-autostart.sh
- source = bing-wallpaper.desktop
sha512sums = SKIP
- sha512sums = 131de9d1c55eb74760869d5ebaf64b722c43cafa2be90a3413d5e0d8c60bc62190825d44ba9155275bf3868d0b37869e3ad51878cf1d6d611562c4ba5b814c76
- sha512sums = 83025c7c9e1957488f1e4bb385b599e8f17ca778a614f2bf8759cc99a9754e360ff1ecb8188eef7f9a7dbb8d2c6f93e6af4c8f441f88a6b2973e9737777b2d49
pkgname = bing-wallpaper-git
diff --git a/PKGBUILD b/PKGBUILD
index e562f7fe363e..1801238d467f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,37 +1,33 @@
# Maintainer: Weitian Leung <weitianleung[at]gmail[dot]com>
pkgname=bing-wallpaper-git
-pkgver=r40
+pkgver=r46
pkgrel=1
-pkgdesc="Change wallpaper from Bing daily"
+pkgdesc="Bing Wallpaper of the Day as your Linux Desktop's wallpaper"
arch=(any)
url="https://github.com/marguerite/linux-bing-wallpaper"
license=('GPL3')
-depends=('curl' 'bc')
optdepends=('xfconf: for xfce4 support'
- 'pcmanfm-qt: for lxqt support')
-makedepends=('git')
-source=("$pkgname::git+https://github.com/marguerite/linux-bing-wallpaper.git"
- 'bing-wallpaper-autostart.sh'
- 'bing-wallpaper.desktop')
-sha512sums=('SKIP'
- '131de9d1c55eb74760869d5ebaf64b722c43cafa2be90a3413d5e0d8c60bc62190825d44ba9155275bf3868d0b37869e3ad51878cf1d6d611562c4ba5b814c76'
- '83025c7c9e1957488f1e4bb385b599e8f17ca778a614f2bf8759cc99a9754e360ff1ecb8188eef7f9a7dbb8d2c6f93e6af4c8f441f88a6b2973e9737777b2d49')
+ 'pcmanfm-qt: for lxqt support'
+ 'xdotool: for kde4 support'
+ 'gettext: for kde4 support')
+makedepends=('git' 'go')
+source=("$pkgname::git+https://github.com/marguerite/linux-bing-wallpaper.git")
+sha512sums=('SKIP')
+install=${pkgname}.install
pkgver() {
cd "${srcdir}/${pkgname}"
printf "r%s" "$(git rev-list --count HEAD)"
}
-package() {
- install -d -m 755 "${pkgdir}/usr/lib/bing-wallpaper"
- install -d -m 755 "${pkgdir}/usr/bin"
- install -d -m 755 "${pkgdir}/etc/xdg/autostart"
-
- install -m 755 "${srcdir}/${pkgname}/bing_wallpaper.sh" "${pkgdir}/usr/lib/bing-wallpaper"
- install -m 755 "${srcdir}/${pkgname}/kde4_set_wallpaper.sh" "${pkgdir}/usr/lib/bing-wallpaper"
- install -m 755 "${srcdir}/${pkgname}/xfce4_set_wallpaper.sh" "${pkgdir}/usr/lib/bing-wallpaper"
+build() {
+ cd "${srcdir}/${pkgname}"
+ go build bing-wallpaper.go
+}
- install -m 755 bing-wallpaper-autostart.sh "${pkgdir}/usr/bin"
- install -m 644 bing-wallpaper.desktop "$pkgdir/etc/xdg/autostart"
+package() {
+ build_dir="${srcdir}/${pkgname}"
+ install -Dm755 "${build_dir}/bing-wallpaper" "${pkgdir}/usr/bin/bing-wallpaper"
+ install -Dm644 "${build_dir}/bing-wallpaper.service" "${pkgdir}/usr/lib/systemd/user/bing-wallpaper.service"
}
diff --git a/bing-wallpaper-autostart.sh b/bing-wallpaper-autostart.sh
deleted file mode 100755
index e1ea281511f6..000000000000
--- a/bing-wallpaper-autostart.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-# try 3 times only
-i=1
-while [ $i -le 3 ]; do
- if curl --connect-timeout 2 -s www.bing.com > /dev/null ; then
- break
- fi
-
- seconds=$((15 * $i))
- sleep $seconds
-
- let i=i+1
-done
-
-# starting the work even without network availability
-cd /usr/lib/bing-wallpaper
-./bing_wallpaper.sh
diff --git a/bing-wallpaper-git.install b/bing-wallpaper-git.install
new file mode 100644
index 000000000000..2d2b23297840
--- /dev/null
+++ b/bing-wallpaper-git.install
@@ -0,0 +1,8 @@
+post_install() {
+ echo "-------------------------------------------------------------------------------------------------------"
+ echo "Run 'systemctl --user start bing-wallpaper.service' to start the service"
+ echo "Run 'systemctl --user enable bing-wallpaper.service' for autostart bing-wallpaper."
+ echo "You may need set the enviroment variables to make it works."
+ echo "See https://wiki.archlinux.org/index.php/Systemd/User#Environment_variables"
+ echo "-------------------------------------------------------------------------------------------------------"
+}
diff --git a/bing-wallpaper.desktop b/bing-wallpaper.desktop
deleted file mode 100644
index d01bb89e20fb..000000000000
--- a/bing-wallpaper.desktop
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Name=Bing Wallpaper
-Name[zh_CN]=Bing壁纸
-Comment=Bing Wallpaper
-Comment[zh_CN]=Bing壁纸
-Exec=/usr/bin/bing-wallpaper-autostart.sh
-Type=Application
-Terminal=false
-StartupNotify=false
-X-GNOME-Autostart-Phase=Applications
-X-GNOME-AutoRestart=false
-X-GNOME-Autostart-Notify=false