Skip to content

Commit

Permalink
dotfiles: replace all references to dunstify with notify-send
Browse files Browse the repository at this point in the history
Which is daemon-agnostic

It does seem that dunstify is agnostic too, but I'd rather not have to
install it to either figure it out or to run my system at all.

Been using mako lately
  • Loading branch information
anachronic committed Nov 17, 2023
1 parent a9a313c commit bb30fc5
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion arch/link/.local/bin/ach-emoji
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ emoji=$(bemenu -l 20 -i -p "Emoji >" < "$emojipath" | awk '{print $1}')
[ "$emoji" = "" ] && exit 1

printf "%s" "$emoji" | clipboard
dunstify -a ach-emoji "Emoji" "Copied emoji" -u low
notify-send -a ach-emoji "Emoji" "Copied emoji" -u low

if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
wtype "$emoji"
Expand Down
6 changes: 3 additions & 3 deletions arch/link/.local/bin/ach-reminder
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ reminder=$(echo | bemenu -i -p "Remind what? >")
when=$(echo | bemenu -i -p "When? (at format) >")
[ "$when" = "" ] && exit 1

output=$(echo "dunstify -a reminders Reminder \"$reminder\" -u critical" | at "$when" 2>&1)
output=$(echo "notify-send -a reminders Reminder \"$reminder\" -u critical" | at "$when" 2>&1)

if echo "$output" | grep -i garbled > /dev/null; then
dunstify -a reminders "Reminder failed" "at command reported garbled time"
notify-send -a reminders "Reminder failed" "at command reported garbled time"
else
dunstify -a reminders "Reminders" "Reminder set for $when" -u low
notify-send -a reminders "Reminders" "Reminder set for $when" -u low
fi
6 changes: 4 additions & 2 deletions arch/link/.local/bin/ach-screenshot
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

set -e

copy-region() {
grim -g "$(slurp)" - | pbcopy

dunstify -a screenshot "Screenshot" "Copied to clipboard" -u low
notify-send -a screenshot "Screenshot" "Copied to clipboard" -u low
}

save-region() {
Expand All @@ -14,7 +16,7 @@ save-region() {
screenshot_path="$HOME/pictures/screenshots/grabbed/$(date --iso-8601=minutes).png"
grim "$screenshot_path"

dunstify -a screenshot "Screenshot" "Saved to $screenshot_path" -u low
notify-send -a screenshot "Screenshot" "Saved to $screenshot_path" -u low
}

if [ "$1" = "" ]; then
Expand Down
2 changes: 1 addition & 1 deletion arch/link/.local/bin/ach-volume-notify
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ volume=$(pactl get-sink-volume "$sink" | awk -F '/' '{print $2}' | xargs)
dunst_stack="ach-volume"

notify() {
dunstify \
notify-send \
-a "ach-volume" \
"Volume" \
-h string:x-dunst-stack-tag:"$dunst_stack" \
Expand Down
2 changes: 1 addition & 1 deletion arch/link/.local/bin/insomnia
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
if [ -e /opt/insomnia/insomnia ]; then
/opt/insomnia/insomnia
else
dunstify "Insomnia" "/opt/insomnia/insomnia does not exist. Cannot run insomnia"
notify-send "Insomnia" "/opt/insomnia/insomnia does not exist. Cannot run insomnia"
fi
2 changes: 1 addition & 1 deletion arch/link/.local/bin/mpc-random
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

mpc random

dunstify -a mpc "mpc" "Random is $(mpc status "%random%")"
notify-send -a mpc "mpc" "Random is $(mpc status "%random%")"
2 changes: 1 addition & 1 deletion arch/link/.local/bin/st-linkgrabber
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
url=$(cat | xurls | uniq | bemenu -W 0.4 -c -w "$WINDOWID" -l 20 -i -p "Open what? >")

[ -z "$url" ] && exit 1
dunstify -a st st "selected $url"
notify-send -a st st "selected $url"

setsid xdg-open "$url"
2 changes: 1 addition & 1 deletion arch/link/.local/bin/torrentadd
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
! pidof transmission-daemon > /dev/null && exit 1

transmission-remote --add "$@"
dunstify -a torrentadd -u low Transmission "Torrent added"
notify-send -a torrentadd -u low Transmission "Torrent added"
6 changes: 3 additions & 3 deletions common/link/.config/lf/lfrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cmd yank-path ${{

paths=$(echo "$fx" | wc -l)
plural=$([ "1" -eq "$paths" ] && echo "path" || echo "paths")
dunstify -a lf "lf" "copied $paths $plural to clipboard" -t 1700 -u low -i /usr/share/icons/breeze-dark/apps/48/klipper.svg
notify-send -a lf "lf" "copied $paths $plural to clipboard" -t 1700 -u low -i /usr/share/icons/breeze-dark/apps/48/klipper.svg
}}

cmd open ${{
Expand All @@ -32,15 +32,15 @@ cmd delete ${{

files=$(echo "$fx" | wc -l)
plural=$([ "1" -eq "$files" ] && echo "file" || echo "files")
dunstify -a lf "lf" "Deleted $files $plural." -i /usr/share/icons/breeze-dark/places/96/user-trash.svg -t 1700 -u low
notify-send -a lf "lf" "Deleted $files $plural." -i /usr/share/icons/breeze-dark/places/96/user-trash.svg -t 1700 -u low
}}

cmd movehere ${{
mv $fx $PWD

files=$(echo "$fx" | wc -l)
plural=$([ "1" -eq "$files" ] && echo "file" || echo "files")
dunstify -a lf "lf" "Moved $files $plural to $PWD" -i /usr/share/icons/breeze-dark/places/96/user-trash.svg -u low
notify-send -a lf "lf" "Moved $files $plural to $PWD" -i /usr/share/icons/breeze-dark/places/96/user-trash.svg -u low
}}

# extract the current file with the right command
Expand Down

0 comments on commit bb30fc5

Please sign in to comment.