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 4c632276bb7da90ad6cd075a077c1a5ef7f8e0e9
parent 933735adfc5f2fd1e1e532a20e07b8be6fceb118
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 24 Apr 2019 12:18:06 +0200

Fix notify-send calls

Diffstat:
Mbin/articlesearch | 4++--
Mbin/battery-linux | 3+--
Mbin/dmenumount | 6+++---
Mbin/dmenuunicode | 4++--
Mbin/getref | 3+--
Mbin/linkhandler | 2+-
Mbin/scholarref | 2+-
Mbin/shdl | 5++---
Mbin/showclip | 6++----
Mbin/t-daemon-toggle | 2+-
Mbin/xrandr-auto.sh | 4++--
11 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/bin/articlesearch b/bin/articlesearch @@ -19,7 +19,7 @@ elif [ "$action" = "Sci-Hub" ]; then elif [ "$action" = "Add citation" ]; then reference="$(scholarref "$query")" echo "$reference" >> "$BIB" - notify-send "<b>Added citation</b>$reference" + notify-send "Added citation" "$reference" else - notify-send --category=error "<b>Action not understood</b>" + notify-send --category=error "${0##*/}" "Action not understood" fi diff --git a/bin/battery-linux b/bin/battery-linux @@ -3,8 +3,7 @@ battery=${1:-BAT0} case $BLOCK_BUTTON in - 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> -🔋: discharging + 3) pgrep -x dunst >/dev/null && notify-send "Battery module" "🔋: discharging ♻: stagnant charge 🔌: charging ⚡: charged diff --git a/bin/dmenumount b/bin/dmenumount @@ -17,21 +17,21 @@ getmount() { \ mountusb() { \ chosen="$(echo "$usbdrives" | dmenu_themed -i -p "Mount which drive?" | awk '{print $1}')" - sudo -A mount "$chosen" && notify-send "$chosen mounted." && exit 0 + sudo -A mount "$chosen" && notify-send "${0##/*}" "$chosen mounted." && exit 0 getmount "/mnt /media /mount /home -maxdepth 5 -type d" partitiontype="$(lsblk -no "fstype" "$chosen")" case "$partitiontype" in "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;; *) sudo -A mount "$chosen" "$mp";; esac - notify-send "$chosen mounted to $mp." + notify-send "${0##/*}" "$chosen mounted to $mp." } mountandroid() { \ chosen=$(echo "$anddrives" | dmenu_themed -i -p "Which Android device?" | cut -d : -f 1) getmount "$HOME -maxdepth 3 -type d" simple-mtpfs --device "$chosen" "$mp" - notify-send "Android device mounted to $mp." + notify-send "${0##/*}" "Android device mounted to $mp." } asktype() { \ diff --git a/bin/dmenuunicode b/bin/dmenuunicode @@ -12,8 +12,8 @@ chosen=$(grep -v "#" ~/.emoji | dmenu_themed -i -l 20 -fn PragmataPro-22) c=$(echo "$chosen" | sed "s/ .*//") echo "$c" | tr -d '\n' | xclip -selection clipboard -notify-send "'$c' copied to clipboard." & +notify-send "'$c' copied to clipboard" & s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}') echo "$s" | tr -d '\n' | xclip -notify-send "'$s' copied to primary." & +notify-send "'$s' copied to primary" & diff --git a/bin/getref b/bin/getref @@ -102,8 +102,7 @@ function get_citation { else echo "$result" fi - [ "$notify" = 1 ] && notify-send "${0##*/} added: -$(echo "$result" | cut -c-80)" + [ "$notify" = 1 ] && notify-send "${0##*/}" "added: $(echo "$result" | cut -c-80)" } verbose=0 diff --git a/bin/linkhandler b/bin/linkhandler @@ -27,7 +27,7 @@ for url in "$@"; do elif [ "$action" = "Play" ]; then setsid mpv -quiet "$url" >/dev/null 2>&1 & else - notify-send "Error: Action not understood" + notify-send "${0##/*}" "Error: Action not understood" exit 1 fi fi diff --git a/bin/scholarref b/bin/scholarref @@ -23,7 +23,7 @@ if [ "$addref" = 1 ]; then getdoi "$@" | getref -n >> "$BIB" key="$(grep '@.*{' "$BIB" | tail -n 1 | sed 's/.*{//;s/,$//')" echo "Citation $key added to $BIB" - notify-send "Citation $key added" + notify-send "${0##/*}" "Citation $key added" else getdoi "$@" | getref -n fi diff --git a/bin/shdl b/bin/shdl @@ -62,7 +62,7 @@ function shdl_fetch { --write-out "filename: %{filename_effective}\n" -O -L -J "$pdfurl" |\ grep 'filename: ' | cut -d' ' -f2)"; then if [ "$verbose" = 1 ]; then - [ "$notify" = 1 ] && notify-send "Error: could not fetch $doi" + [ "$notify" = 1 ] && notify-send "${0##*/}" "Error: could not fetch $doi" (echo "Error: could not fetch $doi PDF from $pdfurl" >&2) fi browser_open "$shurl" @@ -149,8 +149,7 @@ if [ $# -lt 1 ]; then else for doi in "$@"; do handle_doi "$doi" - [ "$notify" = 1 ] && notify-send "${0##*/}: -$doi complete" + [ "$notify" = 1 ] && notify-send "${0##*/}" "$doi complete" done fi exit "$returnstatus" diff --git a/bin/showclip b/bin/showclip @@ -9,7 +9,5 @@ clip=$(xclip -o -selection clipboard) prim=$(xclip -o -selection primary) -[ "$clip" != "" ] && notify-send "<b>Clipboard (C-v):</b> -$clip" -[ "$prim" != "" ] && notify-send "<b>Primary (middle click):</b> -$prim" +[ "$clip" != "" ] && notify-send "Clipboard (C-v)" "$clip" +[ "$prim" != "" ] && notify-send "Primary (middle click)" "$prim" diff --git a/bin/t-daemon-toggle b/bin/t-daemon-toggle @@ -2,7 +2,7 @@ # If transmission-daemon is running, will ask to kill, else will ask to start. -[ ! -f /usr/bin/transmission-daemon ] && notify-send "Transmission daemon not installed." && exit +[ ! -f /usr/bin/transmission-daemon ] && notify-send "${0##/*}" "Transmission daemon not installed." && exit if pgrep -x transmission-da >/dev/null ; then diff --git a/bin/xrandr-auto.sh b/bin/xrandr-auto.sh @@ -39,13 +39,13 @@ function EXTConnected { #do if ! EXTActive && EXTConnected then - notify-send "Activating external monitor $EXSCR" + notify-send "${0##/*}" "Activating external monitor $EXTSCR" ActivateEXT fi if EXTActive && ! EXTConnected then - notify-send "Deactivating external monitor $EXSCR" + notify-send "${0##/*}" "Deactivating external monitor $EXTSCR" DeactivateEXT fi