Compare commits
4 Commits
cdf4f611fc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e8616dd97 | |||
| 9a54f5c6bd | |||
| 732001771e | |||
| 0823168167 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -632,7 +632,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||
|
||||
[[package]]
|
||||
name = "ferrosonic"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ferrosonic"
|
||||
version = "0.2.0"
|
||||
version = "0.2.2"
|
||||
edition = "2021"
|
||||
description = "A terminal-based Subsonic music client with bit-perfect audio playback"
|
||||
license = "MIT"
|
||||
|
||||
15
README.md
15
README.md
@@ -39,26 +39,17 @@ Ferrosonic requires the following at runtime:
|
||||
| **D-Bus** | MPRIS2 desktop media controls | Recommended |
|
||||
| **cava** | Audio visualizer | Optional |
|
||||
|
||||
Build dependencies (needed to compile from source):
|
||||
|
||||
| Dependency | Package (Arch) | Package (Fedora) | Package (Debian/Ubuntu) |
|
||||
|---|---|---|---|
|
||||
| **Rust toolchain** | `rustup` | via rustup.rs | via rustup.rs |
|
||||
| **pkg-config** | `pkgconf` | `pkgconf-pkg-config` | `pkg-config` |
|
||||
| **OpenSSL dev headers** | `openssl` | `openssl-devel` | `libssl-dev` |
|
||||
| **D-Bus dev headers** | `dbus` | `dbus-devel` | `libdbus-1-dev` |
|
||||
|
||||
### Quick Install
|
||||
|
||||
Supports Arch, Fedora, and Debian/Ubuntu. Installs dependencies, Rust (if needed), builds from source, and installs to `/usr/local/bin/`:
|
||||
Supports Arch, Fedora, and Debian/Ubuntu. Installs runtime dependencies, downloads the latest precompiled binary, and installs to `/usr/local/bin/`:
|
||||
|
||||
```bash
|
||||
curl -sSf https://raw.githubusercontent.com/jaidaken/ferrosonic/master/install.sh | sh
|
||||
```
|
||||
|
||||
### Manual Build
|
||||
### Build from Source
|
||||
|
||||
If you prefer to build manually, install the dependencies listed above, then:
|
||||
If you prefer to build from source, you'll also need: Rust toolchain, pkg-config, OpenSSL dev headers, and D-Bus dev headers. Then:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/jaidaken/ferrosonic.git
|
||||
|
||||
50
install.sh
50
install.sh
@@ -1,25 +1,36 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
REPO="https://github.com/jaidaken/ferrosonic.git"
|
||||
REPO="https://github.com/jaidaken/ferrosonic"
|
||||
INSTALL_DIR="/usr/local/bin"
|
||||
|
||||
echo "Ferrosonic installer"
|
||||
echo "===================="
|
||||
|
||||
# Detect package manager and install dependencies
|
||||
# Detect architecture
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
x86_64) ASSET="ferrosonic-linux-x86_64" ;;
|
||||
*)
|
||||
echo "No precompiled binary for $ARCH. Please build from source."
|
||||
echo "See: $REPO#manual-build"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Detect package manager and install runtime dependencies
|
||||
if command -v pacman >/dev/null 2>&1; then
|
||||
echo "Detected Arch Linux"
|
||||
sudo pacman -S --needed --noconfirm mpv pipewire wireplumber base-devel pkgconf dbus
|
||||
sudo pacman -S --needed --noconfirm mpv pipewire wireplumber dbus
|
||||
elif command -v dnf >/dev/null 2>&1; then
|
||||
echo "Detected Fedora"
|
||||
sudo dnf install -y mpv pipewire wireplumber gcc pkgconf-pkg-config dbus-devel
|
||||
sudo dnf install -y mpv pipewire wireplumber dbus
|
||||
elif command -v apt >/dev/null 2>&1; then
|
||||
echo "Detected Debian/Ubuntu"
|
||||
sudo apt update
|
||||
sudo apt install -y mpv pipewire wireplumber build-essential pkg-config libdbus-1-dev
|
||||
sudo apt install -y mpv pipewire wireplumber libdbus-1-3
|
||||
else
|
||||
echo "Unknown package manager. Please install manually: mpv, pipewire, wireplumber, pkg-config, dbus dev headers"
|
||||
echo "Unknown package manager. Please install manually: mpv, pipewire, wireplumber, dbus"
|
||||
echo "Then re-run this script."
|
||||
exit 1
|
||||
fi
|
||||
@@ -47,26 +58,17 @@ else
|
||||
echo "Skipping cava. You can install it later and enable it in Settings (F5)."
|
||||
fi
|
||||
|
||||
# Install Rust if not present
|
||||
if ! command -v cargo >/dev/null 2>&1; then
|
||||
echo "Installing Rust toolchain..."
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
. "$HOME/.cargo/env"
|
||||
fi
|
||||
|
||||
# Clone and build
|
||||
TMPDIR=$(mktemp -d)
|
||||
echo "Building ferrosonic..."
|
||||
git clone "$REPO" "$TMPDIR/ferrosonic"
|
||||
cd "$TMPDIR/ferrosonic"
|
||||
cargo build --release
|
||||
# Download latest release binary
|
||||
echo "Downloading ferrosonic..."
|
||||
LATEST=$(curl -sI "$REPO/releases/latest" | grep -i '^location:' | sed 's/.*tag\///' | tr -d '\r')
|
||||
DOWNLOAD_URL="$REPO/releases/download/$LATEST/$ASSET"
|
||||
TMPFILE=$(mktemp)
|
||||
curl -sL "$DOWNLOAD_URL" -o "$TMPFILE"
|
||||
chmod +x "$TMPFILE"
|
||||
|
||||
# Install
|
||||
sudo cp target/release/ferrosonic "$INSTALL_DIR/ferrosonic"
|
||||
|
||||
# Cleanup
|
||||
rm -rf "$TMPDIR"
|
||||
sudo mv "$TMPFILE" "$INSTALL_DIR/ferrosonic"
|
||||
|
||||
echo ""
|
||||
echo "Ferrosonic installed to $INSTALL_DIR/ferrosonic"
|
||||
echo "Ferrosonic $LATEST installed to $INSTALL_DIR/ferrosonic"
|
||||
echo "Run 'ferrosonic' to start."
|
||||
|
||||
@@ -156,6 +156,7 @@ fn render_tree(frame: &mut Frame, area: Rect, state: &mut AppState, colors: &The
|
||||
}
|
||||
|
||||
let mut list_state = ListState::default();
|
||||
*list_state.offset_mut() = state.artists.tree_scroll_offset;
|
||||
if focused {
|
||||
list_state.select(state.artists.selected_index);
|
||||
}
|
||||
@@ -267,6 +268,7 @@ fn render_songs(frame: &mut Frame, area: Rect, state: &mut AppState, colors: &Th
|
||||
}
|
||||
|
||||
let mut list_state = ListState::default();
|
||||
*list_state.offset_mut() = state.artists.song_scroll_offset;
|
||||
if focused {
|
||||
list_state.select(artists.selected_song);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user