From 439829da61eca4a985ab4e1f89c0db1b8c65d962 Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Fri, 26 Feb 2021 03:52:18 +0300 Subject: [PATCH] notification: change redundant hardcoded `mako` --- deploy.sh | 1 + home/.config/anime-downloader/config.json | 4 ++-- home/.config/ncmpcpp/album_art.sh | 11 +++++++++-- home/.local/bin/Wayland/clipboard | 9 ++++++++- home/.local/bin/Wayland/screenshot | 15 +++++++++++---- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/deploy.sh b/deploy.sh index 6fab5d8..c005f6a 100755 --- a/deploy.sh +++ b/deploy.sh @@ -87,6 +87,7 @@ cp -rfv ./home/.local/share/fonts/ ~/.local/share/fonts/ # Scripts cp -rfv ./home/.local/bin/ ~/.local/bin/ # The bloated dotfiles itself +cp -rfv ./home/.rtorrent.rc ~/.rtorrent.rc cp -rfv ./home/.config/alacritty/ ~/.config/alacritty/ cp -rfv ./home/.config/amfora/ ~/.config/amfora/ cp -rfv ./home/.config/anime-downloader/ ~/.config/anime-downloader/ diff --git a/home/.config/anime-downloader/config.json b/home/.config/anime-downloader/config.json index 2ccf837..e364ecf 100644 --- a/home/.config/anime-downloader/config.json +++ b/home/.config/anime-downloader/config.json @@ -12,7 +12,7 @@ "file_format": "{anime_title}/{anime_title}_{ep_no}", "force_download": false, "player": "mpv", - "provider": "4anime", + "provider": "anime8", "quality": "1080p", "skip_download": false, "url": false @@ -120,7 +120,7 @@ "360p" ], "log_level": "INFO", - "provider": "4anime", + "provider": "anime8", "quality": "1080p" } } diff --git a/home/.config/ncmpcpp/album_art.sh b/home/.config/ncmpcpp/album_art.sh index 500709e..7b6cea7 100755 --- a/home/.config/ncmpcpp/album_art.sh +++ b/home/.config/ncmpcpp/album_art.sh @@ -3,6 +3,13 @@ MUSIC_DIR=$HOME/Music/ COVER=/tmp/cover.jpg +if command -v mako >/dev/null +then + notification=mako +else + notification=dunst +fi + { file="$(mpc --format %file% current -p 6600)" album_dir="${file%/*}" @@ -17,9 +24,9 @@ COVER=/tmp/cover.jpg # Resize the image's width to 64px convert "$src" -resize 64x "$COVER" if [[ -f "$COVER" ]] ; then - notify-send -u low -i ${COVER} " Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)" + notify-send -u low -i ${COVER} " Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)" fi else - notify-send -u low -i $HOME/.config/dunst/headphones.png " Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)" + notify-send -u low -i $HOME/.config/${notification}/headphones.png " Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)" fi } & diff --git a/home/.local/bin/Wayland/clipboard b/home/.local/bin/Wayland/clipboard index 2e0575e..eb463fd 100755 --- a/home/.local/bin/Wayland/clipboard +++ b/home/.local/bin/Wayland/clipboard @@ -1,5 +1,12 @@ #!/bin/sh +if command -v mako >/dev/null +then + notification=mako +else + notification=dunst +fi + case $1 in --wofi) clipman pick --tool wofi -T'-p "Clipboard " -i -O default' @@ -11,7 +18,7 @@ case $1 in clipman pick --tool fzf -T'--no-multi -e' ;; --clear) - clipman clear --all && notify-send -i $HOME/.config/mako/clipboard.png "Clipboard cleared" + clipman clear --all && notify-send -i $HOME/.config/${notification}/clipboard.png "Clipboard cleared" ;; *) ;; diff --git a/home/.local/bin/Wayland/screenshot b/home/.local/bin/Wayland/screenshot index b64a653..676eb7d 100755 --- a/home/.local/bin/Wayland/screenshot +++ b/home/.local/bin/Wayland/screenshot @@ -3,15 +3,22 @@ mkdir -p ~/Screenshots SAVEPATH="$HOME/Screenshots/$(date +'%Y-%m-%d-%H%M%S_grim.png')" +if command -v mako >/dev/null +then + notification=mako +else + notification=dunst +fi + case $1 in --full) grim "${SAVEPATH}" - notify-send -i $HOME/.config/mako/photograph.png "Screenshot taken..." + notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot taken..." ;; --region) GEOMETRY=$(slurp) grim -g "${GEOMETRY}" "${SAVEPATH}" - notify-send -i $HOME/.config/mako/photograph.png "Screenshot taken..." + notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot taken..." ;; --full-optional) grim - | swappy -f - @@ -22,12 +29,12 @@ case $1 in ;; --full-copy) grim - | wl-copy - notify-send -i $HOME/.config/mako/photograph.png "Screenshot copied..." + notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot copied..." ;; --region-copy) GEOMETRY=$(slurp) grim -g "${GEOMETRY}" - | wl-copy - notify-send -i $HOME/.config/mako/photograph.png "Screenshot copied..." + notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot copied..." ;; *) ;;