From 9e2795ee166c48db3fb6482fd6d212f9842ba5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 12 Sep 2017 17:54:23 +0200 Subject: Limit ALE C linters --- vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vimrc b/vimrc index 16279e3..361013d 100644 --- a/vimrc +++ b/vimrc @@ -110,5 +110,8 @@ let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" +" Ale +let g:ale_linters = {'c': ['cppcheck', 'gcc', 'clang']} + let g:ycm_path_to_python_interpreter="/usr/bin/python3" let g:ycm_global_ycm_extra_conf = ".ycm_conf.py" -- cgit v1.2.3 From 5ff9e63b09e3017c9902131253ffd18ffc578828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 12 Sep 2017 17:55:58 +0200 Subject: Update vim plugins --- vim/bundle/YouCompleteMe | 2 +- vim/bundle/ale | 2 +- vim/bundle/tagbar | 2 +- vim/bundle/vim-snippets | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/bundle/YouCompleteMe b/vim/bundle/YouCompleteMe index 65765ef..9ca755a 160000 --- a/vim/bundle/YouCompleteMe +++ b/vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 65765ef32b0288b35a022373f8e04c66b7764b2b +Subproject commit 9ca755a7ce141351dcbde2bdd45d7fbd7f76e1b1 diff --git a/vim/bundle/ale b/vim/bundle/ale index 1d86a72..e2271b7 160000 --- a/vim/bundle/ale +++ b/vim/bundle/ale @@ -1 +1 @@ -Subproject commit 1d86a724f2f54212d1230fcb2195220f5b3727f9 +Subproject commit e2271b769c6fbf8bc09c6ab729175edf8d77c452 diff --git a/vim/bundle/tagbar b/vim/bundle/tagbar index 59ea6d6..d4a08c3 160000 --- a/vim/bundle/tagbar +++ b/vim/bundle/tagbar @@ -1 +1 @@ -Subproject commit 59ea6d656a0b5190f6f8f3fff44197d752782cc6 +Subproject commit d4a08c33e516314f35c541b34fe7f909c2ff4381 diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index 9de9bb3..d993ee0 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit 9de9bb39a2ae5264ce6c757cff4be89e65ee84fb +Subproject commit d993ee0985197a63396188bd3fab06e8f92b14db -- cgit v1.2.3 From 2b95eb1d48a24c3799ac4971748fe2d50da26228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 17 Sep 2017 20:07:10 +0200 Subject: Add usbkey script --- install | 4 ++ local/bin/usbkey | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+) create mode 100755 local/bin/usbkey diff --git a/install b/install index bd6ef50..c6b769e 100755 --- a/install +++ b/install @@ -114,3 +114,7 @@ fi if ask "Install lxc-net script"; then inst local/bin/lxc-net ~/.local/bin/lxc-net fi + +if ask "Install usbkey script"; then + inst local/bin/usbkey ~/.local/bin/usbkey +fi diff --git a/local/bin/usbkey b/local/bin/usbkey new file mode 100755 index 0000000..5e7648a --- /dev/null +++ b/local/bin/usbkey @@ -0,0 +1,190 @@ +#!/bin/sh +set -e + +UUID_KKEY="7930cd94-b56e-4395-8859-f34da77f29be" +UUID_WKEY="" + +CRYPT_NAME="usbkey" +MOUNT_PATH="/media/usbkey" + +op_mount() { + # First check if we have key drive + if [ ! -e "/dev/disk/by-uuid/$UUID_KKEY" ]; then + echo "Can't locate appropriate usb drive." >&2 + exit 1 + fi + # Decrypt drive + if [ -e "/dev/mapper/$CRYPT_NAME" ]; then + echo "USB key seems to be already decrypted" >&2 + else + echo "Decrypting usb key" >&2 + sudo -- cryptsetup open /dev/disk/by-uuid/"$UUID_KKEY" "$CRYPT_NAME" + fi + # Mount drive + if mount | grep -q "$MOUNT_PATH"; then + echo "USB key is already mounted" >&2 + else + echo "Mounting usb key" + sudo -- mkdir -p "$MOUNT_PATH" + sudo -- mount -o uid="$(id -u)",gid="$(id -g)" "/dev/mapper/$CRYPT_NAME" "$MOUNT_PATH" + fi + + echo "USB key drive mounted" >&2 +} + +op_unmount() { + # Unmount + if mount | grep -q "$MOUNT_PATH"; then + echo "Unmounting usb key" >&2 + sync "$MOUNT_PATH" + sudo -- umount "$MOUNT_PATH" + fi + # Remove mount path + [ ! -d "$MOUNT_PATH" ] || sudo -- rmdir "$MOUNT_PATH" + # Close encryption + if [ -e "/dev/mapper/$CRYPT_NAME" ]; then + echo "Closing encryption on usb key" >&2 + sudo -- cryptsetup close "$CRYPT_NAME" + fi + + echo "USB key unmounted" >&2 +} + +check_mount() { + mount | grep "$MOUNT_PATH" | grep -q "/dev/mapper/$CRYPT_NAME" +} + +op_sync() { + local DOUNMOUNT=false + local EXITC=0 + if ! check_mount; then + DOUNMOUNT=true + op_mount + fi + if [ -e "/dev/disk/by-uuid/$UUID_WKEY" ]; then + # Mount backup usb + sudo -- cryptsetup open "/dev/disk/by-uuid/$UUID_WKEY" "$CRYPT_NAME-backup" + sudo -- mkdir -p "$MOUNT_PATH-backup" + sudo -- mount -o uid="$(id -u)",gid="$(id -g)" "/dev/mapper/$CRYPT_NAME-backup" "$MOUNT_PATH-backup" + # Sync them + rsync -aAxXS --delete --progress "$MOUNT_PATH/" "$MOUNT_PATH-backup/" + # Unmount it + sudo -- umount "$MOUNT_PATH-backup" + sudo -- rmdir "$MOUNT_PATH-backup" + sudo -- cryptsetup close "$CRYPT_NAME-backup" + else + echo "USB backup key seems to not be inserted. Please do so." >&2 + EXITC=1 + fi + if $DOUNMOUNT; then + op_unmount + fi + exit $EXITC +} + +ssh_list() { + check_mount || op_mount + for KEY in $(find "$MOUNT_PATH/ssh" -name '*.pub'); do + local N="${KEY#$MOUNT_PATH/ssh/}" + echo -n "${N%.pub}: " + sed -n 's/ssh-rsa .* \(.*\)/\1/p' "$KEY" + done +} + +ssh_generate() { + check_mount || op_mount + if [ -f "$MOUNT_PATH/ssh/$NAME" ]; then + echo "Key $NAME seems to already exists." >&2 + exit 1 + fi + echo -n "Please enter comment: " + read COMMENT + ssh-keygen -f "$MOUNT_PATH/ssh/$NAME" -C "$COMMENT" +} + +ssh_import() { + check_mount || op_mount + if [ -f "$MOUNT_PATH/ssh/$NAME" ] && [ -f "$MOUNT_PATH/ssh/$NAME.pub" ]; then + echo "There is no key named $NAME" >&2 + exit 1 + fi + cp "$MOUNT_PATH/ssh/$NAME" ~/.ssh/ + cp "$MOUNT_PATH/ssh/$NAME.pub" ~/.ssh/ +} + + +unknown_argument() { + echo "Unknown argument: $1" + exit 1 +} +# Parse operation (operation have to be first) +case "$1" in + -h|--help) + echo "Usb key manager" + echo "Usage: usbkey OPERATION ..." + echo + echo "Operations:" + echo " mount: Mount key of usb driver" + echo " unmount: Unmount usb driver" + echo " sync: Synchronize drive to bakup drive" + echo " gpg-import: Import gpg key" + echo " ssh-import: Import ssh key" + echo " ssh-generate: Generate new ssh key" + echo " ssh-list: List all keys in store" + echo " openvpn-get: Get keys for some host" + echo " openvpn-generate: Generate key for new host" + exit 0 + ;; + mount|unmount|sync|gpg-import|ssh-import|ssh-generate|ssh-list|openvpn-get|openvpn-generate) + OPERATION="$1" + ;; + *) + unknown_argument "$1" + ;; +esac +shift +# Parse rest of the arguments +while [ $# -gt 0 ]; do + case "$1" in + -h|--help) + echo "Usb key manager" + case "$OPERATION" in + mount|unmount|sync) + echo "Usage: usbkey $OPERATION [-h]" + ;; + ssh-*) + echo "Usage: usbkey $OPERATION NAME [-h]" + ;; + # TODO + esac + exit 0 + ;; + *) + if [[ "$OPERATION" = ssh-* ]] && [ -z "$NAME" ]; then + NAME="$1" + else + unknown_argument "$1" + fi + ;; + esac + shift +done + +case "$OPERATION" in + mount) + op_mount + ;; + unmount) + op_unmount + ;; + sync) + op_sync + ;; + ssh-list) + ssh_list + ;; + *) + echo "Operation $OPERATION not implemented" >&2 + exit 2 + ;; +esac -- cgit v1.2.3 From 73f3fc2eb900d54915debb23017c7b9bca978645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 11:23:40 +0200 Subject: Update usbkey --- local/bin/usbkey | 94 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/local/bin/usbkey b/local/bin/usbkey index 5e7648a..658fd98 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -56,30 +56,36 @@ check_mount() { op_sync() { local DOUNMOUNT=false - local EXITC=0 + if [ -e "/dev/disk/by-uuid/$UUID_WKEY" ]; then + echo "USB backup key seems to not be inserted. Please do so." >&2 + exit 1 + fi if ! check_mount; then DOUNMOUNT=true op_mount fi - if [ -e "/dev/disk/by-uuid/$UUID_WKEY" ]; then - # Mount backup usb - sudo -- cryptsetup open "/dev/disk/by-uuid/$UUID_WKEY" "$CRYPT_NAME-backup" - sudo -- mkdir -p "$MOUNT_PATH-backup" - sudo -- mount -o uid="$(id -u)",gid="$(id -g)" "/dev/mapper/$CRYPT_NAME-backup" "$MOUNT_PATH-backup" - # Sync them - rsync -aAxXS --delete --progress "$MOUNT_PATH/" "$MOUNT_PATH-backup/" - # Unmount it - sudo -- umount "$MOUNT_PATH-backup" - sudo -- rmdir "$MOUNT_PATH-backup" - sudo -- cryptsetup close "$CRYPT_NAME-backup" - else - echo "USB backup key seems to not be inserted. Please do so." >&2 - EXITC=1 - fi + + # Mount backup usb + sudo -- cryptsetup open "/dev/disk/by-uuid/$UUID_WKEY" "$CRYPT_NAME-backup" + sudo -- mkdir -p "$MOUNT_PATH-backup" + sudo -- mount -o uid="$(id -u)",gid="$(id -g)" "/dev/mapper/$CRYPT_NAME-backup" "$MOUNT_PATH-backup" + # Sync them + rsync -ax --delete --progress "$MOUNT_PATH/" "$MOUNT_PATH-backup/" + # Unmount it + sudo -- umount "$MOUNT_PATH-backup" + sudo -- rmdir "$MOUNT_PATH-backup" + sudo -- cryptsetup close "$CRYPT_NAME-backup" + if $DOUNMOUNT; then op_unmount fi - exit $EXITC + + echo "Sync process finished." >&2 +} + +op_gpg_import() { + # TODO + true } ssh_list() { @@ -91,8 +97,16 @@ ssh_list() { done } -ssh_generate() { +check_ssh_nane() { + if [ -z "$NAME" ]; then + echo "You have to specify key name!" >&2 + exit 1 + fi +} + +op_ssh_generate() { check_mount || op_mount + check_ssh_nane if [ -f "$MOUNT_PATH/ssh/$NAME" ]; then echo "Key $NAME seems to already exists." >&2 exit 1 @@ -100,16 +114,36 @@ ssh_generate() { echo -n "Please enter comment: " read COMMENT ssh-keygen -f "$MOUNT_PATH/ssh/$NAME" -C "$COMMENT" + + echo "SSH key $NAME was generated." >&2 } -ssh_import() { +op_ssh_import() { check_mount || op_mount + check_ssh_nane if [ -f "$MOUNT_PATH/ssh/$NAME" ] && [ -f "$MOUNT_PATH/ssh/$NAME.pub" ]; then echo "There is no key named $NAME" >&2 exit 1 fi cp "$MOUNT_PATH/ssh/$NAME" ~/.ssh/ cp "$MOUNT_PATH/ssh/$NAME.pub" ~/.ssh/ + + echo "SSH key $NAME copied to local .ssh directory." >&2 +} + +op_openvpn_list() { + check_mount || op_mount + # TODO +} + +op_openvpn_get() { + check_mount || op_mount + # TODO +} + +op_openvpn_generate() { + check_mount || op_mount + # TODO } @@ -131,6 +165,7 @@ case "$1" in echo " ssh-import: Import ssh key" echo " ssh-generate: Generate new ssh key" echo " ssh-list: List all keys in store" + echo " openvpn-list: List all keys" echo " openvpn-get: Get keys for some host" echo " openvpn-generate: Generate key for new host" exit 0 @@ -169,22 +204,5 @@ while [ $# -gt 0 ]; do esac shift done - -case "$OPERATION" in - mount) - op_mount - ;; - unmount) - op_unmount - ;; - sync) - op_sync - ;; - ssh-list) - ssh_list - ;; - *) - echo "Operation $OPERATION not implemented" >&2 - exit 2 - ;; -esac +# Go to operation handler +eval "op_$(echo "$OPERATION" | tr '-' '_')" -- cgit v1.2.3 From 04029c520f4cd1c7fbf9444e6ba5304b632d23f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 20:20:01 +0200 Subject: Add completions for gitbmerge --- bashrc | 24 ++++++++++++++++++++++++ zshrc | 21 +++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/bashrc b/bashrc index ef4e60c..aee1c22 100644 --- a/bashrc +++ b/bashrc @@ -37,3 +37,27 @@ case "$TERM" in ;; esac +# Completions ################################################## + +# Some completion functions +_gitbmerge() { + local cur prev + _init_completion || return + [ $COMP_CWORD -gt 1 ] && return # Complete only single dependency + COMPREPLY=() + local GDIR="$(pwd)" + while [ ! -d "$GDIR/.git" ]; do + [ -z "$GDIR" ] && return + GDIR="${GDIR%/*}" + done + GDIR="$GDIR/.git" + [ -f "$GDIR" ] && GDIR="$(cat "$GDIR")" # This just points to some other directory + [ -d "$GDIR/refs/heads" ] || return # No completion if there is no local branch + local ops="" + for B in "$GDIR"/refs/heads/*; do + # TODO skip branch on HEAD + ops="$ops ${B#$GDIR/refs/heads/}" + done + COMPREPLY+=($(compgen -W "${ops}" -- ${cur})) +} +complete -F _gitbmerge gitbmerge diff --git a/zshrc b/zshrc index 150d286..dceef1b 100644 --- a/zshrc +++ b/zshrc @@ -90,6 +90,27 @@ lrbell_end() { add-zsh-hook preexec lrbell_begin add-zsh-hook precmd lrbell_end +# Completions ################################################## + +_gitbmerge() { + (( CURRENT > 2)) && return # Complete only single dependency + local GDIR="$(pwd)" + while [ ! -d "$GDIR/.git" ]; do + [ -z "$GDIR" ] && return + GDIR="${GDIR%/*}" + done + GDIR="$GDIR/.git" + [ -f "$GDIR" ] && GDIR="$(cat "$GDIR")" # This just points to some other directory + [ -d "$GDIR/refs/heads" ] || return # No completion if there is no local branch + local branches=() + for B in "$GDIR"/refs/heads/*; do + # TODO skip branch on HEAD + branches+=("${B#$GDIR/refs/heads/}") + done + _describe -t branches 'gitbmerge' branches +} +compdef _gitbmerge gitbmerge + ################################################################ case "$TERM" in xterm*|*rxvt*) -- cgit v1.2.3 From 39da53ab62b710a231cef8cea50bfa316816f2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 21:04:04 +0200 Subject: Add completions for usbkey --- bash_completions/usbkey | 35 +++++++++++++++++++++++++++++++++++ bashrc | 8 ++++++++ install | 4 ++++ zsh_completions/usbkey | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ zshrc | 1 + 5 files changed, 96 insertions(+) create mode 100644 bash_completions/usbkey create mode 100644 zsh_completions/usbkey diff --git a/bash_completions/usbkey b/bash_completions/usbkey new file mode 100644 index 0000000..10cb0b9 --- /dev/null +++ b/bash_completions/usbkey @@ -0,0 +1,35 @@ +# Bash completion file for usbkey +# vim: ft=sh + +_usbkey_mounted() { + mount | grep "/media/usbkey" | grep -q "/dev/mapper/usbkey" +} + +_usbkey() { + local cur prev + _init_completion || return + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + if [[ $COMP_CWORD -gt 1 ]]; then + _usbkey_mounted || return + case "${COMP_WORDS[1]}" in + ssh-import) + [ -d "/media/usbkey/ssh" ] || return + local keys + for F in $(find "/media/usbkey/ssh" -name '*.pub'); do + F="${F#/media/usbkey/ssh/}" + keys="$keys ${F%.pub}" + done + COMPREPLY+=($(compgen -W "${keys}" -- ${cur})) + ;; + esac + else + local ops="-h --help mount sync" + if _usbkey_mounted; then + ops="$ops unmount ssh-list ssh-generate ssh-import" + fi + COMPREPLY+=($(compgen -W "${ops}" -- ${cur})) + fi +} + +complete -F _usbkey usbkey diff --git a/bashrc b/bashrc index aee1c22..a5462d5 100644 --- a/bashrc +++ b/bashrc @@ -10,6 +10,14 @@ if [ -f /etc/bashrc ]; then . /etc/bashrc fi +# Source all completions +if [ -d ~/.bash_completions ]; then + for F in $(find ~/.bash_completions -type f); do + . "$F" + done +fi + +# PROMPT ####################################################### PS1='$( if [ `id -u` -eq "0" ]; then echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] " diff --git a/install b/install index c6b769e..549f63f 100755 --- a/install +++ b/install @@ -22,12 +22,14 @@ if ask "Install Bashrc"; then inst bashrc ~/.bashrc inst shellrc ~/.shellrc inst profile ~/.profile + mkdir -p ~/.bash_completions fi if ask "Install zshrc"; then inst zshrc ~/.zshrc inst shellrc ~/.shellrc inst zprofile ~/.zprofile + mkdir -p ~/.zsh_completions fi if ask "Install GIT configuration"; then @@ -117,4 +119,6 @@ fi if ask "Install usbkey script"; then inst local/bin/usbkey ~/.local/bin/usbkey + inst zsh_completions/usbkey ~/.zsh_completions/_usbkey + inst bash_completions/usbkey ~/.bash_completions/usbkey fi diff --git a/zsh_completions/usbkey b/zsh_completions/usbkey new file mode 100644 index 0000000..0de1375 --- /dev/null +++ b/zsh_completions/usbkey @@ -0,0 +1,48 @@ +#compdef usbkey +#autoload + +_usbkey_mounted() { + mount | grep "/media/usbkey" | grep -q "/dev/mapper/usbkey" +} + +_usbkey () { + local cmd + if (( CURRENT > 2)); then + _usbkey_mounted || return + operation=${words[2]} + # Run the completion for the subcommand + case "${operation}" in + ssh-import) + [ -d "/media/usbkey/ssh" ] || return + local keys=() + for F in $(find "/media/usbkey/ssh" -name '*.pub'); do + F="${F#/media/usbkey/ssh/}" + keys+=("${F%.pub}") + done + _describe -t keys 'usbkey' keys + ;; + # TODO + esac + else + local operations=( + "mount:Mount key of usb driver" + "unmount:Unmount usb driver" + "sync:Synchronize drive to bakup drive" + ) + if _usbkey_mounted; then + operations+=( + "gpg-import:Import gpg key" + "ssh-import:Import ssh key" + "ssh-generate:Generate new ssh key" + "ssh-list:List all keys in store" + "openvpn-list:List all keys" + "openvpn-get:Get keys for some host" + "openvpn-generate:Generate key for new host" + ) + fi + _describe -t operations 'usbkey' operations + _arguments : "--help[Output help message]" + fi +} + +_usbkey diff --git a/zshrc b/zshrc index dceef1b..c8f8f31 100644 --- a/zshrc +++ b/zshrc @@ -10,6 +10,7 @@ zstyle ':completion:*' cache-path ~/.cache/zsh zstyle :compinstall filename '/home/kkoci/.zshrc' zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==32=33}:${(s.:.)LS_COLORS}")' zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +fpath=(~/.zsh_completions $fpath) autoload -Uz compinit && compinit autoload -Uz colors && colors -- cgit v1.2.3 From 85c603b086490d5a2f78661bc1e167b11a6ea41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 21:06:19 +0200 Subject: Drop unnecessary comment in bashrc --- bashrc | 1 - 1 file changed, 1 deletion(-) diff --git a/bashrc b/bashrc index a5462d5..14ded1a 100644 --- a/bashrc +++ b/bashrc @@ -47,7 +47,6 @@ esac # Completions ################################################## -# Some completion functions _gitbmerge() { local cur prev _init_completion || return -- cgit v1.2.3 From 15deb620d084366ee51436aa97734a763f5f9e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 21:14:54 +0200 Subject: Some small changes in usbkey --- local/bin/usbkey | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local/bin/usbkey b/local/bin/usbkey index 658fd98..3fe7336 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -2,7 +2,7 @@ set -e UUID_KKEY="7930cd94-b56e-4395-8859-f34da77f29be" -UUID_WKEY="" +UUID_WKEY="9fcaf42a-86d5-4e70-828d-fd90aad2d964" CRYPT_NAME="usbkey" MOUNT_PATH="/media/usbkey" @@ -56,7 +56,7 @@ check_mount() { op_sync() { local DOUNMOUNT=false - if [ -e "/dev/disk/by-uuid/$UUID_WKEY" ]; then + if [ ! -e "/dev/disk/by-uuid/$UUID_WKEY" ]; then echo "USB backup key seems to not be inserted. Please do so." >&2 exit 1 fi -- cgit v1.2.3 From 3370e45b1c4a6c476827e9467fb1d313bb9a2319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 21:19:28 +0200 Subject: Update mutt mailcap --- mutt/mailcap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mutt/mailcap b/mutt/mailcap index 972681f..35d29cd 100644 --- a/mutt/mailcap +++ b/mutt/mailcap @@ -7,8 +7,8 @@ text/html; conkeror %s &; test=test -n "$DISPLAY"; nametemplate=%s.html text/html; w3m -v -F -T text/html %s; nametemplate=%s.html; needsterminal ##auto_view will use the entry with the copiousoutput part: -text/html; lynx -stdin -dump -force_html ; copiousoutput +text/html; lynx -stdin -dump -force_html -display_charset utf-8 ; copiousoutput image/*; feh --magick-timeout 1 %s -application/pdf; okular %s +application/pdf; llpp %s -- cgit v1.2.3 From dd30417fdba18a97945459b29e88cbbedb07874c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 18 Sep 2017 23:13:31 +0200 Subject: Add openvpn to usbkey --- bash_completions/usbkey | 11 ++++++++- local/bin/usbkey | 63 ++++++++++++++++++++++++++++++++++++++----------- zsh_completions/usbkey | 17 +++++++++---- 3 files changed, 72 insertions(+), 19 deletions(-) diff --git a/bash_completions/usbkey b/bash_completions/usbkey index 10cb0b9..acd6877 100644 --- a/bash_completions/usbkey +++ b/bash_completions/usbkey @@ -22,11 +22,20 @@ _usbkey() { done COMPREPLY+=($(compgen -W "${keys}" -- ${cur})) ;; + openvpn-get) + [ -d "/media/usbkey/openvpn" ] || return + local certs + for F in $(find "/media/usbkey/openvpn" -name 'ca.crt' -o -name '*.crt' -print); do + F="${F#/media/usbkey/openvpn/}" + certs="$certs ${F%.crt}" + done + COMPREPLY+=($(compgen -W "${certs}" -- ${cur})) + ;; esac else local ops="-h --help mount sync" if _usbkey_mounted; then - ops="$ops unmount ssh-list ssh-generate ssh-import" + ops="$ops unmount gpg-import ssh-list ssh-generate ssh-import openvpn-list openvpn-get openvpn-generate" fi COMPREPLY+=($(compgen -W "${ops}" -- ${cur})) fi diff --git a/local/bin/usbkey b/local/bin/usbkey index 3fe7336..85eff7f 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -97,7 +97,7 @@ ssh_list() { done } -check_ssh_nane() { +check_name() { if [ -z "$NAME" ]; then echo "You have to specify key name!" >&2 exit 1 @@ -105,8 +105,8 @@ check_ssh_nane() { } op_ssh_generate() { + check_name check_mount || op_mount - check_ssh_nane if [ -f "$MOUNT_PATH/ssh/$NAME" ]; then echo "Key $NAME seems to already exists." >&2 exit 1 @@ -119,8 +119,8 @@ op_ssh_generate() { } op_ssh_import() { + check_name check_mount || op_mount - check_ssh_nane if [ -f "$MOUNT_PATH/ssh/$NAME" ] && [ -f "$MOUNT_PATH/ssh/$NAME.pub" ]; then echo "There is no key named $NAME" >&2 exit 1 @@ -131,19 +131,51 @@ op_ssh_import() { echo "SSH key $NAME copied to local .ssh directory." >&2 } +# Note OpenVPN: CA generated using following command +# openssl req -nodes -new -x509 -keyout ca.key -out ca.crt -config openssl.cnf + op_openvpn_list() { check_mount || op_mount - # TODO + for KEY in $(find "$MOUNT_PATH/openvpn" -name 'ca.crt' -o -name '*.crt' -print); do + local N="${KEY#$MOUNT_PATH/openvpn/}" + echo "${N%.crt}" + done } op_openvpn_get() { + check_name check_mount || op_mount - # TODO + if [ ! -f "$MOUNT_PATH/openvpn/$NAME.key" ] || [ ! -f "$MOUNT_PATH/openvpn/$NAME.crt" ]; then + echo "There is no OpenVPN key $NAME" >&2 + exit 1 + fi + mkdir "openvpn-$NAME" + cp "$MOUNT_PATH/openvpn/$NAME.key" "openvpn-$NAME/" + cp "$MOUNT_PATH/openvpn/$NAME.crl" "openvpn-$NAME/" + cp "$MOUNT_PATH/openvpn/ca.crt" "openvpn-$NAME/" + cp "$MOUNT_PATH/openvpn/ta.key" "openvpn-$NAME/" + + echo "OpenVPN key $NAME copied to openvpn-$NAME directory." >&2 } op_openvpn_generate() { + check_name check_mount || op_mount - # TODO + if [ -f "$MOUNT_PATH/openvpn/$NAME.key" ] && [ -f "$MOUNT_PATH/openvpn/$NAME.crt" ]; then + echo "OpenVPN key $NAME seems to already exists" >&2 + exit 1 + fi + ( + cd "$MOUNT_PATH/openvpn" + # Build request + openssl req -batch -days 3650 -nodes -new -config "openssl.cnf" \ + -keyout "$NAME.key" -out "$NAME.csr" + # Sign request + openssl ca -days 3650 -config "openssl.cnf" \ + -out "$NAME.crt" -in "$NAME.csr" + ) + + echo "OpenVPN key $NAME was generated." >&2 } @@ -164,13 +196,13 @@ case "$1" in echo " gpg-import: Import gpg key" echo " ssh-import: Import ssh key" echo " ssh-generate: Generate new ssh key" - echo " ssh-list: List all keys in store" - echo " openvpn-list: List all keys" - echo " openvpn-get: Get keys for some host" - echo " openvpn-generate: Generate key for new host" + echo " ssh-list: List all ssh keys in store" + echo " openvpn-list: List all openvpn keys" + echo " openvpn-get: Get openvpn keys for some host" + echo " openvpn-generate: Generate openvpn key for new host" exit 0 ;; - mount|unmount|sync|gpg-import|ssh-import|ssh-generate|ssh-list|openvpn-get|openvpn-generate) + mount|unmount|sync|gpg-import|ssh-import|ssh-generate|ssh-list|openvpn-list|openvpn-get|openvpn-generate) OPERATION="$1" ;; *) @@ -184,10 +216,10 @@ while [ $# -gt 0 ]; do -h|--help) echo "Usb key manager" case "$OPERATION" in - mount|unmount|sync) + mount|unmount|sync|ssh-list|openvn-list) echo "Usage: usbkey $OPERATION [-h]" ;; - ssh-*) + ssh-*|openvpn-*) echo "Usage: usbkey $OPERATION NAME [-h]" ;; # TODO @@ -195,7 +227,10 @@ while [ $# -gt 0 ]; do exit 0 ;; *) - if [[ "$OPERATION" = ssh-* ]] && [ -z "$NAME" ]; then + if [ -z "$NAME" ] && \ + [ "$OPERATION" = "ssh-import" -o "$OPERATION" = "ssh-generate" -o \ + "$OPERATION" = "openvpn-get" -o "$OPERATION" = "openvpn-generate" ] \ + ; then NAME="$1" else unknown_argument "$1" diff --git a/zsh_completions/usbkey b/zsh_completions/usbkey index 0de1375..eada8f6 100644 --- a/zsh_completions/usbkey +++ b/zsh_completions/usbkey @@ -21,6 +21,15 @@ _usbkey () { done _describe -t keys 'usbkey' keys ;; + openvpn-get) + [ -d "/media/usbkey/openvpn" ] || return + local certs=() + for F in $(find "/media/usbkey/openvpn" -name 'ca.crt' -o -name '*.crt' -print); do + F="${F#/media/usbkey/openvpn/}" + certs+=("${F%.crt}") + done + _describe -t certificates 'usbkey' certs + ;; # TODO esac else @@ -34,10 +43,10 @@ _usbkey () { "gpg-import:Import gpg key" "ssh-import:Import ssh key" "ssh-generate:Generate new ssh key" - "ssh-list:List all keys in store" - "openvpn-list:List all keys" - "openvpn-get:Get keys for some host" - "openvpn-generate:Generate key for new host" + "ssh-list:List all SSH keys in store" + "openvpn-list:List all OpenVPN keys" + "openvpn-get:Get OpenVPN keys for some host" + "openvpn-generate:Generate OpenVPN key for new host" ) fi _describe -t operations 'usbkey' operations -- cgit v1.2.3 From 2d69c702522a1dbcb467a0e9ec7c6e75dbda0291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 19 Sep 2017 13:11:12 +0200 Subject: Fix usbkey --- local/bin/usbkey | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local/bin/usbkey b/local/bin/usbkey index 85eff7f..d72c52b 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -88,7 +88,7 @@ op_gpg_import() { true } -ssh_list() { +op_ssh_list() { check_mount || op_mount for KEY in $(find "$MOUNT_PATH/ssh" -name '*.pub'); do local N="${KEY#$MOUNT_PATH/ssh/}" -- cgit v1.2.3 From f7bbac700377968afce8fd86c8c9db294cfaaca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 19 Sep 2017 13:33:41 +0200 Subject: Only allow ff in gitbmerge --- local/bin/usbkey | 2 +- shellrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/local/bin/usbkey b/local/bin/usbkey index d72c52b..6d5115f 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -93,7 +93,7 @@ op_ssh_list() { for KEY in $(find "$MOUNT_PATH/ssh" -name '*.pub'); do local N="${KEY#$MOUNT_PATH/ssh/}" echo -n "${N%.pub}: " - sed -n 's/ssh-rsa .* \(.*\)/\1/p' "$KEY" + sed -n 's/ssh-rsa [^ ]* \(.*\)/\1/p' "$KEY" done } diff --git a/shellrc b/shellrc index 7a2ae5f..2979249 100644 --- a/shellrc +++ b/shellrc @@ -84,7 +84,7 @@ gitbmerge() { rm -r "$WT" git worktree prune fi - git merge "$1" && git push && git branch -d "$1" && git push origin :"$1" + git merge --ff-only "$1" && git push && git branch -d "$1" && git push origin :"$1" ) } -- cgit v1.2.3 From 49baff0890c54f5ade0a1bde4238c156a577af54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 24 Sep 2017 12:24:41 +0200 Subject: Update vim plugins --- vim/bundle/YouCompleteMe | 2 +- vim/bundle/lightline.vim | 2 +- vim/bundle/tagbar | 2 +- vim/bundle/vim-snippets | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/bundle/YouCompleteMe b/vim/bundle/YouCompleteMe index 9ca755a..32f1eae 160000 --- a/vim/bundle/YouCompleteMe +++ b/vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 9ca755a7ce141351dcbde2bdd45d7fbd7f76e1b1 +Subproject commit 32f1eae9cb8b8c7793f632fd24b2289839bf768e diff --git a/vim/bundle/lightline.vim b/vim/bundle/lightline.vim index 96d6d10..d465f10 160000 --- a/vim/bundle/lightline.vim +++ b/vim/bundle/lightline.vim @@ -1 +1 @@ -Subproject commit 96d6d108bf6cd7bfdaa9872add4bb47d6ddbf7fd +Subproject commit d465f10338962799b25571604599f4913c36d266 diff --git a/vim/bundle/tagbar b/vim/bundle/tagbar index d4a08c3..bef1fa4 160000 --- a/vim/bundle/tagbar +++ b/vim/bundle/tagbar @@ -1 +1 @@ -Subproject commit d4a08c33e516314f35c541b34fe7f909c2ff4381 +Subproject commit bef1fa408026e5fb9df1b2ec5d339039098df7c2 diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index d993ee0..e9b8693 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit d993ee0985197a63396188bd3fab06e8f92b14db +Subproject commit e9b869380dd96bbfae65daccc4ad46d8db7547fd -- cgit v1.2.3 From 3bf0736b56948274961db6cbdf6b28453fdffbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 24 Sep 2017 13:00:02 +0200 Subject: Add mpd-remote to i3blocks --- config/i3blocks/config | 5 +++++ config/i3blocks/scripts/mpd | 54 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/config/i3blocks/config b/config/i3blocks/config index 8ae24c8..1a62f50 100644 --- a/config/i3blocks/config +++ b/config/i3blocks/config @@ -33,6 +33,11 @@ command=~/.config/i3blocks/scripts/mpd interval=5 signal=12 +[mpd-remote] +command=~/.config/i3blocks/scripts/mpd +interval=5 +instance=remote + [keymap] command=~/.config/i3/scripts/keyboard_layout interval=once diff --git a/config/i3blocks/scripts/mpd b/config/i3blocks/scripts/mpd index 637623e..113f6e8 100755 --- a/config/i3blocks/scripts/mpd +++ b/config/i3blocks/scripts/mpd @@ -1,30 +1,64 @@ #!/bin/bash +HOME="192.168.0.217" +HOST="" +# Let's be sneaky and verify that we are on relevant network before we try to ping +if ip a | grep -q 'inet 192.168.0.' && \ + ping -c 1 -w 1 "$HOME" >/dev/null 2>&1; then + # TODO check that mpd is running? + HOST="-h $HOME" +fi + +# Handle remote volume +if [ "$BLOCK_INSTANCE" = "remote" ]; then + [ -n "$HOST" ] || exit 0 + case "$BLOCK_BUTTON" in + 1) + mpc $HOST volume 40 >/dev/null + ;; + 3) + mpc $HOST volume 0 >/dev/null + ;; + 4) + mpc $HOST volume +2 >/dev/null + ;; + 5) + mpc $HOST volume -2 >/dev/null + ;; + esac + + echo "♫ $(mpc $HOST volume | sed 's/volume: //')" + exit 0 +fi + +# Handle user input case "$BLOCK_BUTTON" in 1) - mpc toggle >/dev/null + mpc $HOST toggle >/dev/null ;; 2) - mpc stop >/dev/null + mpc $HOST stop >/dev/null ;; 3) - nohup urxvt -title "Music player daemon client" -e ncmpcpp 2>&1 >/dev/null & + # TODO this doesn't work with host + nohup urxvt -title "Music player daemon client" -hold -e ncmpcpp 2>&1 >/dev/null & ;; 4) - mpc prev >/dev/null + mpc $HOST prev >/dev/null ;; 5) - mpc next >/dev/null + mpc $HOST next >/dev/null ;; esac -if [ -n "`mpc status | grep -E "(playing|paused)"`" ]; then - echo `mpc -f "♫ %artist%, %album%, %title%" status | head -1` +STATUS="$(mpc $HOST status)" +if echo "$STATUS" | grep -qE "(playing|paused)"; then + echo `mpc $HOST -f "♫ %artist%, %album%, %title%" status | head -1` echo - if [ -n `mpc status | grep playing` ]; then - echo "#ffff00" - elif [ -n `mpc status | grep paused` ]; then + if echo "$STATUS" | grep -q playing; then echo "#00ff00" + elif echo "$STATUS" | grep -q paused; then + echo "#ffff00" fi else echo "♫" -- cgit v1.2.3 From 48120fbbb4f2b46e44c92d09f90a244717b1812d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 30 Sep 2017 23:39:43 +0200 Subject: Fix mpd and usbkey --- config/i3blocks/scripts/mpd | 17 ++++++++++------- local/bin/usbkey | 4 +++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/config/i3blocks/scripts/mpd b/config/i3blocks/scripts/mpd index 113f6e8..12f0fdd 100755 --- a/config/i3blocks/scripts/mpd +++ b/config/i3blocks/scripts/mpd @@ -1,14 +1,16 @@ #!/bin/bash -HOME="192.168.0.217" -HOST="" +HOST_HOME="192.168.0.51" +HOST="" # Let's be sneaky and verify that we are on relevant network before we try to ping if ip a | grep -q 'inet 192.168.0.' && \ - ping -c 1 -w 1 "$HOME" >/dev/null 2>&1; then + ping -c 1 -w 1 "$HOST_HOME" >/dev/null 2>&1; then # TODO check that mpd is running? - HOST="-h $HOME" + HOST="-h $HOST_HOME" fi +STATUS="$(mpc $HOST status)" + # Handle remote volume if [ "$BLOCK_INSTANCE" = "remote" ]; then [ -n "$HOST" ] || exit 0 @@ -27,7 +29,9 @@ if [ "$BLOCK_INSTANCE" = "remote" ]; then ;; esac - echo "♫ $(mpc $HOST volume | sed 's/volume: //')" + if echo "$STATUS" | grep -qE "(playing|paused)"; then + echo "♫ $(mpc $HOST volume | sed 's/volume: //')" + fi exit 0 fi @@ -40,8 +44,7 @@ case "$BLOCK_BUTTON" in mpc $HOST stop >/dev/null ;; 3) - # TODO this doesn't work with host - nohup urxvt -title "Music player daemon client" -hold -e ncmpcpp 2>&1 >/dev/null & + nohup urxvt -title "Music player daemon client" -e ncmpcpp $HOST 2>&1 >/dev/null & ;; 4) mpc $HOST prev >/dev/null diff --git a/local/bin/usbkey b/local/bin/usbkey index 6d5115f..bab47df 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -121,12 +121,14 @@ op_ssh_generate() { op_ssh_import() { check_name check_mount || op_mount - if [ -f "$MOUNT_PATH/ssh/$NAME" ] && [ -f "$MOUNT_PATH/ssh/$NAME.pub" ]; then + if [ ! -f "$MOUNT_PATH/ssh/$NAME" ] || [ ! -f "$MOUNT_PATH/ssh/$NAME.pub" ]; then echo "There is no key named $NAME" >&2 exit 1 fi cp "$MOUNT_PATH/ssh/$NAME" ~/.ssh/ cp "$MOUNT_PATH/ssh/$NAME.pub" ~/.ssh/ + chmod 600 ~/.ssh/"$NAME" + chmod 640 ~/.ssh/"$NAME.pub" echo "SSH key $NAME copied to local .ssh directory." >&2 } -- cgit v1.2.3 From 5193d42151091b2d15b28f1095a5ee19589bc312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 5 Oct 2017 23:33:18 +0200 Subject: Add htop configuration --- config/htop/htoprc | 26 ++++++++++++++++++++++++++ install | 1 + 2 files changed, 27 insertions(+) create mode 100644 config/htop/htoprc diff --git a/config/htop/htoprc b/config/htop/htoprc new file mode 100644 index 0000000..0492e91 --- /dev/null +++ b/config/htop/htoprc @@ -0,0 +1,26 @@ +# Beware! This file is rewritten by htop when settings are changed in the interface. +# The parser is also very primitive, and not human-friendly. +fields=0 48 17 18 38 39 40 2 46 47 49 1 +sort_key=46 +sort_direction=1 +hide_threads=1 +hide_kernel_threads=1 +hide_userland_threads=1 +shadow_other_users=0 +show_thread_names=0 +show_program_path=1 +highlight_base_name=0 +highlight_megabytes=1 +highlight_threads=1 +tree_view=1 +header_margin=1 +detailed_cpu_time=0 +cpu_count_from_zero=0 +update_process_names=0 +account_guest_in_cpu_meter=0 +color_scheme=0 +delay=15 +left_meters=LeftCPUs Memory Swap +left_meter_modes=1 1 1 +right_meters=RightCPUs Tasks LoadAverage Uptime +right_meter_modes=1 2 2 2 diff --git a/install b/install index 549f63f..efce93f 100755 --- a/install +++ b/install @@ -39,6 +39,7 @@ fi if ask "Install configurations for various utility tools"; then inst screenrc ~/.screenrc + inst config/htop/htoprc ~/.config/htop/htoprc fi if ask "Install user services"; then -- cgit v1.2.3 From 2fc8d93ef509f583f6977588c7b3fb2cf8ebd332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 5 Oct 2017 23:33:39 +0200 Subject: Drop annoyme from shell and some other small changes --- bashrc | 5 +---- shellrc | 2 +- zshrc | 11 +++-------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/bashrc b/bashrc index 14ded1a..f36391e 100644 --- a/bashrc +++ b/bashrc @@ -22,10 +22,7 @@ PS1='$( if [ `id -u` -eq "0" ]; then echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] " else - if ls ~/.annoyme/*.pid 2>/dev/null >/dev/null; then - ANNOYME_PS="\[\e[1;31m\]!\[\e[0m\]" - fi - echo -n "$ANNOYME_PS\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] " + echo -n "\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] " fi)' PROMPT_COMMAND=' diff --git a/shellrc b/shellrc index 2979249..10f6f2c 100644 --- a/shellrc +++ b/shellrc @@ -14,7 +14,7 @@ else eval $(dircolors -b) alias make="make -j$(nproc)" fi -alias ll='ls -l' +alias ll='ls -lh' alias grep='grep --color=auto' alias git='LANG=en_GB git' alias gdb='gdb -q' diff --git a/zshrc b/zshrc index c8f8f31..ed2058d 100644 --- a/zshrc +++ b/zshrc @@ -37,14 +37,9 @@ bindkey "^[[3~" delete-char bindkey "^[3;5~" delete-char # PROMPT ####################################################### -annoyme_check() { - which annoyme >/dev/null 2>&1 && ls ~/.annoyme/*.pid 2>/dev/null >&2 && \ - echo "%{$fg_bold[red]%}!" -} - [ $UID -eq 0 ] && NCOLOR="red" || NCOLOR="green" PROMPT="%(?..%{$fg_bold[yellow]%}EXIT: %? -)\$(annoyme_check)%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} " +)%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} " unset NCOLOR if [ -e ~/.local/git-prompt.sh ]; then @@ -71,9 +66,9 @@ lrbell_active_window_id() { lrbell_begin() { lrbell_timestamp=$EPOCHSECONDS - lrbell_message="`pwd`: $1" if [ -n "$DISPLAY" ]; then - lrbell_window_id=$(lrbell_active_window_id) + lrbell_message="`pwd`: $1" + lrbell_window_id="$(lrbell_active_window_id)" fi } lrbell_end() { -- cgit v1.2.3