Skip to content

Commit

Permalink
Use dpkg when checking for installed packages
Browse files Browse the repository at this point in the history
* Removes apt warnings
  • Loading branch information
dre1080 committed Jul 7, 2024
1 parent 4973f0b commit 8deed86
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion templates/desktop-apps/free-download-manager.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! apt list --installed | grep -q '^freedownloadmanager/'; then
if ! dpkg -l | grep -q '^ii\s*freedownloadmanager'; then
curl -o /tmp/fdm.deb 'https://files2.freedownloadmanager.org/6/latest/freedownloadmanager.deb'
sudo apt install -y /tmp/fdm.deb
rm /tmp/fdm.deb
Expand Down
2 changes: 1 addition & 1 deletion templates/desktop-apps/google-chrome.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! apt list --installed | grep -q '^google-chrome-stable/'; then
if ! dpkg -l | grep -q '^ii\s*google-chrome-stable'; then
curl -o /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y /tmp/chrome.deb
rm /tmp/chrome.deb
Expand Down
2 changes: 1 addition & 1 deletion templates/desktop-apps/localsend.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! apt list --installed | grep -q '^localsend/'; then
if ! dpkg -l | grep -q '^ii\s*localsend'; then
~/.local/bin/eget localsend/localsend --to /tmp/localsend.deb -a linux-x86-64 -a .deb
sudo apt install -y /tmp/localsend.deb
rm /tmp/localsend.deb
Expand Down
4 changes: 2 additions & 2 deletions templates/desktop-apps/megasync.tmpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
. /etc/os-release

if ! apt list --installed | grep -q '^megasync/'; then
if ! dpkg -l | grep -q '^ii\s*megasync'; then
curl -o /tmp/mega.deb "https://mega.nz/linux/repo/xUbuntu_${VERSION_ID}/amd64/megasync-xUbuntu_${VERSION_ID}_amd64.deb"
sudo apt install -y /tmp/mega.deb
rm /tmp/mega.deb
fi

if ! apt list --installed | grep -q '^nautilus-megasync/'; then
if ! dpkg -l | grep -q '^ii\s*nautilus-megasync'; then
curl -o /tmp/nautilus-mega.deb "https://mega.nz/linux/repo/xUbuntu_${VERSION_ID}/amd64/nautilus-megasync-xUbuntu_${VERSION_ID}_amd64.deb"
sudo apt install -y /tmp/nautilus-mega.deb
rm /tmp/nautilus-mega.deb
Expand Down
2 changes: 1 addition & 1 deletion templates/desktop-apps/mpv.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! apt list --installed | grep -q '^mpv/'; then
if ! dpkg -l | grep -q '^ii\s*mpv'; then
sudo apt install -y mpv
curl -fsSL https://raw.githubusercontent.com/tomasklaen/uosc/HEAD/installers/unix.sh | bash
curl -L -o ~/.config/mpv/scripts/thumbfast.lua https://raw.githubusercontent.com/po5/thumbfast/master/thumbfast.lua
Expand Down
6 changes: 4 additions & 2 deletions templates/desktop-apps/steam.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
if ! apt list --installed | grep -q '^steam-libs/'; then
if ! dpkg -l | grep -q '^ii\s*steam-launcher'; then
sudo dpkg --add-architecture i386
sudo apt update

sudo apt-get install --no-remove -oAPT::Get::AutomaticRemove=false libc6:amd64 libc6:i386 libegl1:amd64 libegl1:i386 libgbm1:amd64 libgbm1:i386 libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libgl1:amd64 libgl1:i386

curl -L -o /tmp/steam.deb https://cdn.akamai.steamstatic.com/client/installer/steam.deb
sudo apt install -y /tmp/steam.deb
sudo apt-get install --no-remove -oAPT::Get::AutomaticRemove=false libc6:amd64 libc6:i386 libegl1:amd64 libegl1:i386 libgbm1:amd64 libgbm1:i386 libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libgl1:amd64 libgl1:i386 steam-libs-amd64:amd64
rm /tmp/steam.deb
fi
2 changes: 1 addition & 1 deletion templates/desktop-apps/ulauncher.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [[ ! -d ~/.config/ulauncher/user-themes/libadwaita-dark ]]; then
~/.config/ulauncher/user-themes/libadwaita-dark
fi

if ! apt list --installed | grep -q '^ulauncher/'; then
if ! dpkg -l | grep -q '^ii\s*ulauncher'; then
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:agornostal/ulauncher -y
sudo apt update
Expand Down
3 changes: 1 addition & 2 deletions templates/desktop-apps/vscode.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if ! apt list --installed | grep -q '^code/'; then
if ! dpkg -l | grep -q '^ii\s*code'; then
curl -L -o /tmp/code.deb 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'
sudo apt install -y /tmp/code.deb
rm /tmp/code.deb
fi

2 changes: 1 addition & 1 deletion templates/desktop-apps/youtube-music.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! apt list --installed | grep -q '^youtube-music/'; then
if ! dpkg -l | grep -q 'ii\s*youtube-music/'; then
~/.local/bin/eget th-ch/youtube-music --to /tmp/youtube-music.deb -a amd64 -a .deb
sudo apt install -y /tmp/youtube-music.deb
rm /tmp/youtube-music.deb
Expand Down

0 comments on commit 8deed86

Please sign in to comment.