mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
feat(install): Use flatpack to install certail GUI apps that require
frequent updates fix(install): Manual app installs that aren't available elsewhere
This commit is contained in:
@@ -10,8 +10,10 @@ input_file_check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_brew() {
|
install_brew() {
|
||||||
yes | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
if ! command -v brew > /dev/null 2>&1; then
|
||||||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
yes | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||||
|
fi
|
||||||
|
|
||||||
# Required for installing fonts
|
# Required for installing fonts
|
||||||
brew tap homebrew/linux-fonts
|
brew tap homebrew/linux-fonts
|
||||||
@@ -30,7 +32,7 @@ install_brew_packages() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the package exists in the Homebrew repository
|
# Check if the package exists in the Homebrew repository
|
||||||
if brew search "$brew_package" | grep -q "^$brew_package\$"; then
|
if brew search "$brew_package" 2> /dev/null | grep -q "$brew_package"; then
|
||||||
echo "Available: $brew_package"
|
echo "Available: $brew_package"
|
||||||
found_packages="$found_packages $brew_package"
|
found_packages="$found_packages $brew_package"
|
||||||
else
|
else
|
||||||
@@ -39,15 +41,18 @@ install_brew_packages() {
|
|||||||
fi
|
fi
|
||||||
done < "$BREW_PACKAGE_FILE"
|
done < "$BREW_PACKAGE_FILE"
|
||||||
|
|
||||||
brew install $found_packages
|
# Install available brew packages
|
||||||
|
if ! brew install $found_packages; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
print_summary() {
|
print_summary() {
|
||||||
# Print the list of packages that were not found
|
# Print the list of packages that were not found
|
||||||
echo
|
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
echo "The following $1 packages were not found in the repository:"
|
echo
|
||||||
echo "$2"
|
echo "The following $1 packages were not found in the repository:" | tee -a "$INSTALL_LOG_FILE"
|
||||||
|
echo "$2" | tee -a "$INSTALL_LOG_FILE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
60
scripts/install-flatpak-packages.sh
Executable file
60
scripts/install-flatpak-packages.sh
Executable file
@@ -0,0 +1,60 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
FLATPAK_PACKAGE_FILE=package-list-flatpak
|
||||||
|
|
||||||
|
input_file_check() {
|
||||||
|
if [ ! -f "$FLATPAK_PACKAGE_FILE" ]; then
|
||||||
|
echo "File not found: $FLATPAK_PACKAGE_FILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_flatpak() {
|
||||||
|
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo && echo "Flathub added to Flatpak"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install packages listed on "flatpak-package-list" file
|
||||||
|
install_flatpak_packages() {
|
||||||
|
not_found_packages=""
|
||||||
|
found_packages=""
|
||||||
|
|
||||||
|
# Read the package names from the file
|
||||||
|
while IFS= read -r flatpak_package; do
|
||||||
|
# Skip lines that start with #
|
||||||
|
case "$flatpak_package" in
|
||||||
|
\#*) continue ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Check if the package exists in the flatpak repository
|
||||||
|
if flatpak search --columns=application "$flatpak_package" 2> /dev/null | grep -q "^$flatpak_package\$"; then
|
||||||
|
echo "Available: $flatpak_package"
|
||||||
|
found_packages="$found_packages $flatpak_package"
|
||||||
|
else
|
||||||
|
not_found_packages="$not_found_packages $flatpak_package"
|
||||||
|
echo "Unavailable: $flatpak_package"
|
||||||
|
fi
|
||||||
|
done < "$FLATPAK_PACKAGE_FILE"
|
||||||
|
|
||||||
|
# Install available flatpak packages
|
||||||
|
if ! flatpak install -y --noninteractive $found_packages; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
print_summary() {
|
||||||
|
# Print the list of packages that were not found
|
||||||
|
if [ -n "$2" ]; then
|
||||||
|
echo
|
||||||
|
echo "The following $1 packages were not found in the repository:" | tee -a "$INSTALL_LOG_FILE"
|
||||||
|
echo "$2" | tee -a "$INSTALL_LOG_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
input_file_check
|
||||||
|
setup_flatpak
|
||||||
|
install_flatpak_packages
|
||||||
|
print_summary "flatpak" "$not_found_packages"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
@@ -8,18 +8,15 @@ setup() {
|
|||||||
|
|
||||||
# Detect package manager and set package manager commands
|
# Detect package manager and set package manager commands
|
||||||
if command -v apt-get > /dev/null 2>&1; then
|
if command -v apt-get > /dev/null 2>&1; then
|
||||||
OS_INSTALL_COMMAND="apt-get"
|
OS_INSTALL_COMMAND="apt-get install -y"
|
||||||
OS_PKG_CHECK_COMMAND="apt-cache show"
|
OS_PKG_CHECK_COMMAND="apt-cache show"
|
||||||
|
|
||||||
apt_setup
|
apt_setup
|
||||||
elif command -v dnf > /dev/null 2>&1; then
|
elif command -v dnf > /dev/null 2>&1; then
|
||||||
OS_INSTALL_COMMAND="dnf"
|
OS_INSTALL_COMMAND="dnf install -y --allowerasing --skip-broken"
|
||||||
OS_PKG_CHECK_COMMAND="dnf list available"
|
OS_PKG_CHECK_COMMAND="dnf list available"
|
||||||
|
|
||||||
dnf_setup
|
dnf_setup
|
||||||
elif command -v yum > /dev/null 2>&1; then
|
|
||||||
OS_INSTALL_COMMAND="yum"
|
|
||||||
OS_PKG_CHECK_COMMAND="yum list available"
|
|
||||||
else
|
else
|
||||||
log "Unsupported package manager. This script supports apt, yum, and dnf."
|
log "Unsupported package manager. This script supports apt, yum, and dnf."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -34,14 +31,14 @@ dnf_setup() {
|
|||||||
echo "keepcache=True" | sudo tee -a /etc/dnf/dnf.conf > /dev/null
|
echo "keepcache=True" | sudo tee -a /etc/dnf/dnf.conf > /dev/null
|
||||||
|
|
||||||
# Enable RPM Fusion & Install media codecs
|
# Enable RPM Fusion & Install media codecs
|
||||||
sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && sudo dnf groupupdate -y core multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin sound-and-video
|
sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-"$(rpm -E %fedora)".noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm && sudo dnf groupupdate -y core multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin sound-and-video
|
||||||
|
|
||||||
sudo dnf update -y
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apt_setup() {
|
apt_setup() {
|
||||||
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y apt-transport-https
|
# TODO: Enable non-free software in /etc/apt/sources.list
|
||||||
# Add PPAs here
|
# Add "back-ports" in /etc/apt/sources.list
|
||||||
|
# Check how it affects Ubuntu
|
||||||
|
sudo apt-get update && sudo apt-get upgrade -y
|
||||||
}
|
}
|
||||||
|
|
||||||
input_file_check() {
|
input_file_check() {
|
||||||
@@ -66,7 +63,7 @@ install_os_packages() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the package exists in the APT repository
|
# Check if the package exists in the APT repository
|
||||||
if eval "$OS_PKG_CHECK_COMMAND" "$os_package" > /dev/null 2>&1; then
|
if eval "$OS_PKG_CHECK_COMMAND" "$os_package" 2> /dev/null | grep -q "$os_package"; then
|
||||||
echo "Available: $os_package"
|
echo "Available: $os_package"
|
||||||
os_found_packages="$os_found_packages $os_package"
|
os_found_packages="$os_found_packages $os_package"
|
||||||
else
|
else
|
||||||
@@ -75,15 +72,18 @@ install_os_packages() {
|
|||||||
fi
|
fi
|
||||||
done < "$OS_PACKAGE_FILE"
|
done < "$OS_PACKAGE_FILE"
|
||||||
|
|
||||||
eval sudo "$OS_INSTALL_COMMAND" install -y "$os_found_packages"
|
# Install available packages
|
||||||
|
if ! eval sudo "$OS_INSTALL_COMMAND" "$os_found_packages"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
print_summary() {
|
print_summary() {
|
||||||
# Print the list of packages that were not found
|
# Print the list of packages that were not found
|
||||||
echo
|
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
echo "The following $1 packages were not found in the repository:"
|
echo | tee -a "$INSTALL_LOG_FILE"
|
||||||
echo "$2"
|
echo "The following $1 packages were not found in the repository:" | tee -a "$INSTALL_LOG_FILE"
|
||||||
|
echo "$2" | tee -a "$INSTALL_LOG_FILE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,70 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
# TODO:
|
# All:
|
||||||
# - Needs manual installation: appimagelauncher, firefox, brave, vs-code, cursor, kitty, mattermost-desktop, skypedesktop, ulauncher, dotnet8, dotnet8-sdk8.0, aspnetcore-runtime-8.0, Jetbrains Toolbox, Obsidian, Postman, firefox, zen, zoho, zoho-workdrive, nala
|
# - Jetbrains-Toolbox: https://www.jetbrains.com/toolbox-app/
|
||||||
# - Available on some, not on others; may need manual installation: libreoffice, sublime-text, kitty-terminfo, imagemagick
|
# - Sublime-Text: https://www.sublimetext.com/docs/linux_repositories.html
|
||||||
|
# - Appimagelauncher: https://github.com/TheAssassin/AppImageLauncher/releases
|
||||||
|
# - Zoho Mail: https://downloads.zohocdn.com/zmail-desktop/linux/zoho-mail-desktop-lite-x64-v1.6.4.AppImage
|
||||||
|
# - Zoho Workdrive: https://files-accl.zohopublic.com/public/wdbin/download/2014030a29db316e9cedd501f32270e8
|
||||||
|
# - Cursor: https://downloader.cursor.sh/linux/appImage/x64
|
||||||
|
# Debian & Ubuntu:
|
||||||
|
# - Ulauncher: https://ulauncher.io/#Download
|
||||||
|
# Debian:
|
||||||
|
# - Dotnet8: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
|
||||||
|
|
||||||
|
# Jetbrains: check if scriptfile not available (because we use flatpak) has any issued with ulauncher
|
||||||
|
|
||||||
|
kitty_term() {
|
||||||
|
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
|
||||||
|
|
||||||
|
mkdir -p ~/.local/bin && ln -sf ~/.local/kitty.app/bin/kitty ~/.local/kitty.app/bin/kitten ~/.local/bin/
|
||||||
|
mkdir -p ~/.local/share/applications && cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications/
|
||||||
|
cp ~/.local/kitty.app/share/applications/kitty-open.desktop ~/.local/share/applications/
|
||||||
|
sed -i "s|Icon=kitty|Icon=$(readlink -f ~)/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty*.desktop
|
||||||
|
sed -i "s|Exec=kitty|Exec=$(readlink -f ~)/.local/kitty.app/bin/kitty|g" ~/.local/share/applications/kitty*.desktop
|
||||||
|
echo 'kitty.desktop' > ~/.config/xdg-terminals.list
|
||||||
|
}
|
||||||
|
|
||||||
|
manual_installs(){
|
||||||
|
kitty_term
|
||||||
|
}
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
chsh -s "$(which zsh)" && echo "Default shell changed to zsh"
|
||||||
|
|
||||||
|
# Time fix for Windows dual boot
|
||||||
|
timedatectl set-local-rtc 1 --adjust-system-clock && echo "Set Datetime"
|
||||||
|
|
||||||
|
# Use brew-installed fonts current user
|
||||||
|
if [ -d /home/linuxbrew/.linuxbrew/share/fonts ]; then
|
||||||
|
ln -s /home/linuxbrew/.linuxbrew/share/fonts -t ~/.local/share && fc-cache -fv
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf ~/.cache
|
||||||
|
}
|
||||||
|
|
||||||
|
pre_install() {
|
||||||
|
export INSTALL_LOG_FILE="$(basename "$0")_$(date +"%Y%m%d_%H%M%S")_log.txt"
|
||||||
|
echo "Use the following command to view the list of software that was NOT installed:"
|
||||||
|
echo "cat $PWD/$INSTALL_LOG_FILE"
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [ -f ~/.profile ]; then
|
||||||
|
. ~/.profile
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
pre_install
|
||||||
|
|
||||||
./install-os-packages.sh
|
./install-os-packages.sh
|
||||||
./install-brew-packages.sh
|
./install-brew-packages.sh
|
||||||
|
./install-flatpak-packages.sh
|
||||||
|
|
||||||
|
manual_installs
|
||||||
|
post_install
|
||||||
|
|
||||||
|
cat "$INSTALL_LOG_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Lines that start with # are ignored
|
# Lines that start with # are ignored
|
||||||
|
# TIP: Only add commandline apps that aren't available/updated on OS repos
|
||||||
bat
|
bat
|
||||||
bats-core
|
bats-core
|
||||||
dnscrypt-proxy
|
dnscrypt-proxy
|
||||||
@@ -34,5 +35,6 @@ tlrc
|
|||||||
tokei
|
tokei
|
||||||
tree-sitter
|
tree-sitter
|
||||||
yt-dlp
|
yt-dlp
|
||||||
|
zoxide
|
||||||
zsh-autosuggestions
|
zsh-autosuggestions
|
||||||
zsh-syntax-highlighting
|
zsh-syntax-highlighting
|
||||||
|
|||||||
14
scripts/package-list-flatpak
Normal file
14
scripts/package-list-flatpak
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Lines that start with # are ignored
|
||||||
|
# TIP: Only add GUI apps that aren't available/updated on OS repos
|
||||||
|
com.brave.Browser
|
||||||
|
com.visualstudio.code
|
||||||
|
org.mozilla.firefox
|
||||||
|
org.libreoffice.libreoffice
|
||||||
|
com.mattermost.Desktop
|
||||||
|
md.obsidian.Obsidian
|
||||||
|
com.getpostman.Postman
|
||||||
|
com.jetbrains.Rider
|
||||||
|
#com.slack.Slack
|
||||||
|
com.skype.Client
|
||||||
|
dev.zed.zed
|
||||||
|
io.github.zen_browser.zen
|
||||||
@@ -1,4 +1,14 @@
|
|||||||
# Lines that start with # are ignored
|
# Lines that start with # are ignored
|
||||||
|
# Below few are apt-only packages - non-free sources must be added before this
|
||||||
|
apt-transport-https
|
||||||
|
libavcodec-extra
|
||||||
|
nvidia-driver
|
||||||
|
synaptic
|
||||||
|
# Below few are dnf-only packages
|
||||||
|
akmod-nvidia
|
||||||
|
libva-nvidia-driver
|
||||||
|
xorg-x11-drv-nvidia-cuda
|
||||||
|
# Common
|
||||||
bash
|
bash
|
||||||
bleachbit
|
bleachbit
|
||||||
build-essential
|
build-essential
|
||||||
@@ -8,25 +18,32 @@ curl
|
|||||||
evolution-ews
|
evolution-ews
|
||||||
dolphin
|
dolphin
|
||||||
dolphin-plugins
|
dolphin-plugins
|
||||||
|
aspnetcore-runtime-8.0
|
||||||
|
dotnet-sdk-8.0
|
||||||
|
dotnet-runtime-8.0
|
||||||
ffmpeg
|
ffmpeg
|
||||||
flameshot
|
flameshot
|
||||||
|
flatpak
|
||||||
|
plasma-discover-backend-flatpak
|
||||||
gcc
|
gcc
|
||||||
gdb
|
gdb
|
||||||
git
|
git
|
||||||
gparted
|
gparted
|
||||||
|
gnupg
|
||||||
|
grub-customizer
|
||||||
htop
|
htop
|
||||||
#imagemagick
|
|
||||||
kde-spectacle
|
kde-spectacle
|
||||||
kdeconnect
|
kdeconnect
|
||||||
kitty
|
|
||||||
kitty-terminfo
|
kitty-terminfo
|
||||||
libreoffice
|
|
||||||
llvm
|
llvm
|
||||||
make
|
make
|
||||||
|
nala
|
||||||
net-tools
|
net-tools
|
||||||
okular
|
okular
|
||||||
|
openssh-client
|
||||||
python3
|
python3
|
||||||
python3-pip
|
python3-pip
|
||||||
|
qbittorrent
|
||||||
ripgrep
|
ripgrep
|
||||||
simplescreenrecorder
|
simplescreenrecorder
|
||||||
smplayer
|
smplayer
|
||||||
@@ -35,7 +52,9 @@ solaar
|
|||||||
syncthing
|
syncthing
|
||||||
tmux
|
tmux
|
||||||
ufw
|
ufw
|
||||||
|
ulauncher
|
||||||
vim
|
vim
|
||||||
|
vim-enhanced
|
||||||
vim-common
|
vim-common
|
||||||
vim-tiny
|
vim-tiny
|
||||||
vlc
|
vlc
|
||||||
|
|||||||
3
setup.sh
3
setup.sh
@@ -35,8 +35,6 @@ place_dotfile_at_target_location() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parse_input() {
|
parse_input() {
|
||||||
# TODO: Accept input to execute install.sh script
|
|
||||||
|
|
||||||
while [ "${#}" -gt 0 ]; do
|
while [ "${#}" -gt 0 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-i | --install)
|
-i | --install)
|
||||||
@@ -104,7 +102,6 @@ main() {
|
|||||||
)/scripts"
|
)/scripts"
|
||||||
|
|
||||||
setup_symlinks
|
setup_symlinks
|
||||||
echo "$install_file_location"
|
|
||||||
|
|
||||||
if [ "$INSTALL" = "y" ]; then
|
if [ "$INSTALL" = "y" ]; then
|
||||||
cd "$install_file_location" || exit
|
cd "$install_file_location" || exit
|
||||||
|
|||||||
Reference in New Issue
Block a user