Compare commits
6 commits
41f48aa208
...
99ef28fe19
Author | SHA1 | Date | |
---|---|---|---|
99ef28fe19 | |||
cbb33f7fe0 | |||
beefe545ed | |||
e2ce724bed | |||
7e37c1b579 | |||
62ca2d43bc |
6 changed files with 16 additions and 44 deletions
|
@ -34,7 +34,6 @@ in {
|
|||
pkgs.go-task
|
||||
pkgs.convco
|
||||
pkgs.typos
|
||||
pkgs.home-manager
|
||||
];
|
||||
};
|
||||
});
|
||||
|
@ -103,8 +102,8 @@ in {
|
|||
};
|
||||
extraSpecialArgs = {
|
||||
inherit stateVersion inputs;
|
||||
hostname = "work";
|
||||
username = "yorick-barbanneau";
|
||||
hostname = "yorick-Latitude-7320";
|
||||
username = "yorick";
|
||||
};
|
||||
modules = [
|
||||
./home-manager/default.nix
|
||||
|
|
|
@ -17,6 +17,4 @@
|
|||
slurp
|
||||
wl-clipboard
|
||||
];
|
||||
targets.genericLinux.enable = true;
|
||||
xdg.mime.enable = true;
|
||||
}
|
|
@ -9,59 +9,36 @@ process_args() {
|
|||
done
|
||||
}
|
||||
|
||||
#
|
||||
escape(){
|
||||
local string
|
||||
string=$1
|
||||
string=${string//"<"/"<"}
|
||||
string=${string//">"/">"}
|
||||
string=${string//"&"/"&"}
|
||||
printf "%s" "$string"
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
options=( --app-name=cmus --transient -u low)
|
||||
|
||||
filename=${file##*/}
|
||||
filename=${file#*/}
|
||||
image=${file%/*}/cover.jpg
|
||||
|
||||
if [[ -f "$image" ]]; then
|
||||
options+=( -i "${image}" )
|
||||
fi
|
||||
[ -f "$image" ] && options="$options -i \"${image}\""
|
||||
|
||||
## Get title or filename
|
||||
title=${title:-$filename}
|
||||
if [[ ${#title} -gt 25 ]]; then
|
||||
title="${title:0:24}…"
|
||||
fi
|
||||
title="<b>$title</b>"
|
||||
|
||||
if [ -n "$artist" ]
|
||||
then
|
||||
if [[ ${#artist} -gt 22 ]]; then
|
||||
artist="${artist:0:21}…"
|
||||
artist="<i>by</i> ${artist:0:21}…"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$album" ]
|
||||
then
|
||||
if [[ ${#album} -gt 19 ]]; then
|
||||
album="${album:0:18}…"
|
||||
fi
|
||||
printf -v l_artist "<span size='x-large'>by </span>%s" "$(escape "$artist")"
|
||||
fi
|
||||
|
||||
if [ -n "$date" ]
|
||||
then
|
||||
date="${date%%-*}"
|
||||
fi
|
||||
|
||||
# Get Album
|
||||
if [ -n "$album" ]
|
||||
then
|
||||
if [[ ${#album} -gt 19 ]]; then
|
||||
album="${album:0:19}…"
|
||||
fi
|
||||
printf -v l_album "<span size='x-large'>on </span>%-20s <span size='x-large'>%s</span>" "$(escape "$album")" "${date:-}"
|
||||
fi
|
||||
|
||||
printf -v l_intro "<span variant='small-caps'>cmus:<b>%s</b></span>" "$(escape "$status")"
|
||||
printf -v body "%s\n" "${l_intro:-}" "${title:-}" "${l_artist:-}" "${l_album:-}"
|
||||
notify-send "${options[@]}" "unseless" "$body"
|
||||
printf -v body "%s\n%-19s <i>%s</i>" "${artist:-}" "${album:-}" "${date:-}"
|
||||
notify-send --app-name=cmus -i "$image" "$title" "$body"
|
||||
}
|
||||
|
||||
process_args "$@"
|
||||
|
|
|
@ -52,5 +52,5 @@ set color_win_inactive_sel_fg=20
|
|||
set color_win_dir=default
|
||||
|
||||
set status_display_program=~/.config/cmus/notify.sh
|
||||
set format_current= %{?stream??} %t %{?a?by %a} %{?l?on %l}%= %y
|
||||
|
||||
add -l ~/medias/music
|
||||
|
|
|
@ -26,7 +26,6 @@ with lib;
|
|||
maxIconSize = 64;
|
||||
layer = "overlay";
|
||||
anchor = "top-right";
|
||||
format = ''<span font_scale="small-caps">%a</span>\n<b>%s</b>\n%b'';
|
||||
extraConfig = ''
|
||||
[urgency="high"]
|
||||
border-color=#F268b3
|
||||
|
@ -35,10 +34,9 @@ with lib;
|
|||
border-size=1
|
||||
default-timeout=7000
|
||||
group-by=app-name
|
||||
format=%b
|
||||
|
||||
[app-name="cmus" grouped]
|
||||
format=%b
|
||||
format=<b>%s</b>\n%b
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue