summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authora8212024-02-18 21:15:45 +0100
committera8212024-02-18 21:15:45 +0100
commit352c76831af59f7b028b125e69d1c1be6eb09ce3 (patch)
tree4a2ec74489f908216163f80fa3ad2b67e05760a5
parent7d82ff7c9e3223b5c2e8f650df59e916441e89fd (diff)
downloadaur-archfetch.tar.gz
Remove sudo and fix package
* remove sudo * pick last commit (there are no tags) * fix awk warnings * use hostnamectl to get the hostname
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD33
-rw-r--r--archfetch62
3 files changed, 21 insertions, 82 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b8cdf2a9cd30..6586ff401fcf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,12 @@
pkgbase = archfetch
pkgdesc = Simple CLI system information tool for Arch Linux.
pkgver = 1.0.8
- pkgrel = 6
+ pkgrel = 7
url = https://github.com/xxczaki/archfetch/
- arch = i686
- arch = x86_64
+ arch = any
license = MIT
makedepends = git
+ source = git+https://github.com/xxczaki/archfetch#commit=47ee3d8c3d9ad4c8585347a39d021f395cabaecb
+ sha256sums = SKIP
pkgname = archfetch
-
diff --git a/PKGBUILD b/PKGBUILD
index a9ee0a7e8feb..760797bb383b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,25 +1,26 @@
-# Maintainer: Antoni Kepinski <a[at]kepinski[dot]me>
+# Contributor: Antoni Kepinski <a[at]kepinski[dot]me>
pkgname=archfetch
pkgver=1.0.8
-pkgrel=6
+pkgrel=7
+_commit=47ee3d8c3d9ad4c8585347a39d021f395cabaecb # pick last commit
pkgdesc="Simple CLI system information tool for Arch Linux."
url="https://github.com/xxczaki/archfetch/"
-arch=('i686' 'x86_64')
+arch=('any')
license=('MIT')
makedepends=('git')
-_gitroot="git://github.com/xxczaki/archfetch.git"
-_gitname="archfetch"
+source=("git+https://github.com/xxczaki/archfetch#commit=$_commit")
+sha256sums=('SKIP')
-package() {
- cd "${PKGMK_SOURCE_DIR}"
-
- if cd "${pkgname}"; then
- git fetch -q
- git reset --hard origin/master
- else
- git clone ${_gitroot} ${_gitname}
- cd "${pkgname}"
- fi
+prepare() {
+ cd $pkgname
+ # use systemd's hostnamectl instead of inetutils
+ sed -i 's/(hostname)/(hostnamectl hostname)/' archfetch
+ # fix awk warning
+ sed -i 's/\\"/"/g' archfetch
+}
- sudo make install
+package() {
+ cd $pkgname
+ install -Dm755 $pkgname "$pkgdir/usr/bin/$pkgname"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
diff --git a/archfetch b/archfetch
deleted file mode 100644
index 4678b37c029b..000000000000
--- a/archfetch
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-# 88 ad88 88
-# 88 d8" ,d 88
-# 88 88 88 88
-# ,adPPYYba, 8b,dPPYba, ,adPPYba, 88,dPPYba, MM88MMM ,adPPYba, MM88MMM ,adPPYba, 88,dPPYba,
-# "" `Y8 88P' "Y8 a8" "" 88P' "8a 88 a8P_____88 88 a8" "" 88P' "8a
-# ,adPPPPP88 88 8b 88 88 88 8PP""""""" 88 8b 88 88
-# 88, ,88 88 "8a, ,aa 88 88 88 "8b, ,aa 88, "8a, ,aa 88 88
-# `"8bbdP"Y8 88 `"Ybbd8"' 88 88 88 `"Ybbd8"' "Y888 `"Ybbd8"' 88 88
-#
-#
-
-## Basic Configuration
-
-user="$(whoami || printf "%s" "${HOME/*\/}")"
-hostname="$(hostname)"
-os='Arch Linux'
-kernel="$(uname -sr)"
-gpu="$(lspci -mm | awk -F '\\"|\\" \\"|\\(' \ '/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a){if(!seen[a[i]]++) print a[i]}}' | cut -d "[" -f2 | cut -d "]" -f1)"
-cpu="$(awk -F ':' '/model name/\
- {printf $2; exit}' "/proc/cpuinfo"
-)"
-uptime="$(uptime -p | sed 's/up //')"
-packages="$(pacman -Q | wc -l)"
-shell="$(basename ${SHELL})"
-
-## Basic Colors
-
-bc="$(tput bold)" # bold
-c0="$(tput setaf 0)" # black
-c1="$(tput setaf 1)" # red
-c2="$(tput setaf 2)" # green
-c3="$(tput setaf 3)" # yellow
-c4="$(tput setaf 4)" # blue
-c5="$(tput setaf 5)" # magenta
-c6="$(tput setaf 6)" # cyan
-c7="$(tput setaf 7)" # white
-rc="$(tput sgr0)" # reset
-
-## Color Configuration
-
-lc="${rc}${bc}${c6}" # Labels
-nc="${rc}${bc}${c3}" # User and hostname
-ic="${rc}${bc}${c7}" # Info
-fc="${rc}${bc}${c6}" # First color
-sc="${rc}${c6}" # Second color
-
-## Generate & Present the output
-
-cat <<EOF
-${pc} ___${rc} ${nc}${user}${ic}@${nc}${hostname}${rc}
-${pc} (${rc}${c7}.ยท${rc} ${pc}|${rc} ${lc}OS: ${ic}${os}${rc}
-${pc} (${rc}${c3}<>${rc} ${pc}|${rc} ${lc}KERNEL: ${ic}${kernel}${rc}
-${pc} /${rc} ${c7}__${rc} ${pc}\\${rc} ${lc}UPTIME: ${ic}${uptime}${rc}
-${pc} (${rc} ${c7}/ \\${rc} ${pc}/|${rc} ${lc}PACKAGES: ${ic}${packages}${rc}
-${c3} _${pc}/\\${rc} ${c7}__)${rc}${pc}/${rc}${c3}_${rc}${pc})${rc} ${lc}SHELL: ${ic}${shell}${rc}
-${c3} \/${pc}-____${rc}${c3}\/${rc} ${lc}CPU: ${ic}${cpu}${rc}
-${c3} ${lc}GPU: ${ic}${gpu}${rc}
-
-
-EOF