From dfdc8e86b27197ea874929537a8129cc552ff599 Mon Sep 17 00:00:00 2001 From: katherine Date: Sun, 11 Dec 2022 20:56:27 -0700 Subject: update to latest dunst remove forked version and make necessary relevant adjustments --- .config/herbstluftwm/autostart | 9 ++++----- .config/herbstluftwm/mpc-status.sh | 15 ++++++--------- .config/herbstluftwm/pvol.sh | 17 +++++++++++------ 3 files changed, 21 insertions(+), 20 deletions(-) (limited to '.config/herbstluftwm') diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index 89b7ff8..f0305c9 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -107,6 +107,9 @@ hc keybind Mod4-w jumpto last-minimized ## launchers +#dunst +hc keybind Mod4-minus spawn dunstctl close-all + #pass hc keybind Mod4-x spawn ~/.config/herbstluftwm/pass.sh hc keybind Mod4-Shift-x spawn ~/.config/herbstluftwm/pass.sh -f @@ -225,8 +228,4 @@ done # run dunst with theme colours pkill dunst -dunst -lb $bar_bg -nb $bar_bg -cb $bg_focus \ - -lf $bar_fg -nf $bar_fg -cf $fg_focus \ - -frame_color $bg_focus -geom "0x3-4+$(($bheight + 4))" \ - -fn "$mfont $mfont_size" \ - -max_icon_size 0 +dunst & diff --git a/.config/herbstluftwm/mpc-status.sh b/.config/herbstluftwm/mpc-status.sh index 6f3f699..31c13f4 100755 --- a/.config/herbstluftwm/mpc-status.sh +++ b/.config/herbstluftwm/mpc-status.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env zsh source $HOME/.config/init/vars -case "$1" in +case $1 in next) mpc next ;; @@ -15,23 +15,20 @@ esac mpc status >/dev/null 2>&1 if [[ $? -ne 0 ]]; then - notify-send -a closeme "mpd disconnected" + dunstify -r 109112100 "mpd disconnected" exit fi -if [[ -z "$(mpc status | grep -E '\[(playing|paused)\]')" ]]; then - notify-send -a closeme "mpd stopped" +if [[ -z $(mpc status | grep -E '\[(playing|paused)\]') ]]; then + dunstify -r 109112100 "mpd stopped" exit fi cd ~/music/ dir=$(dirname "$(mpc current -f %file%)") -# linking is necessary because notify-send can't into icon paths containing commas -cd $tmpdir -ln -sf "$HOME/music/$dir/cover-small.png" mpd-icon.png message="$(mpc current -f '##%track% %title% (%date%)\n%artist% - %album%') $(mpc status | tail -n -2 | sed -re 's/volume.*repeat/\nrepeat/' -e 's/( ){3,4}/\n/g' -e '/volume: /d')" -notify-send -t 4000 -a closeme --icon=$tmpdir/mpd-icon.png "$message" +dunstify -t 4000 -r 109112100 --icon="$HOME/music/$dir/cover-small.png" $message diff --git a/.config/herbstluftwm/pvol.sh b/.config/herbstluftwm/pvol.sh index 820d890..8d5984e 100755 --- a/.config/herbstluftwm/pvol.sh +++ b/.config/herbstluftwm/pvol.sh @@ -2,15 +2,20 @@ case "$1" in down) - pavolume voldown --quiet 2 + pactl set-sink-volume @DEFAULT_SINK@ -2% ;; up) - pavolume volup --quiet 2 + pactl set-sink-volume @DEFAULT_SINK@ +2% ;; mute) - pavolume mutetoggle --quiet - ;; - *) - pavolume show + pactl set-sink-mute @DEFAULT_SINK@ toggle ;; esac + +{ + [[ $(pactl get-sink-mute @DEFAULT_SINK@) =~ "yes" ]] && printf "Muted: " || printf "Volume: " + + pactl get-sink-volume @DEFAULT_SINK@ | sed -e N -e 's/\n//g' -e 's/.* \([0-9]\{1,2\}%\).*/\1/' +} | read body + +dunstify -r 118111108 $body -- cgit v1.2.3