Apply patch from #1697

This commit is contained in:
François Chavant 2017-12-02 19:23:55 +01:00
parent b91a39be22
commit 595a53ad3b
6 changed files with 18 additions and 25 deletions

View File

@ -76,6 +76,7 @@ crop-first-column() {
ls-files() { ls-files() {
# add the slash at the end of the download dir enforces to follow the # add the slash at the end of the download dir enforces to follow the
# symlink, if the DOWNLOAD_DIR itself is a symlink # symlink, if the DOWNLOAD_DIR itself is a symlink
# shellcheck disable=SC2010
ls -Q --quoting-style escape -h -o -1 -A -t "${DOWNLOAD_DIR}/" \ ls -Q --quoting-style escape -h -o -1 -A -t "${DOWNLOAD_DIR}/" \
| grep '^[-]' \ | grep '^[-]' \
| cut -d' ' -f3- \ | cut -d' ' -f3- \
@ -94,7 +95,7 @@ fi
line=$(printf "%s\n" "${entries[@]}" \ line=$(printf "%s\n" "${entries[@]}" \
| crop-first-column 55 \ | crop-first-column 55 \
| column -s $'\t' -t \ | column -s $'\t' -t \
| $ROFI_CMD "${rofi_default_args[@]}" $ROFI_ARGS) || true | $ROFI_CMD "${rofi_default_args[@]}" "$ROFI_ARGS") || true
if [ -z "$line" ]; then if [ -z "$line" ]; then
exit 0 exit 0
fi fi

View File

@ -236,7 +236,7 @@ pass_backend() {
if ((match_line)) ; then if ((match_line)) ; then
# add entries with matching URL-tag # add entries with matching URL-tag
while read -r -d "" passfile ; do while read -r -d "" passfile ; do
if $GPG "${GPG_OPTS}" -d "$passfile" \ if $GPG "${GPG_OPTS[@]}" -d "$passfile" \
| grep --max-count=1 -iE "${match_line_pattern}${url}" > /dev/null | grep --max-count=1 -iE "${match_line_pattern}${url}" > /dev/null
then then
passfile="${passfile#$PREFIX}" passfile="${passfile#$PREFIX}"
@ -269,7 +269,7 @@ pass_backend() {
break break
fi fi
fi fi
done < <($GPG "${GPG_OPTS}" -d "$path" ) done < <($GPG "${GPG_OPTS[@]}" -d "$path" )
} }
} }
# ======================================================= # =======================================================
@ -283,7 +283,7 @@ secret_backend() {
query_entries() { query_entries() {
local domain="$1" local domain="$1"
while read -r line ; do while read -r line ; do
if [[ "$line" =~ "attribute.username = " ]] ; then if [[ "$line" == "attribute.username ="* ]] ; then
files+=("$domain ${line#${BASH_REMATCH[0]}}") files+=("$domain ${line#${BASH_REMATCH[0]}}")
fi fi
done < <( secret-tool search --unlock --all domain "$domain" 2>&1 ) done < <( secret-tool search --unlock --all domain "$domain" 2>&1 )

View File

@ -35,17 +35,11 @@ get_selection() {
# Main # Main
# https://github.com/halfwit/dotfiles/blob/master/.config/dmenu/font # https://github.com/halfwit/dotfiles/blob/master/.config/dmenu/font
if [[ -s $confdir/dmenu/font ]]; then [[ -s $confdir/dmenu/font ]] && read -r font < "$confdir"/dmenu/font
read -r font < "$confdir"/dmenu/font
fi
if [[ $font ]]; then [[ $font ]] && opts+=(-fn "$font")
opts+=(-fn "$font")
fi
if [[ -s $optsfile ]]; then [[ -s $optsfile ]] && source "$optsfile"
source "$optsfile"
fi
url=$(get_selection) url=$(get_selection)
url=${url/*http/http} url=${url/*http/http}

View File

@ -25,12 +25,12 @@
[[ $QUTE_MODE == 'hints' ]] && title=$QUTE_SELECTED_TEXT || title=$QUTE_TITLE [[ $QUTE_MODE == 'hints' ]] && title=$QUTE_SELECTED_TEXT || title=$QUTE_TITLE
# try to add the task and grab the output # try to add the task and grab the output
msg="$(task add $title $@ 2>&1)" msg="$(task add "$title" "$*" 2>&1)"
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
# annotate the new task with the url, send the output back to the browser # annotate the new task with the url, send the output back to the browser
task +LATEST annotate "$QUTE_URL" task +LATEST annotate "$QUTE_URL"
echo "message-info '$msg'" >> $QUTE_FIFO echo "message-info '$msg'" >> "$QUTE_FIFO"
else else
echo "message-error '$msg'" >> $QUTE_FIFO echo "message-error '$msg'" >> "$QUTE_FIFO"
fi fi

View File

@ -27,17 +27,17 @@ travis_retry() {
local count=1 local count=1
while (( count < 3 )); do while (( count < 3 )); do
if (( result != 0 )); then if (( result != 0 )); then
echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2 echo -e "\n${ANSI_RED}The command \"$*\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2
fi fi
"$@" "$@"
result=$? result=$?
(( result == 0 )) && break (( result == 0 )) && break
count=$(($count + 1)) count=$(( count + 1 ))
sleep 1 sleep 1
done done
if (( count > 3 )); then if (( count > 3 )); then
echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2 echo -e "\n${ANSI_RED}The command \"$*\" failed 3 times.${ANSI_RESET}\n" >&2
fi fi
return $result return $result

View File

@ -1,14 +1,12 @@
#!/bin/bash #!/usr/bin/env bash
if [[ $PWD == */scripts ]]; then [[ $PWD == */scripts ]] && cd ..
cd ..
fi
echo > crash.log echo > crash.log
while :; do while :; do
exit=0 exit=0
while (( $exit == 0)); do while (( exit == 0 )); do
duration=$(($RANDOM%10000)) duration=$(( RANDOM % 10000 ))
python3 -m qutebrowser --debug ":later $duration quit" http://www.heise.de/ python3 -m qutebrowser --debug ":later $duration quit" http://www.heise.de/
exit=$? exit=$?
done done