Skip to content

Commit 4799b72

Browse files
committed
Fix: [Bug]: spotify module not working #1002
1 parent d96ed11 commit 4799b72

File tree

10 files changed

+43
-40
lines changed

10 files changed

+43
-40
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ All notable changes to `HyDE` will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to _Modified_ [CalVer](https://calver.org/). See [Versioning](https://github.com/HyDE-Project/HyDE/blob/master/RELEASE_POLICY.md#versioning-yymq) For more info
66

7-
## Unreleased `v25.7.3`
7+
## [Unreleased] v25.7.3
88

9-
### Packaging
109

1110
### Added
1211

1312
- CHANGELOG.md to track notable changes
1413
- Features and fixes for mediaplayer. #865
1514
- HyDE's python environment rebuild on installation
15+
- PyGObject for the python environment
1616

1717
### Changed
1818

@@ -21,3 +21,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
2121
### Fixed
2222

2323
- Waybar: Avoid multi user process conflict
24+
- Mediaplayer: crash when player is not playing.
25+

Configs/.local/lib/hyde/cliphist.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

3+
pkill rofi && exit 0
34
# shellcheck disable=SC1090
45
if ! source "$(command -v hyde-shell)"; then
56
echo "[wallbash] code :: Error: hyde-shell not found."

Configs/.local/lib/hyde/globalcontrol.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,9 @@ export HYDE_THEME \
273273
if [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
274274
hypr_border="$(hyprctl -j getoption decoration:rounding | jq '.int')"
275275
hypr_width="$(hyprctl -j getoption general:border_size | jq '.int')"
276-
277-
export hypr_border=${hypr_border:-0}
278-
export hypr_width=${hypr_width:-0}
279276
fi
277+
export hypr_border=${hypr_border:-${HYDE_BORDER_RADIUS:-5}}
278+
export hypr_width=${hypr_width:-${HYDE_BORDER_WIDTH:-5}}
280279

281280
#// extra fns
282281

@@ -524,6 +523,7 @@ accepted_mime_types() {
524523

525524
}
526525

526+
527527
export -f get_hyprConf get_rofi_pos \
528528
is_hovered toml_write \
529529
get_hashmap get_aurhlpr \

Configs/.local/lib/hyde/mediaplayer.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
import os
3-
from re import split
4-
from warnings import catch_warnings
3+
# from re import split
4+
# from warnings import catch_warnings
55
import gi
66

77
gi.require_version("Playerctl", "2.0")
@@ -26,7 +26,7 @@
2626
# for each player. Key = player_name
2727
#
2828
players_data = {}
29-
currentplayer = None
29+
current_player = None
3030

3131

3232
def load_env_file(filepath: str) -> None:
@@ -177,7 +177,7 @@ def on_player_appeared(manager, player, selected_players=None):
177177

178178
def on_player_vanished(manager, player, loop):
179179
logger.info("Player has vanished")
180-
if currentplayer.props.player_name == player.props.player_name:
180+
if current_player.props.player_name == player.props.player_name:
181181
if manager.props.players:
182182
set_player(manager, manager.props.players[0])
183183
on_metadata(player, player.props.metadata, manager)
@@ -368,44 +368,43 @@ def main():
368368
found[players.index(player.name)] = p
369369
if found:
370370
found = list(filter(lambda x: x is not None, found))
371-
try:
372-
p = next(player for player in found if player.props.status == "Playing")
373-
except StopIteration:
374-
p = None
375-
if not p:
376-
p = found[0]
377-
set_player(manager, p)
378-
player_found = True
379-
# If no player is found, generate the standby output
371+
if found:
372+
try:
373+
p = next(player for player in found if player.props.status == "Playing")
374+
except StopIteration:
375+
p = None
376+
if not p:
377+
p = found[0]
378+
set_player(manager, p)
379+
player_found = True
380+
# If no player is found, generate the standby output and continue running the loop
380381
if not player_found:
381382
output = {
382383
"text": standby_text,
383384
"class": "custom-nothing-playing",
384385
"alt": "player-closed",
385386
"tooltip": "",
386387
}
387-
388388
sys.stdout.write(json.dumps(output) + "\n")
389389
sys.stdout.flush()
390-
391390
# Set up a single 1-second timer to update song position
392391
GLib.timeout_add_seconds(1, update_positions, manager)
393392

394393
loop.run()
395394

396395

397396
def set_player(manager, player):
398-
global currentplayer
399-
if currentplayer:
400-
if currentplayer.props.player_name != player.props.player_name:
401-
currentplayer.pause()
402-
currentplayer = player
397+
global current_player
398+
if current_player:
399+
if current_player.props.player_name != player.props.player_name:
400+
current_player.pause()
401+
current_player = player
403402
manager.move_player_to_top(player)
404403

405404

406405
def control_music(sig, frame, action):
407-
if currentplayer:
408-
getattr(currentplayer, action)()
406+
if current_player:
407+
getattr(current_player, action)()
409408

410409

411410
def escape(string):
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
loguru==0.7.3
22
pulsectl==24.12.0
3-
pywayland==0.4.18
43
requests==2.32.4
54
inotify_simple
5+
pywayland
6+
PyGObject

Configs/.local/lib/hyde/rofilaunch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#// set variables
44

5+
pkill rofi && exit 0
56
scrDir="$(dirname "$(realpath "$0")")"
67
confDir="${confDir}/config"
78
# shellcheck source=/dev/null

Configs/.local/lib/hyde/theme.select.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
#// set variables
44

5-
# shellcheck source=$HOME/.local/bin/hyde-shell
6-
# shellcheck disable=SC1091
7-
if ! source "$(which hyde-shell)"; then
8-
echo "[wallbash] code :: Error: hyde-shell not found."
9-
echo "[wallbash] code :: Is HyDE installed?"
10-
exit 1
11-
fi
5+
[[ "${HYDE_SHELL_INIT}" -ne 1 ]] && eval "$(hyde-shell init)"
126

137
rofiAssetDir="${SHARE_DIR}/hyde/rofi/assets"
148

Configs/.local/share/hyde/hyprland.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ misc {
236236
disable_hyprland_logo = true
237237
disable_splash_rendering = true
238238
force_default_wallpaper = 0
239+
anr_missed_pings = 5
239240
}
240241

241242
xwayland {

Scripts/restore_cfg.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,13 @@ echo ""
221221
print_log -g "[python env]" -b " :: " "Rebuilding HyDE Python environment..."
222222
if command -v hyde-shell >/dev/null 2>&1; then
223223
hyde-shell pyinit
224-
else
225-
"${HOME}/.local/bin/hyde-shell" pyinit
226-
fi
224+
else
225+
"${HOME}/.local/bin/hyde-shell" pyinit
226+
fi
227227

228228
print_log -g "[version]" -b " :: " "saving version info..."
229229
"${scrDir}/version.sh" --cache || echo "Failed to save version info."
230+
231+
state_dir="${XDG_STATE_HOME:-$HOME/.local/state}/hyde"
232+
clone_dir=$(git rev-parse --show-toplevel 2>/dev/null || echo "${HOME}/HyDE")
233+
[[ -f ${clone_dir}/CHANGELOG.md ]] && cp -f "${clone_dir}/CHANGELOG.md" "${state_dir}/CHANGELOG.md"

Scripts/version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ generate_release_notes() {
3131
echo "$commits"
3232
}
3333

34-
HYDE_RELEASE_NOTES=$(generate_release_notes)
34+
# HYDE_RELEASE_NOTES=$(generate_release_notes)
3535

3636
echo "HyDE $HYDE_VERSION built from branch $HYDE_BRANCH at commit ${HYDE_COMMIT_HASH:0:12} ($HYDE_VERSION_COMMIT_MSG)"
3737
echo "Date: $HYDE_VERSION_LAST_CHECKED"
@@ -52,8 +52,8 @@ HYDE_VERSION='$HYDE_VERSION'
5252
HYDE_VERSION_LAST_CHECKED='$HYDE_VERSION_LAST_CHECKED'
5353
HYDE_VERSION_COMMIT_MSG='$HYDE_VERSION_COMMIT_MSG'
5454
HYDE_COMMIT_HASH='$HYDE_COMMIT_HASH'
55-
HYDE_RELEASE_NOTES='$HYDE_RELEASE_NOTES'
5655
EOL
56+
# HYDE_RELEASE_NOTES='$HYDE_RELEASE_NOTES'
5757

5858
echo -e "Version cache output to $version_file\n"
5959

0 commit comments

Comments
 (0)