diff options
author | Grigorii Horos | 2015-10-11 16:41:53 +0300 |
---|---|---|
committer | Grigorii Horos | 2015-10-11 16:41:53 +0300 |
commit | 72b78171feb56a965ae29594174d3cf8f142ccc7 (patch) | |
tree | f1dd590bb9dbd2e434ff830ae1b7516025d15950 | |
download | aur-72b78171feb56a965ae29594174d3cf8f142ccc7.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .gitignore | 15 | ||||
-rw-r--r-- | LICENSE | 22 | ||||
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | PKGBUILD | 22 | ||||
-rw-r--r-- | select-and-translate.khotkeys | 33 | ||||
-rwxr-xr-x | translateselection | 3 |
7 files changed, 130 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1002cb7198ee --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = kde-select-and-translate + pkgdesc = Select text and press Alt+Z for translate using Google Translate + pkgver = 20151010 + pkgrel = 3 + url = https://github.com/horosgrisa/kde-select-and-translate + arch = any + license = MIT + depends = plasma-framework + options = !strip + source = translateselection + source = select-and-translate.khotkeys + source = LICENSE + sha256sums = 6190d53833f95632071962434c81a6ddd268ba83749bfc034a2f9da14cd9aeee + sha256sums = ce7f64ac60114bc119643a798e8a345ba4172b31780a8dff31c259f3e2227c1d + sha256sums = 1b7eb2d32c4613218a028772370e04720d028f7558f66c6d32cc3037cd72651b + +pkgname = kde-select-and-translate + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..4406c5231a4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ + +### ArchLinuxPackages +*.tar +*.tar.* +*.jar +*.exe +*.msi +*.zip +*.tgz +*.log +*.log.* +*.sig + +pkg/ +src/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..bf475e346351 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Grigorii Horos + +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/Makefile b/Makefile new file mode 100644 index 000000000000..8bc90315fc1b --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ + +all: + @echo run '`make install`' + +install: + cp translateselection /usr/bin/ + cp select-and-translate.khotkeys /usr/share/khotkeys/ + +clean: + +arch: + makepkg -f + +arch-clean: clean + rm -rf pkg/ src/ + rm -f kde-select-and-translate-*.pkg.tar.xz + rm -f kde-select-and-translate-*.tar.gz
\ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..729040124a8f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,22 @@ +# Maintainer: Grigorii Horos <horosgrisa@gmail.com> + +pkgname=kde-select-and-translate +pkgver=20151010 +pkgrel=3 +pkgdesc="Select text and press Alt+Z for translate using Google Translate" +arch=('any') +url="https://github.com/horosgrisa/${pkgname}" +license=('MIT') +depends=('plasma-framework') +options=('!strip') +source=("translateselection" "select-and-translate.khotkeys" "LICENSE") +sha256sums=('6190d53833f95632071962434c81a6ddd268ba83749bfc034a2f9da14cd9aeee' 'ce7f64ac60114bc119643a798e8a345ba4172b31780a8dff31c259f3e2227c1d' '1b7eb2d32c4613218a028772370e04720d028f7558f66c6d32cc3037cd72651b') + +package() { + install -d ${pkgdir}/usr/share/khotkeys + install -d ${pkgdir}/usr/bin + cp ${srcdir}/translateselection ${pkgdir}/usr/bin/ + cp ${srcdir}/select-and-translate.khotkeys ${pkgdir}/usr/share/khotkeys/ + install -D -m644 ${srcdir}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE +} +
\ No newline at end of file diff --git a/select-and-translate.khotkeys b/select-and-translate.khotkeys new file mode 100644 index 000000000000..4118d78ff3fd --- /dev/null +++ b/select-and-translate.khotkeys @@ -0,0 +1,33 @@ +[Data] +DataCount=1 + + + +[Data_1] +Comment=Select and translate. +Enabled=true +Name=Select And Translate +Type=COMMAND_URL_SHORTCUT_ACTION_DATA + +[Data_1Actions] +ActionsCount=1 + +[Data_1Actions0] +CommandURL=translateselection +Type=COMMAND_URL + +[Data_1Conditions] +Comment= +ConditionsCount=0 + +[Data_1Triggers] +Comment=Simple_action +TriggersCount=1 + +[Data_1Triggers0] +Key=Alt+Z +Type=SHORTCUT + +[Main] +Version=2 +ImportId=select-and-translate diff --git a/translateselection b/translateselection new file mode 100755 index 000000000000..ccc03d576193 --- /dev/null +++ b/translateselection @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +notify-send -i "applications-education-language" -u critical "$(xsel -o)" "$(curl -s -X POST -A "Mozilla/5.0" -H "Content-Type: application/x-www-form-urlencoded" -d "client=t" -d "sl=auto" -d "tl=$LANGUAGE" -d "text=$(xsel -o | sed "s/[\"'<>]//g")" 'http://www.google.com/translate_a/t' | sed 's/\[\[\[\"//' | cut -d \" -f 1)"
\ No newline at end of file |