From 33788846e2662d0bf792401fd770fe5d738e60af Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 23 Feb 2021 18:11:25 +0100 Subject: Updated volume notification done directly by pulseaudio-ctl, with dunst configured to stack them (like regular volume notification), Removed volume-ctl script --- bin/volume-ctl | 12 ------------ dunst/dunstrc | 12 ++++++------ install | 1 + pulseaudio-ctl/config | 25 +++++++++++++++++++++++++ xmonad.hs | 11 ++++------- 5 files changed, 36 insertions(+), 25 deletions(-) delete mode 100755 bin/volume-ctl create mode 100644 pulseaudio-ctl/config diff --git a/bin/volume-ctl b/bin/volume-ctl deleted file mode 100755 index 7e3ec83..0000000 --- a/bin/volume-ctl +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -[ "$#" -ne 1 ] && exit 1; - -case "$1" in - "up") pulseaudio-ctl up ;; - "down") pulseaudio-ctl down ;; - "mute") pulseaudio-ctl mute ;; - *) exit 1 ;; -esac - -notify-send "volume $(pulseaudio-ctl full-status | cut -d ' ' -f 1)" diff --git a/dunst/dunstrc b/dunst/dunstrc index a9eba7f..3e10f2e 100644 --- a/dunst/dunstrc +++ b/dunst/dunstrc @@ -126,7 +126,7 @@ # %n progress value if set without any extra characters # %% Literal % # Markup is allowed - format = "%s\n%b" + format = "%s\n%b%p" # Alignment of message text. # Possible values are "left", "center" and "right". @@ -406,9 +406,9 @@ # appname = Pidgin # summary = *twitter.com* # urgency = normal -# -#[stack-volumes] -# appname = "some_volume_notifiers" -# set_stack_tag = "volume" -# + +[stack-volumes] + appname = "pulseaudio-ctl" + set_stack_tag = "volume" + # vim: ft=cfg diff --git a/install b/install index 8d639da..5b12db2 100755 --- a/install +++ b/install @@ -45,6 +45,7 @@ create_dotfile_link applications/zathura.desktop .data/applications/zathura.des create_dotfile_link applications/newsboat.desktop .data/applications/newsboat.desktop create_dotfile_link dunst/dunstrc .config/dunst/dunstrc +create_dotfile_link pulseaudio-ctl/config .config/pulseaudio-ctl/config create_dotfile_link_same .newsboat/config #create_dotfile_link_same .newsboat/urls diff --git a/pulseaudio-ctl/config b/pulseaudio-ctl/config new file mode 100644 index 0000000..51d65b4 --- /dev/null +++ b/pulseaudio-ctl/config @@ -0,0 +1,25 @@ +# +# $HOME/.config/pulseaudio-ctl/config +# + +# The default setting is for pulseaudio-ctl to NOT increase to volume level +# above 100 % but Some users may wish exceed this level. If this describes +# your use case, uncomment the UPPER_THRESHOLD variable below setting it to +# the new upper threshold. +# +#UPPER_THRESHOLD=150 + +# Push output through libnotify. Set to any value to enable this feature +# and note that you must have /usr/bin/notify-send to use this. On Arch +# libnotify provides this. Other distros may not name it as such. +# +NOTIFY=yes + +# Show a graphical progress-bar type visualization of the volume level in +# libnotify. No setting or commented out will show a simply percentage but +# a setting will convert the percentage to a progress-bar in libnotify. +# +BARCHART=yes + +# Use KDE OSD notification. Set to any value to enable this feature. +#KDE_OSD=yes diff --git a/xmonad.hs b/xmonad.hs index d165011..b18951e 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -39,14 +39,11 @@ myLayouts = tiledBigMaster -- bigger master for code and smaller slave fo myManageHook = insertPosition End Newer -- insert new window at the end of the current layout -volumeUpCmd = "pulseaudio-ctl up" -volumeDownCmd = "pulseaudio-ctl down" - -myKeys = [ ("", spawn volumeDownCmd) - , ("", spawn volumeUpCmd) +myKeys = [ ("", spawn "pulseaudio-ctl down") + , ("", spawn "pulseaudio-ctl up") , ("", spawn "pulseaudio-ctl mute") - , ("M-", spawn volumeDownCmd) - , ("M-", spawn volumeUpCmd) + , ("M-", spawn "pulseaudio-ctl down") + , ("M-", spawn "pulseaudio-ctl up") , ("", spawn "~/bin/backlight-ctl up") , ("", spawn "~/bin/backlight-ctl down") -- cgit