Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-irl authored Jun 3, 2018
1 parent bea9c44 commit b31d19a
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 0 deletions.
16 changes: 16 additions & 0 deletions functions/apps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Native packages to install
sudo dnf install steam nano gnome-tweak-tool -y

# Native packages to remove
sudo dnf remove gnome-documents evolution gnome-photos -y


# Flatpaks to install
flatpak install flathub org.gimp.GIMP -y
flatpak install flathub org.kde.kdenlive -y
flatpak install flathub com.discordapp.Discord -y
flatpak install flathub com.skype.Client -y
flatpak install flathub org.gnome.Geary -y
flatpak install flathub com.transmissionbt.Transmission -y
5 changes: 5 additions & 0 deletions functions/codec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
sudo dnf groupupdate multimedia -y
sudo dnf install ffmpeg compat-ffmpeg28 unrar -y
sudo dnf update --best --allowerasing -y
sudo dnf autoremove -y
3 changes: 3 additions & 0 deletions functions/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sudo sh -c "echo 'fastestmirror=true' >> /etc/dnf/dnf.conf"
sudo sh -c "echo 'deltarpm=true' >> /etc/dnf/dnf.conf"
6 changes: 6 additions & 0 deletions functions/repo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -y # Enables RPM Fusion free

sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y # Enables RPM Fusion nonfree

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo # Enables Flathub
5 changes: 5 additions & 0 deletions functions/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
sudo dnf clean all # Cleans package cache
sudo dnf update -y # Updates system and accepts all prompts
sudo dnf autoremove -y # Removes packages no longer needed
flatpak update # Updates Flatpak programs
5 changes: 5 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
sudo cp postinstall /usr/bin
sudo mkdir /opt/postinstall
sudo cp main.py /opt/postinstall
sudo cp -r functions /opt/postinstall
57 changes: 57 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import subprocess
import sys

doExit = 0

while doExit == 0:
print("""
|---------------------------------------------------------|
| Welcome to Louis' Fedora Post-Install CLI |
|---------------------------------------------------------|
| Select one of the options below by entering its number |
| |
| 1. Update System |
| 2. Enable RPM Fusion and Flathub Repositories |
| 3. Install Media Codecs |
| 4. Install Programs |
| 5. Tweak Settings |
|---------------------------------------------------------|
| 6. Exit Program |
|---------------------------------------------------------|
""")
userInput = input(">")

if userInput == "1":
print("Running update script...")
subprocess.call("/opt/postinstall/functions/update.sh")
elif userInput == "2":
print("Enabling extra repositories...")
subprocess.call("/opt/postinstall/functions/repo.sh")
elif userInput == "3":
print("Installing restricted media codecs...")
subprocess.call("/opt/postinstall/functions/codec.sh")
elif userInput == "4":
print("Installing chosen programs...")
subprocess.call("/opt/postinstall/functions/apps.sh")
elif userInput == "5":
print("Applying configuration tweaks...")
subprocess.call("/opt/postinstall/functions/config.sh")
elif userInput == "6":
print("Exiting...")
sys.exit()
else:
print("Invalid Input, try again")

print("Do other operation? (y/n)")
exitChoice = input(">")


if exitChoice == "y":
doExit = 0
elif exitChoice == "n":
doExit = 1
print("Exiting...")
else:
print("Invalid input, exiting anyway")
doExit = 1
print("Exiting...")
2 changes: 2 additions & 0 deletions postinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
python3 /opt/postinstall/main.py
3 changes: 3 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sudo rm /usr/bin/postinstall
sudo rm -rf /opt/postinstall

0 comments on commit b31d19a

Please sign in to comment.