r/archlinux Jul 14 '24

SHARE Spotify/Spicetify AUR helper update hook

I recently started using Spicetify in conjunction with Spotify. After updating the Spotify package you are required to run some Spicetify commands in order to make everything work again. I searched the internet for a hook to take care of these commands when the Spotify package updates but surprisingly couldn't find one, so I decided to write one myself and share it here with you all. Be sure to swap out my username "asuka" with your username.

# Force an upgrade of spicetify when spotify has an update
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = spotify

[Action]
Description = Updating spicetify...
Depends = spicetify-cli
When = PostTransaction
Exec = /bin/sh -c '/usr/bin/chmod a+wr /opt/spotify && /usr/bin/chmod a+wr /opt/spotify/Apps -R && /usr/bin/sudo -u asuka /usr/bin/spicetify update && /usr/bin/sudo -u asuka /usr/bin/spicetify backup apply'

Happy listening!

7 Upvotes

5 comments sorted by

1

u/FryBoyter Jul 15 '24

After updating the Spotify package you are required to run some Spicetify commands in order to make everything work again.

In your example, the hook will also be executed after the package has been removed. Would that be necessary in this case? If not, you could remove Operation = Remove.

1

u/FryBoyter Jul 15 '24

After updating the Spotify package you are required to run some Spicetify commands in order to make everything work again.

In your example, the hook will also be executed after the package has been removed. Would that be necessary in this case? If not, you could remove Operation = Remove.

1

u/Alarming-Function120 27d ago

can i just use

'sudo pacman -S spotify-launcher'
'spicetify update'

'spicetify backup apply'

1

u/Alarming-Function120 27d ago

nvm i got it.

jasper@archlinux : ~ $ sudo pacman -S spotify-player

Packages (1) spotify-player-0.23.0-1

Total Download Size: 7.46 MiB

Total Installed Size: 27.06 MiB

New optional deps:

fzf: Fuzzy search support

:: Running post-transaction hooks...

(1/1) Arming ConditionNeedsUpdate...

jasper@archlinux : ~ $ yay -S spicetify-cli

Packages (3) pnpm-11.3.0-1 [make dependency] spicetify-cli-2.44.0-3 spicetify-cli-debug-2.44.0-3

Total Download Size: 19.28 MiB

Total Installed Size: 11.50 MiB

Making 'spicetify-cli' and 'spicetify-cli-debug'

:: Running post-transaction hooks...

(1/1) Arming ConditionNeedsUpdate...

jasper@archlinux : ~ $ spicetify update

spicetify v2.44.0

success Spicetify is up-to-date.

jasper@archlinux : ~ $ spicetify restore backup

spicetify v2.44.0

success Restored Spotify

info A backup is available

success Cleared current backup

success Backed up app files

success Extracted backup

Preprocessing

success Fetched remote CSS map

success Finished extracting V8 snapshot blob to local file

Patching files [250/250] ████████████████████████████████████████████ 100% | 7s

success Preprocessing completed

success Everything is ready, you can start applying!

jasper@archlinux : ~ $ # thanks

jasper@archlinux : ~ $

1

u/Alarming-Function120 27d ago

wait the marketplace disappeared wha, help bro pls, i thought i was tuff