update conf
This commit is contained in:
@ -30,8 +30,8 @@ exec-once = quickshell
|
||||
exec-once = dunst
|
||||
exec-once = firefox
|
||||
exec-once = hyprpaper
|
||||
exec-once = [workspace 9 silent] deezer-desktop
|
||||
exec-once = ./scripts/close-monokai-popup.sh
|
||||
exec-once = [workspace 9 silent] gtk-launch deezer-pwa
|
||||
# exec-once = ./scripts/close-monokai-popup.sh
|
||||
|
||||
# gnome keyring secret service
|
||||
exec-once = dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE
|
||||
@ -301,11 +301,11 @@ bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-
|
||||
|
||||
# Requires playerctl
|
||||
# Deezer controls
|
||||
bind = CTRL ALT, K, exec, playerctl --player=deezer play-pause
|
||||
bind = CTRL ALT, Left, exec, playerctl --player=deezer previous
|
||||
bind = CTRL ALT, Right, exec, playerctl --player=deezer next
|
||||
bind = CTRL ALT, Up, exec, ~/.config/hypr/scripts/deezer-volume.sh +5%
|
||||
bind = CTRL ALT, Down, exec, ~/.config/hypr/scripts/deezer-volume.sh -5%
|
||||
bind = CTRL ALT, K, exec, ~/.config/hypr/scripts/deezer-controls.sh play-pause
|
||||
bind = CTRL ALT, Left, exec, ~/.config/hypr/scripts/deezer-controls.sh previous
|
||||
bind = CTRL ALT, Right, exec, ~/.config/hypr/scripts/deezer-controls.sh next
|
||||
bind = CTRL ALT, Up, exec, ~/.config/hypr/scripts/deezer-controls.sh +5%
|
||||
bind = CTRL ALT, Down, exec, ~/.config/hypr/scripts/deezer-controls.sh -5%
|
||||
|
||||
bind = ,F7,pass,class:^(discord)$
|
||||
bind = ,F8,pass,class:^(discord)$
|
||||
|
||||
95
roles/hyprland/files/hypr/scripts/deezer-controls.sh
Executable file
95
roles/hyprland/files/hypr/scripts/deezer-controls.sh
Executable file
@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
action="$1"
|
||||
|
||||
if [ -z "$action" ]; then
|
||||
echo "Usage: $0 [play-pause|next|previous|+5%|-5%|50%]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Deezer PWA PID
|
||||
root_pid=$(hyprctl clients -j | jq -r '.[] | select(.initialTitle == "Deezer") | .pid' | head -n1)
|
||||
|
||||
if [ -z "$root_pid" ] || [ "$root_pid" = "null" ]; then
|
||||
echo "[ERROR] Deezer window not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$action" in
|
||||
play-pause|next|previous)
|
||||
playerctl --player="chromium.instance${root_pid}" "$action"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
# Volume: find sink-input whose PID is in the process tree
|
||||
pids=$(pstree -p "$root_pid" | grep -oP '\(\K[0-9]+')
|
||||
sink=$(pactl -f json list sink-inputs | jq -r --argjson pids "$(echo "$pids" | jq -R . | jq -s 'map(tonumber)')" \
|
||||
'.[] | select(.properties["application.process.id"] | tonumber | IN($pids[])) | .index' | head -n1)
|
||||
|
||||
if [ -z "$sink" ]; then
|
||||
echo "[ERROR] No audio stream found for Deezer."
|
||||
exit 1
|
||||
fi
|
||||
pactl set-sink-input-volume "$sink" "$action"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#
|
||||
# # 2) Gather ALL descendant PIDs
|
||||
# declare -a pid_array
|
||||
# pid_array+=("$root_pid")
|
||||
#
|
||||
# # Direct children
|
||||
# children=($(pgrep -P "$root_pid"))
|
||||
# echo "[INFO] Children: ${children[*]}"
|
||||
#
|
||||
# for c in "${children[@]}"; do
|
||||
# pid_array+=("$c")
|
||||
# gc=($(pgrep -P "$c"))
|
||||
# echo "[INFO] Grandchildren of $c: ${gc[*]}"
|
||||
# for g in "${gc[@]}"; do
|
||||
# pid_array+=("$g")
|
||||
# done
|
||||
# done
|
||||
#
|
||||
# echo "[INFO] All collected PIDs: ${pid_array[*]}"
|
||||
#
|
||||
# echo "----------------------------------"
|
||||
# echo "[INFO] Checking sink inputs..."
|
||||
# echo "----------------------------------"
|
||||
#
|
||||
# sink=""
|
||||
#
|
||||
# while IFS= read -r block; do
|
||||
# pid=$(echo "$block" | jq -r '.properties["application.process.id"] // empty')
|
||||
# index=$(echo "$block" | jq -r '.index')
|
||||
#
|
||||
# echo "[SINK] index=$index pid=$pid"
|
||||
#
|
||||
# [ -z "$pid" ] && { echo " -> Skipping"; continue; }
|
||||
#
|
||||
# for candidate in "${pid_array[@]}"; do
|
||||
# if [ "$pid" = "$candidate" ]; then
|
||||
# echo " -> MATCH with PID $candidate"
|
||||
# sink="$index"
|
||||
# break 2
|
||||
# fi
|
||||
# done
|
||||
#
|
||||
# echo " -> No match"
|
||||
#
|
||||
# done < <(pactl -f json list sink-inputs | jq -c '.[]')
|
||||
#
|
||||
# echo "----------------------------------"
|
||||
#
|
||||
# if [ -z "$sink" ]; then
|
||||
# echo "[ERROR] No audio stream found for Deezer."
|
||||
# exit 1
|
||||
# fi
|
||||
#
|
||||
# echo "[INFO] Deezer sink index: $sink"
|
||||
# echo "[INFO] Applying: $change"
|
||||
#
|
||||
# pactl set-sink-input-volume "$sink" "$change"
|
||||
#
|
||||
@ -1,77 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
change="$1"
|
||||
|
||||
if [ -z "$change" ]; then
|
||||
echo "Usage: $0 [+5%|-5%|50%]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== Deezer Volume Debug (FIXED) ==="
|
||||
|
||||
# 1) Deezer window PID
|
||||
root_pid=$(hyprctl clients -j | jq -r '.[] | select(.class == "deezer-desktop") | .pid' | head -n1)
|
||||
echo "[INFO] Deezer window PID: $root_pid"
|
||||
|
||||
if [ -z "$root_pid" ] || [ "$root_pid" = "null" ]; then
|
||||
echo "[ERROR] Deezer window not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 2) Gather ALL descendant PIDs
|
||||
declare -a pid_array
|
||||
pid_array+=("$root_pid")
|
||||
|
||||
# Direct children
|
||||
children=($(pgrep -P "$root_pid"))
|
||||
echo "[INFO] Children: ${children[*]}"
|
||||
|
||||
for c in "${children[@]}"; do
|
||||
pid_array+=("$c")
|
||||
gc=($(pgrep -P "$c"))
|
||||
echo "[INFO] Grandchildren of $c: ${gc[*]}"
|
||||
for g in "${gc[@]}"; do
|
||||
pid_array+=("$g")
|
||||
done
|
||||
done
|
||||
|
||||
echo "[INFO] All collected PIDs: ${pid_array[*]}"
|
||||
|
||||
echo "----------------------------------"
|
||||
echo "[INFO] Checking sink inputs..."
|
||||
echo "----------------------------------"
|
||||
|
||||
sink=""
|
||||
|
||||
while IFS= read -r block; do
|
||||
pid=$(echo "$block" | jq -r '.properties["application.process.id"] // empty')
|
||||
index=$(echo "$block" | jq -r '.index')
|
||||
|
||||
echo "[SINK] index=$index pid=$pid"
|
||||
|
||||
[ -z "$pid" ] && { echo " -> Skipping"; continue; }
|
||||
|
||||
for candidate in "${pid_array[@]}"; do
|
||||
if [ "$pid" = "$candidate" ]; then
|
||||
echo " -> MATCH with PID $candidate"
|
||||
sink="$index"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
|
||||
echo " -> No match"
|
||||
|
||||
done < <(pactl -f json list sink-inputs | jq -c '.[]')
|
||||
|
||||
echo "----------------------------------"
|
||||
|
||||
if [ -z "$sink" ]; then
|
||||
echo "[ERROR] No audio stream found for Deezer."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[INFO] Deezer sink index: $sink"
|
||||
echo "[INFO] Applying: $change"
|
||||
|
||||
pactl set-sink-input-volume "$sink" "$change"
|
||||
|
||||
Reference in New Issue
Block a user