-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deezer
69 lines (51 loc) · 2.42 KB
/
Deezer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#Check electron version before install
#https://www.electronjs.org/releases/stable?version=6
#sudo npm install -g electron@6.1.10 asar prettier --unsafe-perm=true --allow-root
cd ~/Downloads/
rm -rf deezer/
git clone https://github.com/SibrenVasse/deezer.git
cd deezer/
# Get binaries from Deezer
wget --content-disposition https://www.deezer.com/desktop/download/artifact/win32/x86/4.19.20
# Extract app from installer
7z x -so DeezerDesktopSetup_*.exe "\$PLUGINSDIR/app-32.7z" > app-32.7z
# Extract app archive
7z x -y -bsp0 -bso0 app-32.7z
# Extract png from ico container
convert resources/win/app.ico resources/win/deezer.png
rm -r resources/{app,npm_temp} || true
asar extract resources/app.asar resources/app
mkdir -p resources/app/resources/linux/
cp resources/win/systray.png resources/app/resources/linux/systray.png
# Remove NodeRT from package (-205.72 MiB)
rm -r resources/app/node_modules/@nodert
mkdir npm_temp; cd npm_temp
sudo npm install --prefix ./ mpris-service
cp -r node_modules/* ../resources/app/node_modules/
cd ..
prettier --write resources/app/"build/*.js"
prettier --write resources/app/"build/assets/cache/js/route-naboo*ads*.js"
patch -dresources/app/ -p1 < menu-bar.patch
patch -dresources/app/ -p1 < quit.patch
patch -dresources/app/ -p1 < 0001-MPRIS-interface.patch
asar pack resources/app resources/app.asar
sudo mkdir -p /usr/share/deezer
sudo mkdir -p /usr/lib/node_modules/share/
sudo ln -sf /usr/share/deezer/ /usr/lib/node_modules/share/
tee deezer <<-EOF
#!/bin/sh
export DZ_DISABLE_UPDATE="yes"
exec electron --disable-gpu /usr/share/deezer/app.asar "\$@"
EOF
sudo install -Dm644 resources/app.asar /usr/share/deezer/
sudo install -Dm644 resources/win/deezer-0.png /usr/share/icons/hicolor/16x16/apps/deezer.png
sudo install -Dm644 resources/win/deezer-1.png /usr/share/icons/hicolor/32x32/apps/deezer.png
sudo install -Dm644 resources/win/deezer-2.png /usr/share/icons/hicolor/48x48/apps/deezer.png
sudo install -Dm644 resources/win/deezer-3.png /usr/share/icons/hicolor/64x64/apps/deezer.png
sudo install -Dm644 resources/win/deezer-4.png /usr/share/icons/hicolor/128x128/apps/deezer.png
sudo install -Dm644 resources/win/deezer-5.png /usr/share/icons/hicolor/256x256/apps/deezer.png
sed -i 's|/usr/bin/deezer %u|env XDG_CURRENT_DESKTOP=GNOME &|' deezer.desktop
sudo install -Dm644 deezer.desktop /usr/share/applications/
sudo install -Dm755 deezer /usr/bin/
rm -rf ~/.config/deezer-desktop/
sudo update-desktop-database