budctl1db9790
The icon on the desktop too: install.sh, the PKGBUILD, the releases
The launcher entry named the stock audio-headphones icon. Now it names budctl's own (docs/icon.svg, the Android app's launcher icon): - The release tarballs carry it as budctl.svg. - install.sh installs it to share/icons/hicolor/scalable/apps/ (and rebuilds the theme's icon cache if it has one), and --uninstall removes it. A release from before the icon installs without one. Tried from an unpacked bundle into a scratch prefix, with and without the icon, and uninstalled. - The PKGBUILD installs it once a release carries it. It also moves to 0.1.3, with the sums from that release's .sha256 files; makepkg built the package from it, and with the icon put in its place.
+36 −9
5 files changed
- M .github/workflows/release.yml +1 −0
- M CLAUDE.md +4 −2
- M contrib/arch/PKGBUILD +7 −3
- M contrib/budctl.desktop +1 −1
- M install.sh +23 −3
| @@ -40,6 +40,7 @@ jobs: | |||
| 40 | 40 | mkdir "$dir" | |
| 41 | 41 | cp target/release/budctl target/release/budctl-gui contrib/budctl.desktop install.sh README.md LICENSE "$dir/" | |
| 42 | 42 | cp crates/budctl-gui/fonts/OFL.txt "$dir/OFL-fonts.txt" | |
| 43 | + | cp docs/icon.svg "$dir/budctl.svg" | |
| 43 | 44 | tar -czf "$dir.tar.gz" "$dir" | |
| 44 | 45 | sha256sum "$dir.tar.gz" > "$dir.tar.gz.sha256" | |
| 45 | 46 | - uses: actions/upload-artifact@v7 | |
| @@ -149,8 +149,10 @@ Exit codes: | |||
| 149 | 149 | ||
| 150 | 150 | - One version for the whole workspace (`Cargo.toml`), with a section per release in `CHANGELOG.md`. | |
| 151 | 151 | - To release: bump the version, add its `CHANGELOG.md` section, commit, then tag `vX.Y.Z` and push the tag. `.github/workflows/release.yml` checks the tag matches `Cargo.toml`, runs the tests, builds x86_64 and aarch64 on Ubuntu 22.04 (glibc builds; Wayland is loaded at runtime), and publishes the tarballs, their `.sha256` files and `install.sh`, with that changelog section as the notes. | |
| 152 | − | - `install.sh` installs into `~/.local` by default: from a release download (`curl … | sh`), from the unpacked tarball it sits in, or from a checkout with `--source`. `--uninstall` removes the binaries and the launcher entry, never the user's config or log. | |
| 153 | − | - `contrib/arch/PKGBUILD` (`budctl-bin`, not on the AUR) packages the release tarballs. After a release is published, bump its `pkgver` and take the sums from the release's `.sha256` files. | |
| 152 | + | - The tarballs carry the binaries, `budctl.desktop`, the icon (`docs/icon.svg` as `budctl.svg`), `install.sh`, the README and the licenses. | |
| 153 | + | - `install.sh` installs into `~/.local` by default: from a release download (`curl … | sh`), from the unpacked tarball it sits in, or from a checkout with `--source`. It puts the icon in `share/icons/hicolor/scalable/apps/` (a release from before the icon has none, and is installed without). `--uninstall` removes the binaries, the launcher entry and the icon, never the user's config or log. | |
| 154 | + | - `contrib/arch/PKGBUILD` (`budctl-bin`, not on the AUR) packages the release tarballs, the icon too once a release carries it. After a release is published, bump its `pkgver` and take the sums from the release's `.sha256` files. | |
| 155 | + | - The logo: `docs/icon.svg` (the LED battery ring, its last lit dot the red live dot, around a dot-matrix "b") is the launcher icon on both platforms; the Android app has the same dots as vector drawables (adaptive, plus a monochrome layer for themed icons). `docs/logo.svg` is the README's banner: the same emblem and "BUDCTL" in dot-matrix capitals. | |
| 154 | 156 | - `.github/workflows/ci.yml` runs fmt, clippy and the tests on every push to master. | |
| 155 | 157 | ||
| 156 | 158 | ## License | |
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | # .sha256 files (or run updpkgsums). | |
| 5 | 5 | ||
| 6 | 6 | pkgname=budctl-bin | |
| 7 | − | pkgver=0.1.2 | |
| 7 | + | pkgver=0.1.3 | |
| 8 | 8 | pkgrel=1 | |
| 9 | 9 | pkgdesc='Control wireless earbuds from Linux without the vendor app (CLI and Wayland GUI)' | |
| 10 | 10 | arch=('x86_64' 'aarch64') | |
| @@ -19,13 +19,17 @@ conflicts=('budctl') | |||
| 19 | 19 | options=('!strip' '!debug') | |
| 20 | 20 | source_x86_64=("budctl-$pkgver-x86_64.tar.gz::$url/releases/download/v$pkgver/budctl-x86_64-unknown-linux-gnu.tar.gz") | |
| 21 | 21 | source_aarch64=("budctl-$pkgver-aarch64.tar.gz::$url/releases/download/v$pkgver/budctl-aarch64-unknown-linux-gnu.tar.gz") | |
| 22 | − | sha256sums_x86_64=('2d18a3ed9be4d142da9b077564ef7415da0d46c8a99661785da6310bf36e80d2') | |
| 23 | − | sha256sums_aarch64=('8416202ad2b8f8814fae159aab2931c400afe52a3cb400c7eb9a7760d41fa5a0') | |
| 22 | + | sha256sums_x86_64=('19766c16cec4206eed1b01620048e35d099d003a9bae03abd49aa5773ea1c897') | |
| 23 | + | sha256sums_aarch64=('63319c112866f8d1b9068b0e8091ea90ffca608e0783a3d18b86180b84e4d08d') | |
| 24 | 24 | ||
| 25 | 25 | package() { | |
| 26 | 26 | cd "budctl-$CARCH-unknown-linux-gnu" | |
| 27 | 27 | install -Dm755 budctl budctl-gui -t "$pkgdir/usr/bin/" | |
| 28 | 28 | install -Dm644 budctl.desktop -t "$pkgdir/usr/share/applications/" | |
| 29 | + | # The icon ships in the releases after 0.1.3; before, the launcher entry names a stock one. | |
| 30 | + | if [ -f budctl.svg ]; then | |
| 31 | + | install -Dm644 budctl.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/budctl.svg" | |
| 32 | + | fi | |
| 29 | 33 | install -Dm644 README.md -t "$pkgdir/usr/share/doc/budctl/" | |
| 30 | 34 | install -Dm644 OFL-fonts.txt -t "$pkgdir/usr/share/licenses/$pkgname/" | |
| 31 | 35 | } | |
| @@ -4,7 +4,7 @@ Name=budctl | |||
| 4 | 4 | GenericName=Earbuds | |
| 5 | 5 | Comment=Control your wireless earbuds: noise control, EQ, gestures, battery | |
| 6 | 6 | Exec=budctl-gui | |
| 7 | − | Icon=audio-headphones | |
| 7 | + | Icon=budctl | |
| 8 | 8 | Terminal=false | |
| 9 | 9 | Categories=Settings;HardwareSettings; | |
| 10 | 10 | Keywords=earbuds;headphones;bluetooth;anc;noise;equalizer;gestures; | |
| @@ -6,7 +6,8 @@ | |||
| 6 | 6 | # ./install.sh --source in a checkout: builds with cargo, then installs | |
| 7 | 7 | # ./install.sh --uninstall | |
| 8 | 8 | # | |
| 9 | − | # Installs into ~/.local by default (bin/ and share/applications/), so no root is needed. | |
| 9 | + | # Installs into ~/.local by default (bin/, and the launcher entry and its icon in share/), so no | |
| 10 | + | # root is needed. | |
| 10 | 11 | ||
| 11 | 12 | set -eu | |
| 12 | 13 | ||
| @@ -25,7 +26,7 @@ Usage: | |||
| 25 | 26 | install.sh --uninstall [--prefix DIR] | |
| 26 | 27 | ||
| 27 | 28 | Options: | |
| 28 | − | --prefix DIR Install into DIR/bin and DIR/share/applications (default: ~/.local) | |
| 29 | + | --prefix DIR Install into DIR/bin and DIR/share (default: ~/.local) | |
| 29 | 30 | --version X.Y.Z Download this release instead of the latest | |
| 30 | 31 | --source Build from this checkout with cargo instead of downloading | |
| 31 | 32 | --uninstall Remove what install.sh installed. Your config (~/.config/budctl) | |
| @@ -77,6 +78,8 @@ done | |||
| 77 | 78 | ||
| 78 | 79 | BIN_DIR=$PREFIX/bin | |
| 79 | 80 | APP_DIR=$PREFIX/share/applications | |
| 81 | + | ICON_THEME=$PREFIX/share/icons/hicolor | |
| 82 | + | ICON_DIR=$ICON_THEME/scalable/apps | |
| 80 | 83 | ||
| 81 | 84 | # Use sudo only when the prefix cannot be written as this user (such as /usr/local). | |
| 82 | 85 | SUDO= | |
| @@ -90,7 +93,7 @@ if [ ! -w "$writable_dir" ] && [ "$(id -u)" -ne 0 ]; then | |||
| 90 | 93 | fi | |
| 91 | 94 | ||
| 92 | 95 | if [ "$ACTION" = uninstall ]; then | |
| 93 | − | for file in "$BIN_DIR/budctl" "$BIN_DIR/budctl-gui" "$APP_DIR/budctl.desktop"; do | |
| 96 | + | for file in "$BIN_DIR/budctl" "$BIN_DIR/budctl-gui" "$APP_DIR/budctl.desktop" "$ICON_DIR/budctl.svg"; do | |
| 94 | 97 | if [ -e "$file" ]; then | |
| 95 | 98 | $SUDO rm -f "$file" | |
| 96 | 99 | say "Removed $file" | |
| @@ -118,6 +121,7 @@ case "$FROM" in | |||
| 118 | 121 | bundle) | |
| 119 | 122 | FILES=$SCRIPT_DIR | |
| 120 | 123 | DESKTOP=$SCRIPT_DIR/budctl.desktop | |
| 124 | + | ICON=$SCRIPT_DIR/budctl.svg | |
| 121 | 125 | ;; | |
| 122 | 126 | source) | |
| 123 | 127 | [ -f "$SCRIPT_DIR/Cargo.toml" ] || fail "--source needs a budctl checkout next to install.sh" | |
| @@ -126,6 +130,7 @@ case "$FROM" in | |||
| 126 | 130 | cargo build --release --locked --manifest-path "$SCRIPT_DIR/Cargo.toml" -p budctl -p budctl-gui | |
| 127 | 131 | FILES=$SCRIPT_DIR/target/release | |
| 128 | 132 | DESKTOP=$SCRIPT_DIR/contrib/budctl.desktop | |
| 133 | + | ICON=$SCRIPT_DIR/docs/icon.svg | |
| 129 | 134 | ;; | |
| 130 | 135 | download) | |
| 131 | 136 | case "$(uname -m)" in | |
| @@ -155,6 +160,7 @@ case "$FROM" in | |||
| 155 | 160 | tar -xzf "$WORK/$ARCHIVE" -C "$WORK" | |
| 156 | 161 | FILES=$WORK/budctl-$TARGET | |
| 157 | 162 | DESKTOP=$FILES/budctl.desktop | |
| 163 | + | ICON=$FILES/budctl.svg | |
| 158 | 164 | ;; | |
| 159 | 165 | esac | |
| 160 | 166 | ||
| @@ -170,9 +176,23 @@ sed "s|^Exec=budctl-gui|Exec=$BIN_DIR/budctl-gui|" "$DESKTOP" >"$WORK/budctl.des | |||
| 170 | 176 | $SUDO install -d "$BIN_DIR" "$APP_DIR" | |
| 171 | 177 | $SUDO install -m 0755 "$FILES/budctl" "$FILES/budctl-gui" "$BIN_DIR/" | |
| 172 | 178 | $SUDO install -m 0644 "$WORK/budctl.desktop" "$APP_DIR/budctl.desktop" | |
| 179 | + | # Releases from before the icon carry none; their launcher entry names a stock one instead. | |
| 180 | + | ICON_INSTALLED= | |
| 181 | + | if [ -f "$ICON" ]; then | |
| 182 | + | $SUDO install -d "$ICON_DIR" | |
| 183 | + | $SUDO install -m 0644 "$ICON" "$ICON_DIR/budctl.svg" | |
| 184 | + | # A theme with an icon cache only sees a new icon once the cache is rebuilt. | |
| 185 | + | if [ -f "$ICON_THEME/icon-theme.cache" ] && command -v gtk-update-icon-cache >/dev/null 2>&1; then | |
| 186 | + | $SUDO gtk-update-icon-cache -q -t "$ICON_THEME" || true | |
| 187 | + | fi | |
| 188 | + | ICON_INSTALLED=yes | |
| 189 | + | fi | |
| 173 | 190 | ||
| 174 | 191 | say "Installed $("$BIN_DIR/budctl" --version) to $BIN_DIR (budctl, budctl-gui)" | |
| 175 | 192 | say "Installed the launcher entry to $APP_DIR/budctl.desktop" | |
| 193 | + | if [ -n "$ICON_INSTALLED" ]; then | |
| 194 | + | say "Installed the icon to $ICON_DIR/budctl.svg" | |
| 195 | + | fi | |
| 176 | 196 | case ":$PATH:" in | |
| 177 | 197 | *":$BIN_DIR:"*) ;; | |
| 178 | 198 | *) say "Note: $BIN_DIR is not on your PATH. Add it to run budctl from a terminal." ;; | |