Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/updates_list.txt
/updates_list.txt
/apps/app_categories
/etc/accent
/etc/editor
/etc/express-updates
/etc/pi-apps-import
/etc/theme
45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ To install LinStore, run the following command:
curl -s -L https://raw.githubusercontent.com/techguy16/LinStore/main/install | bash
```

<details>
<summary>Install LinStore using Pi-Apps</summary>

1. Open Pi-Apps
2. Click the Settings icon
3. Click "Import App"
4. Paste the following URL in the box:
```
https://raw.githubusercontent.com/techguy16/LinStore/refs/heads/main/etc/tools/LinStore.zip
```
5. Click "OK"
6. Click "Save". LinStore should now be listed in the applications list. Click on it, then click "Install".

</details>

<details>
<summary>Manually install LinStore</summary>

Expand All @@ -51,6 +66,15 @@ chmod +x install
```
</details>

<details>
<summary>Uninstall LinStore</summary>

```bash
rm -irf ~/.linstore/!(installscripts)
rm -f $HOME/.local/share/applications/LinStore.desktop $HOME/Desktop/LinStore.desktop
```
</details>

<hr>

### Launching LinStore
Expand All @@ -66,14 +90,14 @@ To launch LinStore via the command line, run the following command:

<hr>

### Supported operating systems
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Openlogo-debianV2.svg/1200px-Openlogo-debianV2.svg.png" height="16px"> **Debian** 13/12/11
### Supported distributions
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Openlogo-debianV2.svg/250px-Openlogo-debianV2.svg.png" height="16px"> **Debian** 13/12/11

<img src="https://res.cloudinary.com/canonical/image/fetch/f_auto,q_auto,fl_sanitize,c_fill,w_100/https%3A%2F%2Fapi.charmhub.io%2Fapi%2Fv1%2Fmedia%2Fdownload%2Fcharm_Jfd56ZWJ9IaNHuPjXVLP9d9Xa2XMTSKp_icon_ad1a94cf9bb9f68614cb6c17e54e2fbd9dcc7fecc514dc6012b7f58fb5b87f8f.png" height="16px"> **Ubuntu** 24.04/22.04/20.04 LTS
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/Ubuntu-logo-no-wordmark-solid-o-2022.svg/250px-Ubuntu-logo-no-wordmark-solid-o-2022.svg.png" height="16px" width="16px"> **Ubuntu** 26.04/24.04/22.04/20.04 LTS

<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Linux_Mint_logo_without_wordmark.svg/1200px-Linux_Mint_logo_without_wordmark.svg.png" height="16px"> **Linux Mint** 22.x/21.x/20.x
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Linux_Mint_logo_without_wordmark.svg/250px-Linux_Mint_logo_without_wordmark.svg.png" height="16px"> **Linux Mint** 22.x/21.x/20.x

<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Pop%21_OS_Icon.svg/2048px-Pop%21_OS_Icon.svg.png" height="16px"> **Pop!_OS** 22.04/20.04
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Pop%21_OS_Icon.svg/250px-Pop%21_OS_Icon.svg.png" height="16px"> **Pop!_OS** 24.04/22.04/20.04

<img src="https://www.svgrepo.com/show/303239/raspberry-pi-logo.svg" height="16px"> **Raspberry Pi OS** - versions based on supported **Debian** versions are supported (images from after **8th Nov 2021**)

