forked from quidsup/flashless-extras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flashless.sh
73 lines (63 loc) · 3.01 KB
/
flashless.sh
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
70
71
72
73
#!/bin/bash
#Title: Flashless Restricted Extras Installer for Ubuntu
#Description: Installs patent encumbered audio and video codecs
#Author: Quidsup
#Date: 24 Apr 2016
#Usage: bash flashless-extras.sh
if [ "$(command -v apt)" ]; then #Is this an Ubuntu / Debian based distro?
#Ask user whether they want to install Microsoft fonts
echo -n "Do you want to install Microsoft TrueType Fonts (y/n)? "
read -rn1 Fonts
echo
echo "Updating repositories"
sudo apt update
echo
if [[ $(pgrep kwin) != "" ]]; then #Different set of packages are needed for KDE based systems
echo "Installing Restricted Extras for KDE based system"
sudo apt install -y lame unrar gstreamer1.0-fluendo-mp3 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-fluendo-mp3 libdvdread4 libk3b6-extracodecs oxideqt-codecs-extra libavcodec-extra libavcodec-ffmpeg-extra56 libk3b6-extracodecs
else
echo "Installing Restricted Extras"
sudo apt install -y lame unrar gstreamer1.0-fluendo-mp3 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-fluendo-mp3 libdvdread4 libk3b6-extracodecs oxideqt-codecs-extra libavcodec-extra libavcodec-ffmpeg-extra56
fi
#Optional install of Microsoft fonts
if [[ $Fonts == "y" ]] || [[ $Fonts == "Y" ]]; then
echo "Installing Microsoft Fonts"
sudo apt install -y ttf-mscorefonts-installer
fi
elif [ "$(command -v pacman)" ];then #Installing restricted extras for Arch based systems
echo -n "Do you want to install Microsoft TrueType Fonts (y/n)?"
read -rn1 Fonts
echo
echo "Updating repositories"
sudo pacman -Syyy
echo
if [[ $(pgrep kwin) != "" ]];then #Different set of packages are needed for KDE based systems
echo "Installing Restricted Extras for KDE based system"
sudo pacman --no-confirm -Sy lame unrar gstreamer gst-plugins-bad gst-plugins-ugly gst-libav libdvdread libdvdcss k3b ffmpeg ffmpeg2.8
yaourt -Sy gst-fluendo-mp3
else
echo "Installing Restricted Extras"
sudo pacman --no-confirm -Sy lame unrar gstreamer gst-plugins-bad gst-plugins-ugly gst-libav libdvdread libdvdcss ffmpeg ffmpeg2.8
yaourt -Sy gst-fluendo-mp3
fi
#Optional install of Microsoft fonts
if [[ $Fonts == "y" ]] || [[ $Fonts == "Y" ]];then
echo "Installing Microsoft Fonts"
yaourt --no-confirm -Sy ttf-ms-fonts
fi
else #Throw error for non Deb systems
echo "Sorry, the Flashless Extras script has only been written for Debian and Arch based systems."
exit 1
fi
echo
#DVD CSS Decoder install varies between pre 15.04 and 15.10 onwards
#DVD CSS Decoder installation and configuration is done more "automatically" on Arch based systems. The following stuf is for Debian based systems only
if [ -e /usr/share/doc/libdvdread4/install-css.sh ]; then
echo "Installing DVD CSS Decoder"
sudo /usr/share/doc/libdvdread4/install-css.sh
else
echo "To install DVD CSS Decoder run: sudo apt install libdvd-pkg"
fi
echo
echo "Flashless extras script complete :)"
echo