pdflinux 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -35
- package/bin/pdflinux +8 -6
- package/install.sh +61 -36
- package/package.json +2 -2
- package/uninstall.sh +49 -20
package/README.md
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
1
|
# PDFLinux
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/pdflinux)
|
|
4
|
+
[](https://www.npmjs.com/package/pdflinux)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
[](#install)
|
|
7
|
+
|
|
8
|
+
> **100% free. No subscription. No account. Your files never leave your computer.**
|
|
4
9
|
|
|
5
10
|
A fast, privacy-first desktop application for all your everyday PDF tasks. Built with Tauri + Rust on the backend and React + TypeScript on the frontend — runs entirely on your local machine, no internet connection required, no files uploaded anywhere.
|
|
6
11
|
|
|
7
12
|
---
|
|
8
13
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
### Option 1 — Git Clone (recommended)
|
|
14
|
+
## Table of Contents
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- Add a shortcut to your app menu and a `pdflinux` command in the terminal
|
|
16
|
+
- [Quick Install](#quick-install)
|
|
17
|
+
- [Why PDFLinux?](#why-pdflinux)
|
|
18
|
+
- [Features](#features)
|
|
19
|
+
- [Prerequisites](#prerequisites)
|
|
20
|
+
- [Installation](#installation)
|
|
21
|
+
- [Tech Stack](#tech-stack)
|
|
22
|
+
- [Development](#development)
|
|
23
|
+
- [Project Structure](#project-structure)
|
|
24
|
+
- [Contributing](#contributing)
|
|
25
|
+
- [License](#license)
|
|
26
|
+
- [Privacy](#privacy)
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
./uninstall.sh
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Option 2 — npx (via npm)
|
|
28
|
+
---
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
## Quick Install
|
|
34
31
|
|
|
35
32
|
```bash
|
|
36
33
|
npx pdflinux
|
|
37
34
|
```
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npx pdflinux uninstall
|
|
42
|
-
```
|
|
36
|
+
That's it. The installer detects your distro, installs all dependencies, builds the app, and adds it to your application menu.
|
|
43
37
|
|
|
44
38
|
---
|
|
45
39
|
|
|
@@ -51,11 +45,14 @@ Most online PDF tools require you to upload your files to their servers. For sen
|
|
|
51
45
|
- **Privacy-first** — zero network requests, zero telemetry
|
|
52
46
|
- **Lightweight** — powered by Tauri (uses the OS native webview, not a bundled Chromium like Electron)
|
|
53
47
|
- **Linux-first** — primary target is Linux; Windows and macOS are also supported via Tauri
|
|
48
|
+
- **Open source** — auditable, forkable, yours
|
|
54
49
|
|
|
55
50
|
---
|
|
56
51
|
|
|
57
52
|
## Features
|
|
58
53
|
|
|
54
|
+
17 PDF tools, all running locally on your machine:
|
|
55
|
+
|
|
59
56
|
| Tool | Description |
|
|
60
57
|
|---|---|
|
|
61
58
|
| **Compress** | Reduce PDF file size using Ghostscript with quality presets |
|
|
@@ -78,6 +75,66 @@ Most online PDF tools require you to upload your files to their servers. For sen
|
|
|
78
75
|
|
|
79
76
|
---
|
|
80
77
|
|
|
78
|
+
## Prerequisites
|
|
79
|
+
|
|
80
|
+
PDFLinux requires a few native CLI utilities to do the heavy lifting. The installer will install these for you automatically, but here is the list for reference:
|
|
81
|
+
|
|
82
|
+
- **Ghostscript** — for compression and color operations
|
|
83
|
+
- **Poppler** — for PDF-to-image conversion and text extraction
|
|
84
|
+
- **QPDF** — for encryption, decryption, and page operations
|
|
85
|
+
- **Tesseract** — for OCR
|
|
86
|
+
|
|
87
|
+
The installer also requires:
|
|
88
|
+
- A supported Linux distro (Debian, Ubuntu, Fedora, RHEL, CentOS, Arch, openSUSE, or derivatives)
|
|
89
|
+
- `sudo` privileges (to install system packages)
|
|
90
|
+
- Internet access (during installation only)
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Installation
|
|
95
|
+
|
|
96
|
+
### Option 1 — npx (easiest)
|
|
97
|
+
|
|
98
|
+
If you already have Node.js installed:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx pdflinux
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
To uninstall:
|
|
105
|
+
```bash
|
|
106
|
+
npx pdflinux uninstall
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Option 2 — Git Clone
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://github.com/saaandbite/pdflinux.git
|
|
113
|
+
cd pdflinux
|
|
114
|
+
./install.sh
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The `install.sh` script will automatically:
|
|
118
|
+
- Detect your distro (Debian/Ubuntu, Fedora/RHEL/CentOS, Arch, etc.)
|
|
119
|
+
- Install all required dependencies
|
|
120
|
+
- Build the application
|
|
121
|
+
- Install the appropriate package (`.deb` / `.rpm` / `AppImage`) for your distro
|
|
122
|
+
- Add a shortcut to your app menu and a `pdflinux` command in the terminal
|
|
123
|
+
|
|
124
|
+
To uninstall:
|
|
125
|
+
```bash
|
|
126
|
+
./uninstall.sh
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Launching the app
|
|
130
|
+
|
|
131
|
+
After installation you can launch PDFLinux in two ways:
|
|
132
|
+
|
|
133
|
+
- **Application menu** — search for "PDFLinux" in your desktop environment's app launcher
|
|
134
|
+
- **Terminal** — run `pdflinux` from anywhere
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
81
138
|
## Tech Stack
|
|
82
139
|
|
|
83
140
|
| Layer | Technology |
|
|
@@ -96,7 +153,7 @@ Tauri uses the operating system's native webview (WebKitGTK on Linux) instead of
|
|
|
96
153
|
|
|
97
154
|
## Development
|
|
98
155
|
|
|
99
|
-
To run from source:
|
|
156
|
+
To run from source for local development:
|
|
100
157
|
|
|
101
158
|
```bash
|
|
102
159
|
git clone https://github.com/saaandbite/pdflinux.git
|
|
@@ -131,12 +188,16 @@ pdflinux/
|
|
|
131
188
|
│ ├── App.tsx # Route definitions
|
|
132
189
|
│ └── main.tsx # React entry point
|
|
133
190
|
│
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
191
|
+
├── src-tauri/ # Rust backend (Tauri)
|
|
192
|
+
│ ├── src/
|
|
193
|
+
│ │ ├── main.rs # Tauri entry point
|
|
194
|
+
│ │ └── pdf_engine.rs # PDF processing logic (calls gs, qpdf, poppler)
|
|
195
|
+
│ ├── tauri.conf.json # App window and build configuration
|
|
196
|
+
│ └── Cargo.toml # Rust dependencies
|
|
197
|
+
│
|
|
198
|
+
├── bin/pdflinux # npm CLI wrapper
|
|
199
|
+
├── install.sh # Linux installer script
|
|
200
|
+
└── uninstall.sh # Linux uninstaller script
|
|
140
201
|
```
|
|
141
202
|
|
|
142
203
|
---
|
|
@@ -156,7 +217,7 @@ Please open an issue first for larger changes so we can discuss the approach.
|
|
|
156
217
|
|
|
157
218
|
## License
|
|
158
219
|
|
|
159
|
-
This project is open source
|
|
220
|
+
This project is open source under the [MIT License](./LICENSE).
|
|
160
221
|
|
|
161
222
|
---
|
|
162
223
|
|
package/bin/pdflinux
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { resolve, dirname } from 'node:path';
|
|
4
|
+
import { existsSync } from 'node:fs';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
3
6
|
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const { existsSync } = require('fs');
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
7
9
|
|
|
8
10
|
const root = resolve(__dirname, '..');
|
|
9
11
|
const installScript = resolve(root, 'install.sh');
|
|
@@ -14,7 +16,7 @@ const cmd = args[0];
|
|
|
14
16
|
|
|
15
17
|
if (cmd === 'uninstall') {
|
|
16
18
|
if (!existsSync(uninstallScript)) {
|
|
17
|
-
console.error('uninstall.sh
|
|
19
|
+
console.error('uninstall.sh not found.');
|
|
18
20
|
process.exit(1);
|
|
19
21
|
}
|
|
20
22
|
const result = spawnSync('bash', [uninstallScript], { stdio: 'inherit' });
|
|
@@ -23,7 +25,7 @@ if (cmd === 'uninstall') {
|
|
|
23
25
|
|
|
24
26
|
// Default: install
|
|
25
27
|
if (!existsSync(installScript)) {
|
|
26
|
-
console.error('install.sh
|
|
28
|
+
console.error('install.sh not found.');
|
|
27
29
|
process.exit(1);
|
|
28
30
|
}
|
|
29
31
|
|
package/install.sh
CHANGED
|
@@ -28,18 +28,39 @@ detect_distro() {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
detect_pkg_manager() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
local distro="$1"
|
|
32
|
+
case "$distro" in
|
|
33
|
+
ubuntu|debian|linuxmint|pop|elementary|zorin|kali|raspbian|deepin|mx)
|
|
34
|
+
if command -v apt &>/dev/null; then echo "apt"; else echo "unknown"; fi
|
|
35
|
+
;;
|
|
36
|
+
fedora|rhel|centos|rocky|almalinux|ol|amzn)
|
|
37
|
+
if command -v dnf &>/dev/null; then echo "dnf"
|
|
38
|
+
elif command -v yum &>/dev/null; then echo "yum"
|
|
39
|
+
else echo "unknown"
|
|
40
|
+
fi
|
|
41
|
+
;;
|
|
42
|
+
arch|manjaro|endeavouros|garuda|artix)
|
|
43
|
+
if command -v pacman &>/dev/null; then echo "pacman"; else echo "unknown"; fi
|
|
44
|
+
;;
|
|
45
|
+
opensuse*|sles|suse)
|
|
46
|
+
if command -v zypper &>/dev/null; then echo "zypper"; else echo "unknown"; fi
|
|
47
|
+
;;
|
|
48
|
+
*)
|
|
49
|
+
# Fallback: prefer distro-specific managers over apt
|
|
50
|
+
if command -v dnf &>/dev/null; then echo "dnf"
|
|
51
|
+
elif command -v pacman &>/dev/null; then echo "pacman"
|
|
52
|
+
elif command -v zypper &>/dev/null; then echo "zypper"
|
|
53
|
+
elif command -v yum &>/dev/null; then echo "yum"
|
|
54
|
+
elif command -v apt &>/dev/null; then echo "apt"
|
|
55
|
+
else echo "unknown"
|
|
56
|
+
fi
|
|
57
|
+
;;
|
|
58
|
+
esac
|
|
38
59
|
}
|
|
39
60
|
|
|
40
61
|
install_system_deps() {
|
|
41
62
|
local pm="$1"
|
|
42
|
-
info "
|
|
63
|
+
info "Installing PDF system dependencies (Ghostscript, Poppler, QPDF, Tesseract)..."
|
|
43
64
|
|
|
44
65
|
case "$pm" in
|
|
45
66
|
apt)
|
|
@@ -73,7 +94,7 @@ install_system_deps() {
|
|
|
73
94
|
pkg-config gcc curl wget
|
|
74
95
|
;;
|
|
75
96
|
*)
|
|
76
|
-
warn "Package manager
|
|
97
|
+
warn "Package manager not recognized. Make sure these are installed:"
|
|
77
98
|
warn " ghostscript, poppler-utils, qpdf, tesseract-ocr"
|
|
78
99
|
;;
|
|
79
100
|
esac
|
|
@@ -81,21 +102,21 @@ install_system_deps() {
|
|
|
81
102
|
|
|
82
103
|
install_rust() {
|
|
83
104
|
if command -v rustup &>/dev/null && rustup show active-toolchain &>/dev/null; then
|
|
84
|
-
success "Rust
|
|
105
|
+
success "Rust already installed: $(rustc --version)"
|
|
85
106
|
return
|
|
86
107
|
fi
|
|
87
|
-
info "
|
|
108
|
+
info "Installing Rust via rustup..."
|
|
88
109
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
|
|
89
110
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
90
|
-
success "Rust
|
|
111
|
+
success "Rust installed: $(rustc --version)"
|
|
91
112
|
}
|
|
92
113
|
|
|
93
114
|
install_node() {
|
|
94
115
|
if command -v node &>/dev/null; then
|
|
95
|
-
success "Node.js
|
|
116
|
+
success "Node.js already installed: $(node --version)"
|
|
96
117
|
return
|
|
97
118
|
fi
|
|
98
|
-
info "
|
|
119
|
+
info "Installing Node.js via NodeSource..."
|
|
99
120
|
local pm="$1"
|
|
100
121
|
case "$pm" in
|
|
101
122
|
apt)
|
|
@@ -113,21 +134,21 @@ install_node() {
|
|
|
113
134
|
sudo zypper install -y nodejs npm
|
|
114
135
|
;;
|
|
115
136
|
*)
|
|
116
|
-
error "
|
|
137
|
+
error "Please install Node.js LTS manually from https://nodejs.org/ then run this script again."
|
|
117
138
|
;;
|
|
118
139
|
esac
|
|
119
|
-
success "Node.js
|
|
140
|
+
success "Node.js installed: $(node --version)"
|
|
120
141
|
}
|
|
121
142
|
|
|
122
143
|
build_app() {
|
|
123
|
-
info "
|
|
144
|
+
info "Installing npm dependencies..."
|
|
124
145
|
npm ci --silent
|
|
125
146
|
|
|
126
|
-
info "
|
|
147
|
+
info "Building application (this may take a few minutes the first time)..."
|
|
127
148
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
128
149
|
npm run tauri build
|
|
129
150
|
|
|
130
|
-
success "Build
|
|
151
|
+
success "Build complete."
|
|
131
152
|
}
|
|
132
153
|
|
|
133
154
|
install_package() {
|
|
@@ -139,9 +160,9 @@ install_package() {
|
|
|
139
160
|
local deb
|
|
140
161
|
deb=$(find "$bundle_dir/deb" -name "*.deb" 2>/dev/null | head -1)
|
|
141
162
|
if [ -n "$deb" ]; then
|
|
142
|
-
info "
|
|
163
|
+
info "Installing .deb package: $deb"
|
|
143
164
|
sudo dpkg -i "$deb"
|
|
144
|
-
success "$DISPLAY_NAME
|
|
165
|
+
success "$DISPLAY_NAME installed successfully."
|
|
145
166
|
return
|
|
146
167
|
fi
|
|
147
168
|
;;
|
|
@@ -149,9 +170,9 @@ install_package() {
|
|
|
149
170
|
local rpm
|
|
150
171
|
rpm=$(find "$bundle_dir/rpm" -name "*.rpm" 2>/dev/null | head -1)
|
|
151
172
|
if [ -n "$rpm" ]; then
|
|
152
|
-
info "
|
|
173
|
+
info "Installing .rpm package: $rpm"
|
|
153
174
|
sudo "$pm" install -y "$rpm"
|
|
154
|
-
success "$DISPLAY_NAME
|
|
175
|
+
success "$DISPLAY_NAME installed successfully."
|
|
155
176
|
return
|
|
156
177
|
fi
|
|
157
178
|
;;
|
|
@@ -159,17 +180,17 @@ install_package() {
|
|
|
159
180
|
;;
|
|
160
181
|
esac
|
|
161
182
|
|
|
162
|
-
# Fallback
|
|
183
|
+
# Fallback to AppImage
|
|
163
184
|
local appimage
|
|
164
185
|
appimage=$(find "$bundle_dir/appimage" -name "*.AppImage" 2>/dev/null | head -1)
|
|
165
186
|
if [ -n "$appimage" ]; then
|
|
166
|
-
info "
|
|
187
|
+
info "Installing AppImage..."
|
|
167
188
|
local install_dir="$HOME/.local/bin"
|
|
168
189
|
mkdir -p "$install_dir"
|
|
169
190
|
cp "$appimage" "$install_dir/$APP_NAME"
|
|
170
191
|
chmod +x "$install_dir/$APP_NAME"
|
|
171
192
|
|
|
172
|
-
#
|
|
193
|
+
# Add to PATH if not already there
|
|
173
194
|
local shell_rc=""
|
|
174
195
|
case "$SHELL" in
|
|
175
196
|
*/bash) shell_rc="$HOME/.bashrc" ;;
|
|
@@ -178,15 +199,15 @@ install_package() {
|
|
|
178
199
|
esac
|
|
179
200
|
if [ -n "$shell_rc" ] && ! grep -q "$install_dir" "$shell_rc" 2>/dev/null; then
|
|
180
201
|
echo "export PATH=\"$install_dir:\$PATH\"" >> "$shell_rc"
|
|
181
|
-
warn "PATH
|
|
202
|
+
warn "PATH updated in $shell_rc. Run: source $shell_rc"
|
|
182
203
|
fi
|
|
183
204
|
|
|
184
205
|
install_desktop_file "$appimage"
|
|
185
|
-
success "$DISPLAY_NAME
|
|
206
|
+
success "$DISPLAY_NAME installed as AppImage."
|
|
186
207
|
return
|
|
187
208
|
fi
|
|
188
209
|
|
|
189
|
-
error "
|
|
210
|
+
error "No installer found in $bundle_dir"
|
|
190
211
|
}
|
|
191
212
|
|
|
192
213
|
install_desktop_file() {
|
|
@@ -205,7 +226,7 @@ install_desktop_file() {
|
|
|
205
226
|
[Desktop Entry]
|
|
206
227
|
Type=Application
|
|
207
228
|
Name=PDFLinux
|
|
208
|
-
Comment=Privacy-first PDF tools
|
|
229
|
+
Comment=Privacy-first PDF tools for Linux — runs 100% offline
|
|
209
230
|
Exec=$exec_path
|
|
210
231
|
Icon=$APP_NAME
|
|
211
232
|
Categories=Office;Utility;
|
|
@@ -219,7 +240,7 @@ EOF
|
|
|
219
240
|
if command -v gtk-update-icon-cache &>/dev/null; then
|
|
220
241
|
gtk-update-icon-cache -f "$HOME/.local/share/icons/hicolor" &>/dev/null || true
|
|
221
242
|
fi
|
|
222
|
-
success "
|
|
243
|
+
success "Application menu shortcut added."
|
|
223
244
|
}
|
|
224
245
|
|
|
225
246
|
# ── Main ────────────────────────────────────────────────────────────────────
|
|
@@ -234,9 +255,13 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
234
255
|
cd "$SCRIPT_DIR"
|
|
235
256
|
|
|
236
257
|
DISTRO=$(detect_distro)
|
|
237
|
-
PKG_MANAGER=$(detect_pkg_manager)
|
|
258
|
+
PKG_MANAGER=$(detect_pkg_manager "$DISTRO")
|
|
259
|
+
|
|
260
|
+
info "Detected distro: $DISTRO (package manager: $PKG_MANAGER)"
|
|
238
261
|
|
|
239
|
-
|
|
262
|
+
if [ "$PKG_MANAGER" = "unknown" ]; then
|
|
263
|
+
error "Could not detect a supported package manager for distro '$DISTRO'. Supported: apt, dnf, yum, pacman, zypper."
|
|
264
|
+
fi
|
|
240
265
|
|
|
241
266
|
install_system_deps "$PKG_MANAGER"
|
|
242
267
|
install_rust
|
|
@@ -246,9 +271,9 @@ install_package "$PKG_MANAGER"
|
|
|
246
271
|
|
|
247
272
|
echo ""
|
|
248
273
|
echo -e "${GREEN}╔══════════════════════════════════════════════════════╗${NC}"
|
|
249
|
-
echo -e "${GREEN}║ ✓ PDFLinux
|
|
274
|
+
echo -e "${GREEN}║ ✓ PDFLinux installed successfully! ║${NC}"
|
|
250
275
|
echo -e "${GREEN}║ ║${NC}"
|
|
251
|
-
echo -e "${GREEN}║ •
|
|
252
|
-
echo -e "${GREEN}║ •
|
|
276
|
+
echo -e "${GREEN}║ • Launch from app menu: search for \"PDFLinux\" ║${NC}"
|
|
277
|
+
echo -e "${GREEN}║ • Or run from terminal: pdflinux ║${NC}"
|
|
253
278
|
echo -e "${GREEN}╚══════════════════════════════════════════════════════╝${NC}"
|
|
254
279
|
echo ""
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdflinux",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Privacy-first PDF tools
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Privacy-first PDF tools for Linux — runs 100% offline",
|
|
5
5
|
"keywords": ["pdf", "linux", "tools", "privacy", "tauri", "desktop"],
|
|
6
6
|
"author": "saaandbite",
|
|
7
7
|
"license": "MIT",
|
package/uninstall.sh
CHANGED
|
@@ -11,18 +11,47 @@ NC='\033[0m'
|
|
|
11
11
|
|
|
12
12
|
info() { echo -e "${BLUE}[*]${NC} $*"; }
|
|
13
13
|
success() { echo -e "${GREEN}[✓]${NC} $*"; }
|
|
14
|
-
error() { echo -e "${RED}[✗]${NC} $*"; exit 1; }
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
if
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
detect_distro() {
|
|
16
|
+
if [ -f /etc/os-release ]; then
|
|
17
|
+
. /etc/os-release
|
|
18
|
+
echo "$ID"
|
|
19
|
+
else
|
|
20
|
+
echo "unknown"
|
|
22
21
|
fi
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
detect_pkg_manager() {
|
|
25
|
+
local distro="$1"
|
|
26
|
+
case "$distro" in
|
|
27
|
+
ubuntu|debian|linuxmint|pop|elementary|zorin|kali|raspbian|deepin|mx)
|
|
28
|
+
command -v apt &>/dev/null && echo "apt" || echo "unknown"
|
|
29
|
+
;;
|
|
30
|
+
fedora|rhel|centos|rocky|almalinux|ol|amzn)
|
|
31
|
+
if command -v dnf &>/dev/null; then echo "dnf"
|
|
32
|
+
elif command -v yum &>/dev/null; then echo "yum"
|
|
33
|
+
else echo "unknown"
|
|
34
|
+
fi
|
|
35
|
+
;;
|
|
36
|
+
arch|manjaro|endeavouros|garuda|artix)
|
|
37
|
+
command -v pacman &>/dev/null && echo "pacman" || echo "unknown"
|
|
38
|
+
;;
|
|
39
|
+
opensuse*|sles|suse)
|
|
40
|
+
command -v zypper &>/dev/null && echo "zypper" || echo "unknown"
|
|
41
|
+
;;
|
|
42
|
+
*)
|
|
43
|
+
if command -v dnf &>/dev/null; then echo "dnf"
|
|
44
|
+
elif command -v pacman &>/dev/null; then echo "pacman"
|
|
45
|
+
elif command -v zypper &>/dev/null; then echo "zypper"
|
|
46
|
+
elif command -v yum &>/dev/null; then echo "yum"
|
|
47
|
+
elif command -v apt &>/dev/null; then echo "apt"
|
|
48
|
+
else echo "unknown"
|
|
49
|
+
fi
|
|
50
|
+
;;
|
|
51
|
+
esac
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
PM=$(detect_pkg_manager "$(detect_distro)")
|
|
26
55
|
|
|
27
56
|
echo ""
|
|
28
57
|
echo -e "${RED}╔══════════════════════════════════╗${NC}"
|
|
@@ -30,30 +59,30 @@ echo -e "${RED}║ PDFLinux — Uninstall ║${NC}"
|
|
|
30
59
|
echo -e "${RED}╚══════════════════════════════════╝${NC}"
|
|
31
60
|
echo ""
|
|
32
61
|
|
|
33
|
-
#
|
|
62
|
+
# Remove package installed via package manager
|
|
34
63
|
case "$PM" in
|
|
35
64
|
apt)
|
|
36
|
-
if dpkg -l "
|
|
37
|
-
info "
|
|
38
|
-
sudo apt-get remove -y
|
|
65
|
+
if dpkg -l "pdflinux" &>/dev/null 2>&1; then
|
|
66
|
+
info "Removing .deb package..."
|
|
67
|
+
sudo apt-get remove -y pdflinux || true
|
|
39
68
|
fi
|
|
40
69
|
;;
|
|
41
70
|
dnf|yum)
|
|
42
|
-
if rpm -q "
|
|
43
|
-
info "
|
|
44
|
-
sudo "$PM" remove -y
|
|
71
|
+
if rpm -q "pdflinux" &>/dev/null 2>&1; then
|
|
72
|
+
info "Removing .rpm package..."
|
|
73
|
+
sudo "$PM" remove -y pdflinux || true
|
|
45
74
|
fi
|
|
46
75
|
;;
|
|
47
76
|
esac
|
|
48
77
|
|
|
49
|
-
#
|
|
78
|
+
# Remove AppImage
|
|
50
79
|
if [ -f "$HOME/.local/bin/$APP_NAME" ]; then
|
|
51
|
-
info "
|
|
80
|
+
info "Removing AppImage..."
|
|
52
81
|
rm -f "$HOME/.local/bin/$APP_NAME"
|
|
53
82
|
fi
|
|
54
83
|
|
|
55
|
-
#
|
|
56
|
-
info "
|
|
84
|
+
# Remove .desktop file and icon
|
|
85
|
+
info "Removing application menu shortcut..."
|
|
57
86
|
rm -f "$HOME/.local/share/applications/$APP_NAME.desktop"
|
|
58
87
|
rm -f "$HOME/.local/share/icons/hicolor/128x128/apps/$APP_NAME.png"
|
|
59
88
|
|
|
@@ -61,5 +90,5 @@ if command -v update-desktop-database &>/dev/null; then
|
|
|
61
90
|
update-desktop-database "$HOME/.local/share/applications" &>/dev/null || true
|
|
62
91
|
fi
|
|
63
92
|
|
|
64
|
-
success "$DISPLAY_NAME
|
|
93
|
+
success "$DISPLAY_NAME removed successfully."
|
|
65
94
|
echo ""
|