lowfi/README.md

197 lines
5.7 KiB
Markdown
Raw Normal View History

2024-09-23 21:59:07 +02:00
# lowfi
lowfi is a tiny rust app that serves a single purpose: play lofi.
It'll do this as simply as it can: no albums, no ads, just lofi.
2024-09-30 12:28:08 +02:00
![example image](media/example1.png)
2024-09-30 07:46:57 +02:00
2024-09-28 00:06:22 +02:00
## Disclaimer
**All** of the audio files played in lowfi are from [Lofi Girl's](https://lofigirl.com/) website,
under their [licensing guidelines](https://form.lofigirl.com/CommercialLicense).
If god forbid you're planning to use this in a commercial setting, please
follow their rules.
2024-09-23 21:59:07 +02:00
## Why?
I really hate modern music platforms, and I wanted a small, "suckless"
2025-02-26 14:45:02 +01:00
app that would just play random lofi without video.
2024-09-26 16:13:40 +02:00
2025-02-27 09:14:51 +03:00
It was also designed to be fairly resilient to inconsistent networks,
2025-02-26 14:45:02 +01:00
and as such it buffers 5 whole songs at a time instead of parts of the same song.
2024-09-28 00:06:22 +02:00
Although, lowfi is yet to be properly tested in difficult conditions,
so don't rely on it too much until I do that. See [Scraping](#scraping) if
you're interested in downloading the tracks. Beware, there's a lot of them.
2024-09-28 00:39:01 +02:00
## Installing
2024-10-07 22:47:32 +02:00
> [!NOTE]
>
2024-10-07 22:46:10 +02:00
> If you're interested in maintaining a package for `lowfi`
> on package managers such as homebrew and the like, open an issue.
### Dependencies
2024-10-01 19:36:35 +02:00
You'll need Rust 1.74.0+.
2024-10-07 22:46:10 +02:00
On MacOS & Windows, no extra dependencies are needed.
2024-10-16 07:57:19 +02:00
On Linux, you'll also need openssl & alsa, as well as their headers.
- `alsa-lib` on Arch, `libasound2-dev` on Ubuntu.
- `openssl` on Arch, `libssl-dev` on Ubuntu.
2025-02-27 09:14:51 +03:00
Make sure to also install `pulseaudio-alsa` if you're using PulseAudio.
2024-10-04 11:37:52 +02:00
2024-09-28 00:39:01 +02:00
### Cargo
The recommended installation method is to use cargo:
```sh
cargo install lowfi
2024-10-07 22:46:10 +02:00
# If you want MPRIS support.
cargo install lowfi --features mpris
2024-09-28 00:39:01 +02:00
```
2024-10-01 19:36:35 +02:00
and making sure `$HOME/.cargo/bin` is added to `$PATH`.
2024-09-28 00:39:01 +02:00
2024-10-15 15:58:08 +02:00
### Release Binaries
If you're struggling or unwilling to use cargo, you can just download
precompiled binaries from the [latest release](https://github.com/talwat/lowfi/releases/latest).
2024-09-28 00:39:01 +02:00
### AUR
If you're on Arch, you can also use the AUR:
```sh
yay -S lowfi
```
### openSUSE
```sh
zypper install lowfi
```
2024-10-05 13:34:54 +03:00
### Manual
This is good for debugging, especially in issues.
2024-10-05 13:34:54 +03:00
```sh
git clone https://github.com/talwat/lowfi
cd lowfi
# If you want an actual binary
cargo build --release --all-features
2024-10-05 13:34:54 +03:00
./target/release/lowfi
# If you just want to test
cargo run --all-features
2024-10-05 13:34:54 +03:00
```
2024-09-28 00:06:22 +02:00
## Usage
`lowfi`
Yeah, that's it.
### Controls
2025-02-18 21:25:30 +02:00
| Key | Function |
| ------------------ | --------------- |
| `s`, `n`, `l` | Skip Song |
2025-02-20 10:29:37 +02:00
| `p`, Space | Play/Pause |
2025-02-18 21:25:30 +02:00
| `+`, `=`, `k`, `↑` | Volume Up 10% |
| `→` | Volume Up 1% |
| `-`, `_`, `j`, `↓` | Volume Down 10% |
| `←` | Volume Down 1% |
| `q`, CTRL+C | Quit |
> [!NOTE]
> Besides its regular controls, lowfi offers compatibility with Media Keys
> and [MPRIS](https://wiki.archlinux.org/title/MPRIS) (with tools like `playerctl`)
>
> MPRIS is currently optional feature in cargo (enabled with `--features mpris`)
> due to it being only for Linux, as well as the fact that the main point of
> lowfi is it's unique & minimal interface.
2024-09-28 00:06:22 +02:00
2024-10-02 18:39:30 +02:00
### Extra Flags
2024-10-07 14:40:39 +02:00
If you have something you'd like to tweak about lowfi, you can run `lowfi help`
to view the available options.
2024-10-02 18:39:30 +02:00
2024-09-28 00:06:22 +02:00
### Scraping
lowfi also has a `scrape` command which is usually not relevant, but
if you're trying to download some files from Lofi Girls' website,
it can be useful.
An example of scrape is as follows,
`lowfi scrape --extension zip --include-full`
where more information can be found by running `lowfi help scrape`.
### Custom Track Lists
> [!WARNING]
>
> Custom track lists are going to be pretty particular.
> This is because I still want to keep `lowfi` as simple as possible,
> so custom lists will be very similar to how the built in list functions.
>
> This also means that there will be no added flexibility to these lists,
> so you'll have to work that out on your own.
2025-01-02 19:23:16 +01:00
lowfi also supports custom track lists, although the default one from Lofi Girl
is embedded into the binary.
To use a custom list, use the `--tracks` flag. This can either be a path to some file,
or it could also be the name of a file (without the `.txt` extension) in the data
directory, so on Linux it's `~/.local/share/lowfi`.
For example, `lowfi --tracks minipop` would load `~/.local/share/lowfi/minipop.txt`.
2025-02-26 14:45:02 +01:00
Whereas if you did `lowfi --tracks ~/Music/minipop.txt` it would load from that
specified directory.
#### The Format
2025-02-27 09:14:51 +03:00
In lists, the first line should be the base URL, followed by the rest of the tracks.
2025-02-26 14:45:02 +01:00
This is also known as the "header", because it comes first.
Each track will be first appended to the base URL, and then the result use to download
2025-02-26 14:45:02 +01:00
the track. All tracks must be in the MP3 format, as lowfi doesn't support any others currently.
2025-02-26 14:45:02 +01:00
Additionally, lowfi *won't* put a `/` between the base & track for added flexibility,
so for most cases you should have a trailing `/` in your base url.
The exception to this is if the track name begins with something like `https://`,
where in that case the base will not be prepended to it.
For example, in this list:
```txt
https://lofigirl.com/wp-content/uploads/
2023/06/Foudroie-Finding-The-Edge-V2.mp3
2023/04/2-In-Front-Of-Me.mp3
https://file-examples.com/storage/fea570b16e6703ef79e65b4/2017/11/file_example_MP3_5MG.mp3
```
lowfi would download these three URLs:
- `https://lofigirl.com/wp-content/uploads/2023/06/Foudroie-Finding-The-Edge-V2.mp3`
- `https://file-examples.com/storage/fea570b16e6703ef79e65b4/2017/11/file_example_MP3_5MG.mp3`
- `https://lofigirl.com/wp-content/uploads/2023/04/2-In-Front-Of-Me.mp3`
Additionally, you may also specify a custom display name for the track which is indicated by a `!`.
For example, if you had an entry like this:
2025-02-18 21:25:30 +02:00
```txt
2023/04/2-In-Front-Of-Me.mp3!custom name
```
2025-02-26 14:45:02 +01:00
Then lowfi would download from the first section, and display the second as the track name.