Skip to content

Commit

Permalink
nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
bkw777 committed May 25, 2020
1 parent 57aa6bd commit 3dd7cd4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
6 changes: 3 additions & 3 deletions lib/notify_send/notify-action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ ${DEBUG_NOTIFY_SEND:=false} && {
}

SEND_SH=${0%/*}/notify-send.sh
GDBUS_ARGS=(monitor --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications)
GDBUS_PIDF=${TMP}/${APP_NAME:=${SELF}}.${$}.p
GDBUS_ARGS=(monitor --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications)

abrt () { echo "${0}: ${@}" >&2 ; exit 1 ; }
abrt () { echo "${SELF}: ${@}" >&2 ; exit 1 ; }

# consume the command line
typeset -i ID="${1}" ;shift
Expand Down Expand Up @@ -60,7 +60,7 @@ doit () {
${EXPLICIT_CLOSE:-false} && "${SEND_SH}" -s ${ID}
}

# start current monitor
# start the monitor
{
gdbus ${GDBUS_ARGS[@]} & echo ${!} >> "${GDBUS_PIDF}"
} |while IFS=" :.(),'" read x x x x e x i x k x ;do
Expand Down
26 changes: 12 additions & 14 deletions lib/notify_send/notify-send.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ BODY=
positional=false
summary_set=false
_r=
set +H

help() {
cat <<EOF
help () {
cat <<EOF
Usage:
notify-send.sh [OPTION...] <SUMMARY> [BODY] - create a notification
Expand All @@ -73,24 +72,16 @@ Application Options:
-p, --print-id Print the notification ID to the standard output.
-r, --replace=ID Replace existing notification.
-R, --replace-file=FILE Store and load notification replace ID to/from this file.
-s, --close=ID Close notification. With -R, get ID from -R file.
-s, --close=ID Close notification. With -R, get ID from -R file.
-v, --version Version of the package.
EOF
}

abrt () { echo "${SELF}: $@" >&2 ; exit 1 ; }

make_hint () {
_r="" ;local t=${1} n=${2} c=${3}
[[ ${t} =~ ^(byte|int32|double|string)$ ]] || abrt "Hint types: byte int32 double string"
[[ ${t} = string ]] && c="\"${3}\""
_r="\"${n}\": <${t} ${c}>"
}
abrt () { echo "${SELF}: ${@}" >&2 ; exit 1 ; }

notify_close () {
typeset -i i=${2}
((${i}>0)) && sleep ${i:0:-3}.${i:$((${#i}-3))}
i=${2} ;((${i}>0)) && sleep ${i:0:-3}.${i:$((${#i}-3))}
gdbus call ${NOTIFY_ARGS[@]} --method org.freedesktop.Notifications.CloseNotification "${1}" >&-
}

Expand All @@ -110,6 +101,13 @@ process_category () {
done
}

make_hint () {
_r= ;local t=${1} n=${2} c=${3}
[[ ${t} =~ ^(byte|int32|double|string)$ ]] || abrt "Hint types: byte int32 double string"
[[ ${t} = string ]] && c="\"${3}\""
_r="\"${n}\":<${t} ${c}>"
}

process_hint () {
local a ;IFS=: a=(${1})
((${#a[@]}==3)) || abrt "Hint syntax: \"TYPE:NAME:VALUE\""
Expand Down

0 comments on commit 3dd7cd4

Please sign in to comment.