Skip to content

Commit 79c91ef

Browse files
committed
fix: revert spotify
1 parent f80af47 commit 79c91ef

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
3232
- waybar: Try to force initialization on restore (redundancy) might fix [#1160](https://github.com/HyDE-Project/HyDE/issues/1160)
3333
- Added pyprland boilerplate, no configs for now
3434
- Hyprland: Graciously handle some of the issues hyprland config issues for unknown SHELL
35+
- Pyprland: Use nc or socat to communicate with pyprland instead of pure python
3536

3637
## v25.8.1
3738

Configs/.config/hyde/wallbash/scripts/spotify.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ if (pkg_installed spotify && pkg_installed spicetify-cli) || [ -n "$spotify_path
8585
if pgrep -x spotify >/dev/null; then
8686
pkill -x spicetify
8787
spicetify -q watch -s &
88-
sleep 3
89-
if pgrep -x spotify >/dev/null; then
90-
spicetify restart
91-
fi
88+
disown
9289
fi
9390
fi

Configs/.local/bin/hyde-shell

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ call_wallbashScript() {
6161
local scriptName=$1
6262
shift
6363
local args=("${@}")
64-
local dirs=("${wallbashDirs[@]}")
64+
local dirs=("${WALLBASH_DIRS[@]}")
6565
sanitized_dirs=()
6666
for dir in "${dirs[@]}"; do
6767
if [[ -d "$dir" ]]; then
@@ -193,7 +193,7 @@ get_completion_data() {
193193
done < <(list_script 2>/dev/null | sort -u)
194194

195195
# Get wallbash scripts
196-
local dirs=("${wallbashDirs[@]}")
196+
local dirs=("${WALLBASH_DIRS[@]}")
197197
wallbash_scripts=("--help") # Add --help as first option
198198
# Simplified - just --help for now since dynamic parsing is complex
199199

@@ -459,12 +459,27 @@ run_pypr() {
459459
if command -v pypr >/dev/null 2>&1; then
460460

461461
socket_path="${XDG_RUNTIME_DIR}/hypr/${HYPRLAND_INSTANCE_SIGNATURE}/.pyprland.sock"
462+
if [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/hypr/pyprland.toml " ]]; then
463+
send_notifs "Missing pyprland.toml" "Please create a pyprland.toml file in ${XDG_CONFIG_HOME:-$HOME/.config}/hypr/ to configure PyPR."
464+
exit 1
465+
fi
462466

463467
if [[ -S "$socket_path" ]] && pgrep -u "$USER" pypr >/dev/null 2>&1; then
464-
exec app2unit.sh pypr "$@"
468+
message="${*:-"help"}"
469+
# Send the message to the socket and print the response
470+
if ! printf "%s" "${message[@]}" | nc -N -U "$socket_path"; then
471+
if ! printf "%s" "${message[@]}" | socat - UNIX-CONNECT:"$socket_path"; then
472+
print_log -sec "pypr" "Error communicating with socket: $socket_path"
473+
exit 1
474+
fi
475+
476+
fi
477+
465478
else
466479
print_log -sec "pypr" "PyPR is not running properly, starting fresh"
467-
rm "$socket_path"
480+
[[ -S "$socket_path" ]] && print_log -y "Removing stale socket: $socket_path"
481+
pgrep -u "$USER" pypr >/dev/null && print_log -y "Killing existing pypr process"
482+
rm -f "$socket_path"
468483

469484
exec app2unit.sh -t service pypr
470485
fi

0 commit comments

Comments
 (0)