Files
JakeBreath d2f857d3ee extras: add PowerShell greeting port, Rust gm-switch and Windows installers
- powershell_greeting: PowerShell port of fish_greeting (fastfetch random logo, sixel/kitty-direct per terminal, logs, modes)

- win-gm-switch: Rust port of gm-switch.cpp (cross-platform mode file, --status, Start Menu shortcuts installer)

- install-windows.ps1 umbrella installer; README pointers
2026-09-30 09:34:01 -05:00

55 lines
1.5 KiB
Markdown

# win-gm-switch (Rust)
Rust port of the old `gm-switch.cpp` from
`J621-Django/extras/fish_greeting system/`: a tiny CLI that sets the J621
shell greeting rating mode (0 = NSFW, 1 = SFW, 2 = Questionable).
## Usage
```
gm-switch --mode 0 # NSFW (explicit)
gm-switch --mode 1 # SFW (safe)
gm-switch --mode 2 # Questionable
gm-switch --status # print the current mode
```
`--path <file>` overrides the mode file (also via the `J621_MODE_FILE`
environment variable). Invalid input prints the same usage/errors as the C++
tool and exits 1.
Mode file locations:
- **Windows**: `%APPDATA%\j621Greeting\greeting_mode` - read by
[`../powershell_greeting/`](../powershell_greeting/).
- **Linux/macOS**: `~/.config/fish/greeting_mode` - read by
[`../fish_greeting/`](../fish_greeting/), so this binary can stand in for
the C++ tool there.
## Install (Windows)
```powershell
cd extras\win-gm-switch
.\install.ps1
```
The installer builds with `cargo build --release`, installs `gm-switch.exe`
to `%LOCALAPPDATA%\J621\bin`, adds that folder to your user PATH (new
terminals pick it up) and creates Start Menu shortcuts under **J621
Greeting** (NSFW / SFW / Questionable). Each shortcut opens a small console
showing the confirmation; close it with `exit` or the window button.
Uninstall:
```powershell
.\install.ps1 -Uninstall
```
## Build and test without installing
```powershell
cargo build --release # -> target\release\gm-switch.exe
cargo test
```
Zero runtime dependencies (std only). The `target\` folder is gitignored.