dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 30104363dc89091177601d11eef0fd5baced83fe
parent 483e3bf07e3fdcd9b85041061283d40bd0fc9384
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue,  8 Sep 2020 11:22:47 +0200

Use notify script for handling all notification sending

Diffstat:
M.local/bin/adcast | 2+-
M.local/bin/calendar-notify | 2+-
M.local/bin/comic | 2+-
M.local/bin/define | 4++--
M.local/bin/dmenu_run | 2+-
M.local/bin/keyboard-layout-switch.sh | 2+-
M.local/bin/notify | 4++--
M.local/bin/plumb | 2+-
M.local/bin/screenrecord | 4++--
M.local/bin/showclip | 4++--
M.local/bin/upload | 4++--
M.local/bin/youtube-dl-music | 2+-
12 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/.local/bin/adcast b/.local/bin/adcast @@ -11,7 +11,7 @@ startcast() { sleep 1 if [ ! -f "$lockfile" ]; then - notify-send -u CRITICAL "${0##*/}" 'adcast did not start' + notify -u CRITICAL "${0##*/}" 'adcast did not start' rm -f "$lockfile" exit 1 fi diff --git a/.local/bin/calendar-notify b/.local/bin/calendar-notify @@ -29,7 +29,7 @@ calendar -A 0 | while read -r month day time desc; do dt="$(( $t - $t_now ))" if [ "$dt" -le "$t_notify" ] && [ "$dt" -ge 0 ]; then - notify-send -u critical "$desc" "$time" + notify -u critical "$desc" "$time" fi fi done diff --git a/.local/bin/comic b/.local/bin/comic @@ -61,7 +61,7 @@ process_url() { xdg-open "$img" [ -n "$alttext" ] && \ - notify-send "${0##*/}" "$(printf '%s' "$alttext" | w3m -dump -T text/html)" + notify "${0##*/}" "$(printf '%s' "$alttext" | w3m -dump -T text/html)" } if [ $# -lt 1 ]; then diff --git a/.local/bin/define b/.local/bin/define @@ -8,7 +8,7 @@ show_help() { echo "shows definitions for each TERM from dict.org" echo echo "Options:" - echo " -g, --gui use dmenu for input and notify-send for output" + echo " -g, --gui use dmenu for input and notify for output" echo " -np, --no-pager do not use a pager for long output" echo " -h, --help show this message" } @@ -77,7 +77,7 @@ prepare_history_file if [ "$gui" = 1 ]; then suggestions="$(xclip -o || :; tail -r "$history_file")" word=$(echo "$suggestions" | dmenu -i -p "Dictionary lookup:") || exit 1 - notify-send -t 10000 "define: $word" "$(define "$word" | remove_comm_msgs)" + notify -t 10000 "define: $word" "$(define "$word" | remove_comm_msgs)" exit 0 else [ $# -lt 1 ] && (show_help && exit 1) diff --git a/.local/bin/dmenu_run b/.local/bin/dmenu_run @@ -2,4 +2,4 @@ set -eu cmd="$(dmenu_path | dmenu "$@")" out="$(eval "$cmd" 2>&1)" -[ "$out" != "" ] && notify-send "\$ $cmd" "$out" +[ "$out" != "" ] && notify "\$ $cmd" "$out" diff --git a/.local/bin/keyboard-layout-switch.sh b/.local/bin/keyboard-layout-switch.sh @@ -12,7 +12,7 @@ set_language() { #pkill -RTMIN+3 i3blocks setxkbmap "$1" -option -option ctrl:nocaps #-option altwin:swap_lalt_lwin #xmodmap $HOME/.Xmodmap - #notify-send "$1" + #notify "$1" } [ $# -gt 0 ] && set_language "$1" && exit diff --git a/.local/bin/notify b/.local/bin/notify @@ -1,9 +1,9 @@ #!/bin/sh prog=notify-send -if ! command -v notify-send >/dev/null 2>&1; then +if ! command -v $prog >/dev/null 2>&1; then if ! command -v xmessage >/dev/null 2>&1; then - printf '%s error: notify-send or xmessage not available' "${0##*/}" >&2 + printf '%s error: %s or xmessage not available' "${0##*/}" "$prog" >&2 exit 1 else prog=xmessage diff --git a/.local/bin/plumb b/.local/bin/plumb @@ -56,7 +56,7 @@ fetch() { if [ $? -ne 0 ]; then msg="could not fetch $1\\n\\n$(cat /tmp/plumb_err)" printf '%s\n' "$msg" >&2 - notify-send "${0##*/}" "$msg" + notify "${0##*/}" "$msg" fi printf '%s' "$_o" } diff --git a/.local/bin/screenrecord b/.local/bin/screenrecord @@ -17,7 +17,7 @@ startrecording() { sleep 1 if [ ! -f "$out" ]; then echo 'error: ffmpeg recording did not start' >&2 - notify-send -u CRITICAL "${0##*/}" 'ffmpeg recording did not start' + notify -u CRITICAL "${0##*/}" 'ffmpeg recording did not start' rm -f "$lockfile" exit 1 fi @@ -26,7 +26,7 @@ startrecording() { stoprecording() { kill "$(cat "$lockfile")" rm -f "$lockfile" - #notify-send "${0##*/}" 'recording ended' + #notify "${0##*/}" 'recording ended' } if [ -f "$lockfile" ]; then diff --git a/.local/bin/showclip b/.local/bin/showclip @@ -3,5 +3,5 @@ prim=$(xclip -o -selection primary) clip=$(xclip -o -selection clipboard) -[ -n "$prim" ] && notify-send "Primary (currently selected text)" "$prim" -[ -n "$clip" ] && notify-send "Clipboard (explicit copy-paste)" "$clip" +[ -n "$prim" ] && notify "Primary (currently selected text)" "$prim" +[ -n "$clip" ] && notify "Clipboard (explicit copy-paste)" "$clip" diff --git a/.local/bin/upload b/.local/bin/upload @@ -29,7 +29,7 @@ show_help() { echo " -l, --list [QUERY] list previously uploaded files with optional QUERY" echo " search string as filter" echo " -m, --remove-metadata remove all exif metadata" - echo " -n, --notify also show diagnostic output with notify-send" + echo " -n, --notify also show diagnostic output with notify" echo " -o, --gopher return gopher URI instead of http" echo " -p, --public operate on public file directory (/${pubdir})" echo " -r, --resize if an image, resize FILES to fit 800x800 pixels" @@ -125,7 +125,7 @@ upload_file() { else printf '%s\n' "$url" fi - [ "$notify" = 1 ] && notify-send "$msg" || : + [ "$notify" = 1 ] && notify "$msg" || : [ "$clip" = 1 ] && printf '%s' "$url" | xclip -i || : } diff --git a/.local/bin/youtube-dl-music b/.local/bin/youtube-dl-music @@ -47,7 +47,7 @@ handle_url() { if [ "$(ls *.mp3 2>/dev/null | wc -l)" -lt 1 ]; then printf "youtube-dl error" "$1" if [ -n "$DISPLAY" ]; then - notify-send -u CRITICAL "youtube-dl error" "$1" + notify -u CRITICAL "youtube-dl error" "$1" fi exit 1 fi