From 9dcebf4e1bec0f8c031334789dd88adf3835fee7 Mon Sep 17 00:00:00 2001 From: Zeioth Date: Sun, 10 Apr 2022 22:00:55 +0200 Subject: [PATCH] test --- .SRCINFO | 2 +- LICENSE | 30 ++++++++++++++++ PKGBUILD | 8 +---- README.md | 20 +++++++++++ ...w-version-to-aur.sh => push-version-aur.sh | 4 +-- wofi-calc.sh | 34 +++++++++++++++++++ 6 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 LICENSE create mode 100644 README.md rename push-new-version-to-aur.sh => push-version-aur.sh (74%) create mode 100755 wofi-calc.sh diff --git a/.SRCINFO b/.SRCINFO index f5ed28f..a8027dd 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = wofi-calc-git pkgdesc = A simple calculator for wofi, inspired in rofi-calc. - pkgver = 1.0.r4.9fd4142 + pkgver = 1.0.r3.7e6ecfa pkgrel = 1 url = https://github.com/Zeioth/wofi-calc.git arch = any diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..26832e9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,30 @@ +MIT License + +Copyright (c) 2021 + +Original packager: +- Adrian Lopez + +Original authors: +- stvsu +- pierenn + +Historical Source: https://todo.sr.ht/~scoopta/wofi/49 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD index 051fe61..881bd86 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,11 +1,5 @@ -# This is an example PKGBUILD file. Use this as a start to creating your own, -# and remove these comments. For more information, see 'man PKGBUILD'. -# NOTE: Please fill out the license field for your package! If it is unknown, -# then please put 'unknown'. - -# Maintainer: Adrian Lopez pkgname=wofi-calc-git -pkgver=1.0.r4.9fd4142 +pkgver=1.0.r3.7e6ecfa pkgrel=1 epoch= pkgdesc="A simple calculator for wofi, inspired in rofi-calc." diff --git a/README.md b/README.md new file mode 100644 index 0000000..e0e2313 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# wofi-calc +A simple calculator for wofi, inspired in rofi-calc. + +## Install from AUR + + yay -S wofi-calc + +## Install from github + + makepkg -sri + +## To use it run + + wofi-calc + +## Changelog → Changes of 'wofi-calc-git' compared with 'wofi-calc' + + * wofi-calc now installs in /usr/bin instead of ~/.local/bin to make it available to all users. + * Checksums added for extra security. + * Automated build now generate checksums automatically. diff --git a/push-new-version-to-aur.sh b/push-version-aur.sh similarity index 74% rename from push-new-version-to-aur.sh rename to push-version-aur.sh index 375a57f..1ea09ef 100755 --- a/push-new-version-to-aur.sh +++ b/push-version-aur.sh @@ -6,5 +6,5 @@ makepkg --printsrcinfo > .SRCINFO # Push it to AUR git add PKGBUILD .SRCINFO -git commit -git push ssh://aur@aur.archlinux.org/wofi-calc-git.git master +git commit -m "New version" +git push diff --git a/wofi-calc.sh b/wofi-calc.sh new file mode 100755 index 0000000..72fea60 --- /dev/null +++ b/wofi-calc.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +RESULT_FILE="$HOME/.config/qalculate/qalc.result.history" +if [ ! -f "$RESULT_FILE" ]; then + touch $RESULT_FILE +fi + +LAST_WOFI="" +QALC_RET="" +while : +do + qalc_hist=`tac $RESULT_FILE | head -1000` + WOFI_RET=`wofi --sort-order=default --cache-file=/dev/null -d -p calc <<< "$qalc_hist"` + + rtrn=$? + + if test "$rtrn" = "0"; then + if [[ "$WOFI_RET" =~ .*=.* ]]; then + RESULT=`echo "$WOFI_RET" | awk {'print $NF'}` + wl-copy "$RESULT" + exit 0 + else + QALC_RET=`qalc "$WOFI_RET"` + LAST_WOFI=$WOFI_RET + echo $QALC_RET >> $RESULT_FILE + fi + else + if [ ! -z "$LAST_WOFI" ]; then + RESULT=`qalc -t "$LAST_WOFI"` + wl-copy "$RESULT" + fi + exit 0 + fi +done