summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrien Jussak2019-03-26 13:58:28 +0100
committerAdrien Jussak2019-03-26 13:58:28 +0100
commit6fcd38c309170e079153f456f5539f577d3df399 (patch)
tree38fcad05cfde32961df5341f8ba369cc69a8359a
downloadaur-6fcd38c309170e079153f456f5539f577d3df399.tar.gz
First Commit
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD43
-rw-r--r--prime-switcher.install15
3 files changed, 78 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..8f2849fc229
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = prime-switcher
+ pkgdesc = Tool (GUI + CLI) to select used GPU for Optimus Laptop
+ pkgver = 1.0
+ pkgrel = 1
+ url = https://gitlab.com/tuxnvape/prime-switcher
+ install = prime-switcher.install
+ arch = any
+ license = GPLv3
+ depends = python-gobject
+ depends = libappindicator-gtk3
+ depends = gtk3
+ depends = libnotify
+ depends = mesa-demos
+ depends = gettext
+ optdepends = bbswitch: For power saving with NVIDIA discrete GPU
+ source = https://gitlab.com/tuxnvape/prime-switcher/-/archive/v1.0/prime-switcher-v1.0.tar.gz
+ sha256sums = 7a103467a8cf1b1b74eb21422c470f21db6d9efb5b8fb1affeb9ea27026fa2cc
+
+pkgname = prime-switcher
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..36a638b315d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Adrien Jussak <adrien.jussak@wascardev.com>
+
+pkgname="prime-switcher"
+pkgver=1.0
+pkgrel=1
+pkgdesc="Tool (GUI + CLI) to select used GPU for Optimus Laptop"
+arch=('any')
+url='https://gitlab.com/tuxnvape/prime-switcher'
+depends=('python-gobject' 'libappindicator-gtk3' 'gtk3' 'libnotify' 'mesa-demos' 'gettext')
+optdepends=('bbswitch: For power saving with NVIDIA discrete GPU')
+license=('GPLv3')
+install=prime-switcher.install
+
+source=("https://gitlab.com/tuxnvape/prime-switcher/-/archive/v${pkgver}/prime-switcher-v${pkgver}.tar.gz")
+
+sha256sums=("7a103467a8cf1b1b74eb21422c470f21db6d9efb5b8fb1affeb9ea27026fa2cc")
+
+build() {
+ _src="${srcdir}/${pkgname}-v${pkgver}"
+ find ${_src}/locales -name \*.po -execdir msgfmt prime-switcher.po -o prime-switcher.mo \;
+}
+
+package() {
+ _src="${srcdir}/${pkgname}-v${pkgver}"
+ mkdir -p ${pkgdir}/usr/share/${pkgname}
+ mkdir -p ${pkgdir}/usr/lib/${pkgname}
+ mkdir -p ${pkgdir}/etc/${pkgname}
+ mkdir -p ${pkgdir}/usr/share/locale
+ mkdir -p ${pkgdir}/usr/bin
+ mkdir -p ${pkgdir}/usr/share/icons/hicolor/
+ mkdir -p ${pkgdir}/etc/xdg/autostart/
+
+ cp -r ${_src}/configs/* ${pkgdir}/etc/${pkgname}/
+ cp -r ${_src}/assets/* ${pkgdir}/usr/share/${pkgname}
+ cp ${_src}/src/* ${pkgdir}/usr/lib/${pkgname}
+ cp -r ${_src}/icons/* ${pkgdir}/usr/share/icons/hicolor/
+ ln -s ../lib/${pkgname}/__main__.py ${pkgdir}/usr/bin/${pkgname}
+ cp ${_src}/prime-switcher.desktop ${pkgdir}/etc/xdg/autostart/
+
+ cd ${_src}/locales/
+ find . -name '*.mo' -exec cp --parents \{\} ${pkgdir}/usr/share/locale/ \;
+}
+
diff --git a/prime-switcher.install b/prime-switcher.install
new file mode 100644
index 00000000000..1f163f58581
--- /dev/null
+++ b/prime-switcher.install
@@ -0,0 +1,15 @@
+pkgname=prime-switcher
+
+post_install() {
+ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
+ prime-switcher -D -s power-saving
+}
+
+pre_remove() {
+ prime-switcher --uninstall
+ echo "Reboot is required to apply changes"
+}
+
+post_remove() {
+ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
+}