Expand All @@ -97,4 +121,13 @@ If you have an app listed on LinStore, consider adding a badge to your README to
[<img src='https://github.com/techguy16/LinStore/blob/main/images/badge-light.png?raw=true' align=right height=50>](https://github.com/techguy16/LinStore)
```markdown
[<img src='https://github.com/techguy16/LinStore/blob/main/images/badge-light.png?raw=true' align=right>](https://github.com/techguy16/LinStore)
```
```


## Contributing

LinStore welcomes contributions, however small or big they are:

* [Submit](https://github.com/techguy16/LinStore/issues/new?template=app-submission.yml) or [suggest](https://github.com/techguy16/LinStore/issues/new?template=app-request.yml) apps to be added to the app library
* [Reporting bugs](https://github.com/techguy16/LinStore/issues/new?template=bug.yml) with LinStore
* Or even just starring the repository!
153 changes: 144 additions & 9 deletions api
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ logo() {

# Function to install an app
install_app() {
local app_directory="$1"
local selected_app_name="$2"
local app_directory="$(get_app_directory "$1")"
local selected_app_name="$1"
local installed_file="$HOME/.linstore/installed"
local temp_script=$(mktemp)

Expand Down Expand Up @@ -73,8 +73,8 @@ open_app() {

# Function to install an app
installation_script() {
local app_directory="$1"
local selected_app_name="$2"
local app_directory="$(get_app_directory "$1")"
local selected_app_name="$1"
local installed_file="$HOME/.linstore/installed"

if [ -e "$app_directory/install" ]; then
Expand All @@ -97,8 +97,8 @@ installation_script() {

# Function to uninstall an app
uninstall_app() {
local app_directory="$1"
local selected_app_name="$2"
local app_directory="$(get_app_directory "$1")"
local selected_app_name="$1"
local uninstalled_file="$HOME/.linstore/uninstalled"
local temp_script=$(mktemp)

Expand Down Expand Up @@ -166,6 +166,133 @@ search_apps() {
fi
}

cache_categories() {
# $1 - apps dir
# $2 - include Pi-Apps?
yad --title="LinStore" \
--class="LinStore" \
--center --borders=10 \
--text "Generating app cache..." \
--no-buttons &

if [ -e "${1}/app_categories" ]; then
rm -f "${1}/app_categories"
fi

for app_dir in "${1}"/*; do
app_name=$(basename "${app_dir}")
if [ -e "${1}/$app_name/category" ]; then
if [ -e "$app_dir/install" ] || [ -e "$app_dir/install-$(cat ~/.linstore/architecture.txt)" ] \
|| [ -e "$HOME/pi-apps/apps/$app_name/install-$(cat ~/.linstore/architecture.txt)" ] \
|| [ -e "$HOME/pi-apps/apps/$app_name/install" ]; then
echo "$app_name|$(cat "${1}/$app_name/category")" >> "${1}/app_categories"
fi
fi
done

if [[ "$2" == "TRUE" ]]; then
if [ -e "$HOME/pi-apps/etc/categories" ]; then
while IFS= read -r line; do
app_name=$(echo "$line" | awk -F'|' '{print $1}')
app_dir="$HOME/pi-apps/apps/$app_name"
category=$(grep -r "$(echo "$line" | awk -F'|' '{print $2}')" etc/mapping | head -n1 | awk -F'|' '{print $2}')
if [ -e "$app_dir/install" ] || [ -e "$app_dir/install-$(cat ~/.linstore/architecture.txt)" ] \
|| [ -e "$HOME/pi-apps/apps/$app_name/install-$(cat ~/.linstore/architecture.txt)" ] \
|| [ -e "$HOME/pi-apps/apps/$app_name/install" ]; then
echo "$app_name|$category" >> "${1}/app_categories"
fi
done < "$HOME/pi-apps/etc/categories"
fi
fi

sort "${1}/app_categories" > "${1}/app_categories.tmp"
mv "${1}/app_categories.tmp" "${1}/app_categories"

pkill -f "yad*"
}

get_categories() {
cat etc/categories
}

get_apps_in_category() {
local category="$1"
grep "|$category$" etc/categories | cut -d'|' -f1
}

get_app_description() {
app_name="$1"
description_file="apps/$app_name/description"
if [ -e "$description_file" ]; then
cat "$description_file"
elif [ -e "$HOME/pi-apps/apps/$app_name/description" ]; then
cat "$HOME/pi-apps/apps/$app_name/description"
else
echo "No description available."
fi
}
get_app_creator() {
app_name="$1"
creator_file="apps/$app_name/creator"
if [ -e "$creator_file" ]; then
cat "$creator_file"
elif [ -e "$HOME/pi-apps/apps/$app_name/credits" ]; then
cat "$HOME/pi-apps/apps/$app_name/credits"
else
echo "No description available."
fi
}
get_app_website() {
app_name="$1"
website_file="apps/$app_name/website"
if [ -e "$website_file" ]; then
cat "$website_file"
else
echo "No description available."
fi
}
get_app_directory() {
app_name="$1"
if [ -d "apps/$app_name" ]; then
echo "apps/$app_name"
elif [ -d "$HOME/pi-apps/apps/$app_name" ]; then
echo "$HOME/pi-apps/apps/$app_name"
else
echo ""
fi
}

install_packages() {
packages="$@"
sudo apt update > /dev/null 2>&1

for package in $packages; do
if [[ "$package" == http* ]]; then
echo "Downloading and installing $package..."
wget --no-check-certificate "$package" -O /tmp/package.deb > /dev/null 2>&1
sudo dpkg -i /tmp/package.deb > /dev/null 2>&1
rm -r /tmp/package.deb
elif [[ "$package" == *.deb ]]; then
echo "Installing $package using dpkg..."
sudo dpkg -i "$package" > /dev/null 2>&1
else
echo "Installing $package using apt..."

sudo apt install "$package" -y > /dev/null 2>&1
fi
done
}

git_clone() {
if [ -z "$2" ]; then
local directory=$(basename "$1")
else
local directory="$2"
fi

git clone "$1" "$directory"
}

update() {
pkill -f "yad*"
./api info "Updating LinStore..."
Expand All @@ -192,15 +319,23 @@ information() {
printf '\033[1;104;30m INFO:\033[0;104m %s \033[0m\n' "$msg" >&2
}

export -f install_packages
export -f error
export -f warning
export -f information
export -f git_clone
export -f get_app_directory
export -f get_categories

# Main logic to handle command line arguments
if [[ $1 == "search" ]]; then
search_apps
elif [[ $1 == "install" ]]; then
install_app "$2" "$3"
install_app "$2"
elif [[ $1 == "whatscript" ]]; then
installation_script "$2" "$3"
installation_script "$2"
elif [[ $1 == "uninstall" ]]; then
uninstall_app "$2" "$3"
uninstall_app "$2"
elif [[ $1 == "logo" ]]; then
logo
elif [[ $1 == "error" ]]; then
Expand Down
Loading