From 0ad07054fbeee0af5379bbe0a3c15b7bc59aa3fa Mon Sep 17 00:00:00 2001 From: Dor dicke Gind Date: Mon, 2 Oct 2023 00:44:26 +0200 Subject: [PATCH] [TASK] change lollypop column control shortcut script --- .../xfce4-keyboard-shortcuts.xml | 7 ++++--- Scripts/lollypop-volumne-ctrl.sh | 13 +++++++++++++ Scripts/lollypopVolumne50.sh | 2 -- Scripts/lollypopVolumne75.sh | 2 -- 4 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 Scripts/lollypop-volumne-ctrl.sh delete mode 100755 Scripts/lollypopVolumne50.sh delete mode 100755 Scripts/lollypopVolumne75.sh diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml index 35cc234..6ab82ab 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml @@ -29,6 +29,7 @@ + @@ -55,8 +56,6 @@ - - @@ -65,6 +64,8 @@ + + @@ -123,8 +124,8 @@ - + diff --git a/Scripts/lollypop-volumne-ctrl.sh b/Scripts/lollypop-volumne-ctrl.sh new file mode 100644 index 0000000..ab875b4 --- /dev/null +++ b/Scripts/lollypop-volumne-ctrl.sh @@ -0,0 +1,13 @@ +#!/bin/bash +expireTimeNotifyOSD=3000 +currentId=2 +tmpFile=/tmp/currentLollypopVolumnNotifyId + +currentVolume=$(dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Volume' | grep -Eo '[+-]?[0-9]+([.][0-9]+)?' | tail -n 1) +operator=$1 +newVolume=$(echo $currentVolume $operator 0.05 | bc) +newVolumeAsInt=$(echo $newVolume | cut -c 2-3) +dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Set string:'org.mpris.MediaPlayer2.Player' string:'Volume' variant:double:$newVolume + +notify-send "Volume $newVolumeAsInt" "test" -p -t $expireTimeNotifyOSD -r $currentId -i org.gnome.Lollypop -h int:value:$newVolumeAsInt > $tmpFile +l \ No newline at end of file diff --git a/Scripts/lollypopVolumne50.sh b/Scripts/lollypopVolumne50.sh deleted file mode 100755 index 42c2101..0000000 --- a/Scripts/lollypopVolumne50.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Set string:'org.mpris.MediaPlayer2.Player' string:'Volume' variant:double:0.55 \ No newline at end of file diff --git a/Scripts/lollypopVolumne75.sh b/Scripts/lollypopVolumne75.sh deleted file mode 100755 index 4f1bf25..0000000 --- a/Scripts/lollypopVolumne75.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Set string:'org.mpris.MediaPlayer2.Player' string:'Volume' variant:double:0.8 \ No newline at end of file