Skip to content

Commit 1b5cd09

Browse files
committed
don't use fltk-bundled for appimage
update fix packaging fix u Create index.html add simple page
1 parent dbff5ff commit 1b5cd09

6 files changed

Lines changed: 72 additions & 7 deletions

File tree

.github/workflows/appimage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
- name: Set up Rust
3838
uses: dtolnay/rust-toolchain@stable
3939
with:
40-
toolchain: 1.85.0
40+
toolchain: 1.90.0
4141

4242
- name: Build release binary
43-
run: cargo build --release --features=fltk/fltk-bundled
43+
run: cargo build --release
4444

4545
- name: Build AppImage
4646
env:

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "diskfmt"
33
version = "0.1.3"
44
edition = "2024"
5-
rust-version = "1.85"
5+
rust-version = "1.90"
66
description = "A GUI utility for formatting disks using UDisks2."
77
readme = "README.md"
88
license = "MIT"

docs/index.html

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>diskfmt</title>
7+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
8+
</head>
9+
<body>
10+
<header>
11+
<h1 style="text-align: center;">diskfmt</h1>
12+
<p>A disk formatting utility for Linux that feels like the Windows format dialog, built on top of the UDisks2 system service.</p>
13+
</header>
14+
15+
<main>
16+
<section>
17+
<h2>What it does</h2>
18+
<ul>
19+
<li>Small, easy defaults aimed at people coming from Windows.</li>
20+
<li>Filters out non-removable devices to avoid accidents.</li>
21+
<li>Defaults to GPT tables (you can switch to MBR in the UI).</li>
22+
<li>Creates a partition before formatting and prefers exFAT when available.</li>
23+
</ul>
24+
</section>
25+
26+
<section>
27+
<h2>Download</h2>
28+
<p>Grab the AppImage build (requires UDisks2/Polkit on the host):</p>
29+
<p style="text-align: center;">
30+
<button type="button" onclick="window.location.href='https://github.com/MoAlyousef/diskfmt/releases/download/v0.1.3/diskfmt-0.1.3-x86_64.AppImage'">
31+
Download diskfmt AppImage
32+
</button>
33+
</p>
34+
</section>
35+
36+
<section>
37+
<h2>Screenshot</h2>
38+
<p style="text-align: center;">
39+
<img src="https://raw.githubusercontent.com/MoAlyousef/diskfmt/main/screenshots/diskfmt.png" alt="diskfmt application window" style="max-width: 100%; height: auto;">
40+
</p>
41+
</section>
42+
43+
<section>
44+
<h2>How to use it</h2>
45+
<p>Start the GUI with no arguments or with <code>--start-ui</code>. Common CLI flows:</p>
46+
<ul>
47+
<li>List removable devices: <code>diskfmt list</code></li>
48+
<li>Format a device: <code>diskfmt format --path /dev/sdb1 --fs vfat --label USB --quick</code></li>
49+
<li>Pick a filesystem block size or table type with <code>--size</code> and <code>--table</code>.</li>
50+
</ul>
51+
<p>Install <code>exfatprogs</code> if you need exFAT support on your distribution.</p>
52+
</section>
53+
54+
<section>
55+
<h2>Building</h2>
56+
<p>Requires Rust, a C++17 compiler, and common FLTK/X11 build dependencies (libx11-dev, libxft-dev, libxrender-dev, etc.). Build a release binary with:</p>
57+
<pre><code>cargo build --release</code></pre>
58+
<p>Use <code>--features fltk/use-wayland</code> to build with hybrid/X11 support or <code>--no-default-features</code> for a CLI-only build.</p>
59+
</section>
60+
</main>
61+
</body>
62+
</html>

packaging/linux/appimage/create_appdir.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BIN="$BUILD_DIR/release/diskfmt"
1010
DESKTOP_FILE="$SCRIPT_DIR/diskfmt.desktop"
1111
ICON_SRC="${ICON_SRC:-$ROOT_DIR/assets/icon.png}"
1212
ARCH="${ARCH:-$(uname -m)}"
13-
VERSION="${VERSION:-$(grep -m1 '^version' "$ROOT_DIR/Cargo.toml" | cut -d '\"' -f2)}"
13+
VERSION="${VERSION:-$(awk -F '\"' '/^version[[:space:]]*=/{print $2; exit}' "$ROOT_DIR/Cargo.toml")}"
1414
METADATA_FILE="$ROOT_DIR/packaging/linux/diskfmt.metainfo.xml"
1515
LINUXDEPLOY="${LINUXDEPLOY:-$APPIMAGE_DIR/linuxdeploy-${ARCH}.AppImage}"
1616
APPIMAGETOOL="${APPIMAGETOOL:-$APPIMAGE_DIR/appimagetool-${ARCH}.AppImage}"
@@ -77,7 +77,10 @@ install -Dm644 "$DESKTOP_FILE" "$APPDIR/usr/share/applications/diskfmt.desktop"
7777

7878
DESKTOP_TARGET="$APPDIR/usr/share/applications/diskfmt.desktop"
7979
if ! grep -q "^X-AppImage-Version=" "$DESKTOP_TARGET"; then
80-
echo "X-AppImage-Version=$VERSION" >> "$DESKTOP_TARGET"
80+
if [ -s "$DESKTOP_TARGET" ] && [ "$(tail -c1 "$DESKTOP_TARGET" | wc -l)" -eq 0 ]; then
81+
printf '\n' >> "$DESKTOP_TARGET"
82+
fi
83+
printf 'X-AppImage-Version=%s\n' "$VERSION" >> "$DESKTOP_TARGET"
8184
fi
8285
ln -sf usr/share/applications/diskfmt.desktop "$APPDIR/diskfmt.desktop"
8386

packaging/linux/appimage/diskfmt.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Comment=A GUI utility for formatting disks using UDisks2
55
Exec=diskfmt
66
Icon=diskfmt
77
Categories=Utility;System;
8-
Terminal=false
8+
Terminal=false

0 commit comments

Comments
 (0)