Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ jobs:
with:
go-version: '1.25'

- name: Run GoReleaser (build-only)
- name: Run GoReleaser (snapshot, builds .deb packages)
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: build --snapshot --clean
args: release --snapshot --clean --skip=publish,announce
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Debian packages
uses: actions/upload-artifact@v4
with:
name: debian-packages
path: dist/*.deb
if-no-files-found: error
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ config.yaml
# Logs
*.log

# GoReleaser output
dist/
31 changes: 31 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ archives:
- config.example.yaml
- fwatch.service

nfpms:
- id: fwatch
ids:
- fwatch
package_name: fwatch
vendor: polarn
homepage: "https://github.com/polarn/fwatch"
maintainer: "Marcus Johansson <polarn@gmail.com>"
description: "A lightweight, configurable file organizer that automatically moves files based on their extensions"
license: "Apache-2.0"
formats:
- deb
bindir: /usr/bin
section: utils
file_name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}
contents:
- src: ./fwatch.service
dst: /usr/lib/systemd/user/fwatch.service
- src: ./config.example.yaml
dst: /usr/share/doc/fwatch/config.example.yaml
- src: ./README.md
dst: /usr/share/doc/fwatch/README.md
- src: ./LICENSE
dst: /usr/share/doc/fwatch/LICENSE

snapshot:
version_template: "{{ incpatch .Version }}-next"

Expand All @@ -59,6 +85,11 @@ release:
yay -S fwatch-bin
```

**Debian/Ubuntu:**
```bash
sudo dpkg -i fwatch_{{ trimprefix .Tag "v" }}_amd64.deb
```

**Manual Installation:**
Download the appropriate binary for your platform below.

Expand Down
6 changes: 4 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ destination directories by extension. All logic lives in `main.go`.
`moveFile` falls back to copy+delete on cross-device rename failures.
- `config.example.yaml` — reference config. Real config is
`$XDG_CONFIG_HOME/fwatch/config.yaml`, else `~/.config/fwatch/config.yaml`.
- `fwatch.service` — example systemd **user** unit (ExecStart `/usr/local/bin/fwatch`).
- `.goreleaser.yml` — builds, archives, AUR (`fwatch-bin`) publishing.
- `fwatch.service` — the systemd **user** unit, single source of truth: shipped in the
archives, installed live by the `.deb` and as docs by the AUR package. ExecStart is
`/usr/bin/fwatch`, the path both packages install to.
- `.goreleaser.yml` — builds, archives, `.deb` packages (nfpms), AUR (`fwatch-bin`) publishing.
- `.github/workflows/` — `test.yml` (vet/test/build on PRs and main),
`release.yml` (goreleaser, triggered by `X.Y.Z` tags).

Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ yay -S fwatch-bin
paru -S fwatch-bin
```

### Debian / Ubuntu

Download the `.deb` for your architecture from the [releases page](https://github.com/polarn/fwatch/releases) and install it:

```bash
sudo dpkg -i fwatch_*_amd64.deb
```

The package installs the binary to `/usr/bin/fwatch` and a systemd **user** unit to
`/usr/lib/systemd/user/fwatch.service`, so after configuring fwatch you can run:

```bash
systemctl --user enable --now fwatch.service
```

### Pre-built Binaries

Download the latest release for your platform from the [releases page](https://github.com/polarn/fwatch/releases).
Expand Down Expand Up @@ -100,6 +115,9 @@ systemctl --user status fwatch.service
journalctl --user -u fwatch.service -f
```

**Note:** The unit's `ExecStart` is `/usr/bin/fwatch`, where the deb and AUR packages install
the binary. If you installed manually to `/usr/local/bin`, edit `ExecStart` to match.

**Note:** Make sure you've already configured fwatch (see [Configuration](#configuration) section above) before starting the service.

## Configuration Options
Expand Down
5 changes: 3 additions & 2 deletions fwatch.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ After=network.target

[Service]
Type=simple
# Use absolute path to the fwatch binary
ExecStart=/usr/local/bin/fwatch
# Path the deb and AUR packages install the binary to.
# Adjust if you installed manually to /usr/local/bin.
ExecStart=/usr/bin/fwatch

# Restart policy
Restart=always
Expand Down
Loading