Skip to content

Commit

Permalink
Update installer and readme (Fixes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkashkin committed Aug 8, 2022
1 parent 173ec0d commit 50f8e0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Run `./install.py -h` to see all installer options.

1. Download the [latest skin version](https://github.com/tkashkin/Adwaita-for-Steam/archive/master.zip)
2. Extract `Adwaita` directory into Steam `skins` directory (create if it doesn't exist):
* **Linux**: `~/.local/share/Steam/skins`
* **Linux**: `~/.steam/steam/skins` or `~/.local/share/Steam/skins`
* **Linux (flatpak)**: `~/.var/app/com.valvesoftware.Steam/.local/share/Steam/skins`
* ~~Windows~~ (untested): `C:\Program Files (x86)\Steam\skins` by default
* ~~macOS~~ (untested): `~/Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/skins`
Expand Down
28 changes: 14 additions & 14 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
SKIN_DIR = "Adwaita"
PATCH_DIR = "patches"

TARGET_NORMAL = "~/.local/share/Steam"
TARGET_FLATPAK = "~/.var/app/com.valvesoftware.Steam/.local/share/Steam"
TARGET_NORMAL = "~/.steam/steam"
TARGET_FLATPAK = "~/.var/app/com.valvesoftware.Steam/.steam/steam"

skindir = Path(SKIN_DIR)
patchdir = Path(PATCH_DIR)
Expand Down Expand Up @@ -53,6 +53,7 @@ def install(source: Path, target: Path, name: str):
target = target / "skins"
target.mkdir(exist_ok = True)
else:
print(f"Directory {TEXT_BOLD}{target}{TEXT_RESET} does not exist")
return
print(f"Installing skin {TEXT_BOLD}{name}{TEXT_RESET} into {TEXT_BOLD}{target}{TEXT_RESET}...")
target_skin = target / name
Expand All @@ -65,8 +66,7 @@ def install(source: Path, target: Path, name: str):
raise SystemExit(f"Skin directory {TEXT_BOLD}{SKIN_DIR}{TEXT_RESET} does not exist. Make sure you're running the installer from its root directory")

parser = ArgumentParser(description = "Adwaita-for-Steam installer")
parser.add_argument("-t", "--target", choices = ["normal", "flatpak", "all"], default = "all", help = "Default install targets")
parser.add_argument("-d", "--target-dirs", type = Path, nargs = "+", action = "extend", help = "Custom install paths")
parser.add_argument("-t", "--target", nargs = "+", action = "extend", default = ["normal", "flatpak"], help = "Install targets: 'normal', 'flatpak', custom paths")
parser.add_argument("-l", "--list-patches", action = "store_true", help = "List available patches and exit")
parser.add_argument("-p", "--patch", nargs = "+", action = "extend", help = "Apply one or multiple patches")
parser.add_argument("-n", "--name", default = SKIN_DIR, help = "Rename installed skin")
Expand All @@ -88,16 +88,16 @@ def install(source: Path, target: Path, name: str):
if patch.exists():
apply_patch(tmp, patch)

targets = []
targets = set()

for t in args.target:
match t:
case "normal":
targets.add(Path(TARGET_NORMAL).expanduser().resolve())
case "flatpak":
targets.add(Path(TARGET_FLATPAK).expanduser().resolve())
case _:
targets.add(Path(t).expanduser().resolve())

if "normal" in args.target or "all" in args.target:
targets.append(Path(TARGET_NORMAL).expanduser())
if "flatpak" in args.target or "all" in args.target:
targets.append(Path(TARGET_FLATPAK).expanduser())

if args.target_dirs:
for dir in args.target_dirs:
targets.append(dir)

for target in targets:
install(sourcedir, target, args.name)

0 comments on commit 50f8e0b

Please sign in to comment.