summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAakash Hemadri2021-06-03 15:29:35 +0530
committerAakash Hemadri2021-06-03 15:29:35 +0530
commit5ae23792fc98263dbc9681c5224ea6e382819781 (patch)
treed2e162de141f72eaa87902b6f2736d4c417deb36
downloadaur-5ae23792fc98263dbc9681c5224ea6e382819781.tar.gz
Initial commit
Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
-rw-r--r--.SRCINFO15
-rw-r--r--.gitignore4
-rw-r--r--Makefile25
-rw-r--r--PKGBUILD35
-rw-r--r--gk6x16
5 files changed, 95 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fbb4f2e52d28
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = gk6x-bin
+ pkgdesc = Configure keys, macros, and lighting on GK6X keyboards (GK64, GK84, GK61, etc)
+ pkgver = 1.15
+ pkgrel = 1
+ url = https://github.com/pixeltris/GK6X
+ arch = x86_64
+ license = MIT
+ license = unkown
+ depends = mono
+ source = https://github.com/pixeltris/GK6X/releases/download/GK6X-v1.15/GK6X-v1.15-GUI.zip
+ source = gk6x
+ md5sums = 827c483c717acb3bf79622e33e714f5e
+ md5sums = f0611a521786c9ca1fc5c075d7bd8aeb
+
+pkgname = gk6x-bin
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..b86cc84d742a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg
+src
+*.zip
+*.tar.*
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..c664e257a66e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+# Helper make file
+BINARY:=gk6x
+
+all: uninstall install clean
+
+.PHONY: clean
+clean:
+ @echo "Cleaning build files..."
+ @rm -rf *.pkg.tar.xz *.zst *.zip pkg src
+ @echo "Done."
+
+.PHONY: build
+build:
+ @updpkgsums ./PKGBUILD
+ @makepkg -fp ./PKGBUILD --noconfirm
+ @makepkg --printsrcinfo > .SRCINFO
+
+.PHONY: install
+install:
+ @updpkgsums ./PKGBUILD
+ @makepkg -Ccip ./PKGBUILD --noconfirm
+
+.PHONY: uninstall
+uninstall:
+ @sudo pacman -R $(BINARY) --noconfirm
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f0c74eba341f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+# Maintainer: Aakash Hemadri <aakashhemadri123@gmail.com>
+pkgname=gk6x-bin
+pkgver=1.15
+_pkgname=gk6x
+pkgrel=1
+epoch=
+pkgdesc="Configure keys, macros, and lighting on GK6X keyboards (GK64, GK84, GK61, etc)"
+arch=('x86_64')
+url="https://github.com/pixeltris/GK6X"
+license=('MIT' 'unkown')
+groups=()
+depends=('mono')
+makedepends=()
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+changelog=
+source=("$url/releases/download/${_pkgname^^}-v${pkgver}/${_pkgname^^}-v${pkgver}-GUI.zip" "gk6x")
+noextract=()
+md5sums=('827c483c717acb3bf79622e33e714f5e'
+ 'f0611a521786c9ca1fc5c075d7bd8aeb')
+validpgpkeys=()
+
+package() {
+ mkdir -p "$pkgdir"/opt/$_pkgname "$pkgdir"/usr/bin/
+ cp gk6x "$pkgdir"/opt/$_pkgname
+ cp -rf "${_pkgname^^}-v${pkgver}-GUI"/* "$pkgdir"/opt/$_pkgname
+ chmod 0755 "$pkgdir"/opt/$_pkgname/gk6x
+ ln -sf /opt/$_pkgname/$_pkgname "$pkgdir"/usr/bin/$_pkgname
+}
diff --git a/gk6x b/gk6x
new file mode 100644
index 000000000000..6f759fb2126f
--- /dev/null
+++ b/gk6x
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+if [[ $EUID -ne 0 ]]; then
+ echo "GK6X must be run as root" 1>&2
+ exit 1
+fi
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
+ SOURCE="$(readlink "$SOURCE")"
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
+
+mono $DIR/GK6X.exe $@