summaryrefslogtreecommitdiff
path: root/office
diff options
context:
space:
mode:
Diffstat (limited to 'office')
-rw-r--r--office/khal/README11
-rw-r--r--office/khal/khal-complete.bash29
-rw-r--r--office/khal/khal-complete.fish22
-rw-r--r--office/khal/khal-complete.zsh35
-rw-r--r--office/khal/khal.SlackBuild3
-rw-r--r--office/khal/khal.info8
6 files changed, 103 insertions, 5 deletions
diff --git a/office/khal/README b/office/khal/README
index a907507fd0..4071b2bfe6 100644
--- a/office/khal/README
+++ b/office/khal/README
@@ -6,3 +6,14 @@ ikhal (interactive khal) lets you browse and edit calendars and events
No support for editing the timezones of events yet
Works with python 3.6+
+
+To have completion with click, source the according file for your shell
+
+in .bashrc
+. /usr/doc/khal-*/khal-complete.bash
+
+in .zshrc
+. /usr/doc/khal-*/khal-complete.zsh
+
+in .fishrc
+. /usr/doc/khal-*/khal-complete.fish
diff --git a/office/khal/khal-complete.bash b/office/khal/khal-complete.bash
new file mode 100644
index 0000000000..1a8fd294fd
--- /dev/null
+++ b/office/khal/khal-complete.bash
@@ -0,0 +1,29 @@
+_khal_completion() {
+ local IFS=$'\n'
+ local response
+
+ response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD _KHAL_COMPLETE=bash_complete $1)
+
+ for completion in $response; do
+ IFS=',' read type value <<< "$completion"
+
+ if [[ $type == 'dir' ]]; then
+ COMPREPLY=()
+ compopt -o dirnames
+ elif [[ $type == 'file' ]]; then
+ COMPREPLY=()
+ compopt -o default
+ elif [[ $type == 'plain' ]]; then
+ COMPREPLY+=($value)
+ fi
+ done
+
+ return 0
+}
+
+_khal_completion_setup() {
+ complete -o nosort -F _khal_completion khal
+}
+
+_khal_completion_setup;
+
diff --git a/office/khal/khal-complete.fish b/office/khal/khal-complete.fish
new file mode 100644
index 0000000000..9c02b4052b
--- /dev/null
+++ b/office/khal/khal-complete.fish
@@ -0,0 +1,22 @@
+function _khal_completion;
+ set -l response;
+
+ for value in (env _KHAL_COMPLETE=fish_complete COMP_WORDS=(commandline -cp) COMP_CWORD=(commandline -t) khal);
+ set response $response $value;
+ end;
+
+ for completion in $response;
+ set -l metadata (string split "," $completion);
+
+ if test $metadata[1] = "dir";
+ __fish_complete_directories $metadata[2];
+ else if test $metadata[1] = "file";
+ __fish_complete_path $metadata[2];
+ else if test $metadata[1] = "plain";
+ echo $metadata[2];
+ end;
+ end;
+end;
+
+complete --no-files --command khal --arguments "(_khal_completion)";
+
diff --git a/office/khal/khal-complete.zsh b/office/khal/khal-complete.zsh
new file mode 100644
index 0000000000..21ce8b86c3
--- /dev/null
+++ b/office/khal/khal-complete.zsh
@@ -0,0 +1,35 @@
+#compdef khal
+
+_khal_completion() {
+ local -a completions
+ local -a completions_with_descriptions
+ local -a response
+ (( ! $+commands[khal] )) && return 1
+
+ response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) _KHAL_COMPLETE=zsh_complete khal)}")
+
+ for type key descr in ${response}; do
+ if [[ "$type" == "plain" ]]; then
+ if [[ "$descr" == "_" ]]; then
+ completions+=("$key")
+ else
+ completions_with_descriptions+=("$key":"$descr")
+ fi
+ elif [[ "$type" == "dir" ]]; then
+ _path_files -/
+ elif [[ "$type" == "file" ]]; then
+ _path_files -f
+ fi
+ done
+
+ if [ -n "$completions_with_descriptions" ]; then
+ _describe -V unsorted completions_with_descriptions -U
+ fi
+
+ if [ -n "$completions" ]; then
+ compadd -U -V unsorted -a completions
+ fi
+}
+
+compdef _khal_completion khal;
+
diff --git a/office/khal/khal.SlackBuild b/office/khal/khal.SlackBuild
index ca1e74122a..f0d0e6cffd 100644
--- a/office/khal/khal.SlackBuild
+++ b/office/khal/khal.SlackBuild
@@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=khal
-VERSION=${VERSION:-0.10.4}
+VERSION=${VERSION:-0.10.5}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -85,6 +85,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
*.rst doc/* \
+ $CWD/khal-complete.* \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
diff --git a/office/khal/khal.info b/office/khal/khal.info
index e354b75aca..d2bf37575e 100644
--- a/office/khal/khal.info
+++ b/office/khal/khal.info
@@ -1,10 +1,10 @@
PRGNAM="khal"
-VERSION="0.10.4"
+VERSION="0.10.5"
HOMEPAGE="https://github.com/pimutils/khal/"
-DOWNLOAD="https://files.pythonhosted.org/packages/7a/d8/9718385de260ebc07ff48c838e22fde6b05d143f1f8ab81ff1c8718d7102/khal-0.10.4.tar.gz"
-MD5SUM="fe8217ce83a367afef95c84c38a0f2b1"
+DOWNLOAD="https://files.pythonhosted.org/packages/d8/99/6ef24e33472b343800ffb7300e9702faa715ccd986a0a0706f01e44d8cb6/khal-0.10.5.tar.gz"
+MD5SUM="8f08f39be55125ec72f7eec8ec0ab835"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="python3-dateutil icalendar atomicwrites configobj tzlocal click click-log"
MAINTAINER="Tonus"
-EMAIL="tonus1@gmail.com"
+EMAIL="tonus1@free.fr"