diff --git a/README.md b/README.md index d99ec9f9..f666b6d3 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,9 @@ A skin to make Steam look more like a native GNOME app ## Requirements +* [Python 3](https://www.python.org/downloads/) * [Cantarell fonts](https://gitlab.gnome.org/GNOME/cantarell-fonts): An option to install these is included in the install script, but fonts packaged by your distro are preferred. -* The skin was created for the Linux version of Steam and wasn't tested on Windows or macOS. It will work with some visual problems. +* The skin is created and tested mostly on the Linux version of Steam. Steam's new UI has largely unified platform differences, so other platforms should work, but are not a priority. ## Previews @@ -66,6 +67,10 @@ A skin to make Steam look more like a native GNOME app ![Kate](/colorthemes/kate/preview.png?raw=true) +### Metro + +![Metro](/colorthemes/metro/preview.png?raw=true) + ### Nord ![Nord](/colorthemes/nord/preview.png?raw=true) @@ -123,6 +128,12 @@ cd Adwaita-for-Steam ./install.py -c nord -fi -p windowcontrols/right-all -we login/hide_qr -we library/hide_whats_new ``` +#### Windows + +- Download the [Latest Release](https://github.com/tkashkin/Adwaita-for-Steam/releases) +- Ensure you have [Python](#requirements) installed +- Double click the `install_windows` bat script and follow the prompts + ### With graphical installer Use the [graphical installer](https://github.com/Foldex/AdwSteamGtk) by [@Foldex](https://github.com/Foldex). diff --git a/colorthemes/metro/metro.theme b/colorthemes/metro/metro.theme new file mode 100644 index 00000000..f357e39b --- /dev/null +++ b/colorthemes/metro/metro.theme @@ -0,0 +1,76 @@ +[general] +bg = #1A1A1AFF +fg = #FFFFFFFF + +[window] +border = #FFFFFF26 +window_bg = #1A1A1AFF +window_fg = #FFFFFFFF + +[headerbar] +headerbar_backdrop = #1A1A1AFF +headerbar_bg = #141414FF +headerbar_fg = #FFFFFFFF +headerbar_shade = #00000061 + +[popover] +popover_bg = #262626FF +popover_fg = #FFFFFFFF + +[toast] +toast_bg = #000000B3 +toast_fg = #FFFFFFFF + +[view] +view_bg = #1E1E1EFF +view_fg = #FFFFFFFF + +[accent] +accent = #0073C6FF +accent_bg = #0073C6FF +accent_fg = #FFFFFFFF +accent_disabled = #0073C680 +accent_hover_bg = #0073C612 +accent_active_bg = #0073C629 + +[destructive] +destructive = #F17079FF +destructive_bg = #E81224FF +destructive_fg = #FFFFFFFF +destructive_disabled = #F1707980 +destructive_hover_bg = #F1707912 +destructive_active_bg = #F1707929 + +[error] +error = #F17079FF +error_bg = #E81224FF +error_fg = #FFFFFFFF + +[success] +success = #82BA00FF +success_bg = #82BA00FF +success_fg = #FFFFFFFF + +[warning] +warning = #FFFF63FF +warning_bg = #FFF63FFF +warning_fg = #FFFFFFFF + +[button] +button_bg = #FFFFFF0D +button_fg = #FFFFFFFF + +[label] +dim_label_fg = #FFFFFF8C + +[card] +card_bg = #FFFFFF0D +card_solid_bg = #262626FF + +[focusring] +focusring = #0073C6FF + +[scrollbar] +scrollbar = #FFFFFF33 +scrollbar_hover = #FFFFFF66 +scrollbar_active = #FFFFFF99 diff --git a/colorthemes/metro/preview.png b/colorthemes/metro/preview.png new file mode 100644 index 00000000..d747aa6f Binary files /dev/null and b/colorthemes/metro/preview.png differ diff --git a/install.py b/install.py index 622690e6..a6c249e3 100755 --- a/install.py +++ b/install.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from argparse import ArgumentParser from pathlib import Path +from sys import platform from tempfile import TemporaryDirectory, NamedTemporaryFile from typing import NoReturn import configparser @@ -9,17 +10,36 @@ import time import os -TEXT_BOLD = "\033[1m" -TEXT_BLUE = "\033[1;34m" -TEXT_GREEN = "\033[1;32m" -TEXT_PURPLE = "\033[1;35m" -TEXT_RED = "\033[1;31m" -TEXT_RESET = "\033[0m" - -TEXT_ARROW="→" -TEXT_CHECK="✓" -TEXT_CROSS="✖" -TEXT_INFO="✦" +# Platform Specific +if platform == "win32": + import winreg + WINDOWS_RUN = True + + TEXT_BOLD = "" + TEXT_BLUE = "" + TEXT_GREEN = "" + TEXT_PURPLE = "" + TEXT_RED = "" + TEXT_RESET = "" + + TEXT_ARROW = "" + TEXT_CHECK = "" + TEXT_CROSS = "" + TEXT_INFO = "" +else: + WINDOWS_RUN = False + + TEXT_BOLD = "\033[1m" + TEXT_BLUE = "\033[1;34m" + TEXT_GREEN = "\033[1;32m" + TEXT_PURPLE = "\033[1;35m" + TEXT_RED = "\033[1;31m" + TEXT_RESET = "\033[0m" + + TEXT_ARROW = "→" + TEXT_CHECK = "✓" + TEXT_CROSS = "✖" + TEXT_INFO = "✦" COLOR_THEME_DIR = "colorthemes" FONTS_DIR = "fonts" @@ -30,8 +50,10 @@ TARGET_NORMAL = "~/.steam/steam" TARGET_FLATPAK = "~/.var/app/com.valvesoftware.Steam/.steam/steam" +TARGET_WINDOWS = "C:/Program Files (x86)/Steam" TARGET_FONTS = "~/.local/share/fonts" +TARGET_FONTS_WIN = "AppData/Local/Microsoft/Windows/Fonts" STEAM_LOOPBACK = "https://steamloopback.host" STEAM_PATCHED_HEADER = "/*patched*/" @@ -132,17 +154,38 @@ def list_options(type: str, options: list[Path], suffix: str, sourcedir: Path, a print(f"{TEXT_PURPLE}{TEXT_INFO} No {type} available\n{TEXT_RESET}") # Fonts -def install_font(name: str, ext: str): - font = fontdir / name / ext - if font.exists(): - print(f"\n{TEXT_BLUE}{TEXT_ARROW} Installing font {TEXT_BOLD}{name}{TEXT_RESET}{TEXT_BLUE}...{TEXT_RESET}") - files = font.glob(f"*.{ext}") - target = Path(TARGET_FONTS).expanduser().resolve() - target.mkdir(exist_ok = True) - for f in files: - shutil.copy(f, target) +def install_font(name: str): + if WINDOWS_RUN: + target = Path.home() / TARGET_FONTS_WIN + ext = "ttf" else: + target = Path(TARGET_FONTS).expanduser().resolve() + ext = "otf" + + font = fontdir / name / ext + + if not font.is_dir(): print(f"{TEXT_PURPLE}{TEXT_INFO} Font: {TEXT_BOLD}{name}{TEXT_RESET}{TEXT_PURPLE} not found!{TEXT_RESET}") + return + + print(f"\n{TEXT_BLUE}{TEXT_ARROW} Installing font {TEXT_BOLD}{name}{TEXT_RESET}{TEXT_BLUE}...{TEXT_RESET}") + files = font.glob(f"*.{ext}") + target.mkdir(exist_ok = True) + for f in files: + target_file = target / f.name + + if target_file.is_file(): + print(f" {TEXT_BLUE}{TEXT_ARROW} Font {TEXT_BOLD}{f.name}{TEXT_RESET}{TEXT_BLUE} exists. Skipping...{TEXT_RESET}") + continue + + shutil.copy(f, target) + if WINDOWS_RUN: + win_reg_font(f.name, target_file) + +def win_reg_font(name: str, target: Path): + key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", 0, winreg.KEY_ALL_ACCESS) + winreg.SetValueEx(key, str(name), 0, winreg.REG_SZ, str(target)) + winreg.CloseKey(key) # Webkit CSS def find_web_extras() -> list[Path]: @@ -280,6 +323,7 @@ def dev_reload(target: Path): tmpfile.write(b"") time.sleep(3) +# Run if __name__ == "__main__": if not webthemedir.exists(): raise SystemExit(f"{TEXT_RED}{TEXT_CROSS} Web Theme directory {TEXT_BOLD}{WEB_THEME_DIR}{TEXT_RESET}{TEXT_RED} does not exist. Make sure you're running the installer from its root directory{TEXT_RESET}") @@ -297,13 +341,16 @@ def dev_reload(target: Path): parser.add_argument("-we", "--web-extras", nargs = "+", action = "extend", help = "Enable one or multiple web theme extras") args = parser.parse_args() + if WINDOWS_RUN: + args.target = ["windows"] + if args.list_options: list_options("color themes", find_color_themes(), ".theme", colorthemedir, "color-theme") list_options("web extras", find_web_extras(), ".css", webextrasdir, "web-extras") exit(0) if args.font_install: - install_font("Cantarell", "otf") + install_font("Cantarell") selected_theme = None if args.color_theme: @@ -342,6 +389,8 @@ def dev_reload(target: Path): targets.add(Path(TARGET_NORMAL).expanduser().resolve()) elif t == "flatpak": targets.add(Path(TARGET_FLATPAK).expanduser().resolve()) + elif t == "windows": + targets.add(Path(TARGET_WINDOWS)) else: targets.add(Path(t).expanduser().resolve()) diff --git a/install_windows.bat b/install_windows.bat new file mode 100644 index 00000000..e88fa6f8 --- /dev/null +++ b/install_windows.bat @@ -0,0 +1,181 @@ +@echo off +ECHO ---------------------------- +ECHO Adwaita for Steam Installer +ECHO ---------------------------- + +:: ----------------- +:: --- VARIABLES --- +:: ----------------- +:: --- Do not edit these --- + +:: --- General --- +SET NO_ROUNDED_CORNERS=-we general/no_rounded_corners + +:: --- Library --- +SET HIDE_WHATS_NEW=-we library/hide_whats_new +SET SIDEBAR_HOVER_ONLY=-we library/sidebar_hover + +:: --- Login --- +SET LOGIN_HIDE_QR=-we login/hide_qr +SET LOGIN_HOVER_ONLY_QR=-we login/hover_qr + +:: --- Top Bar --- +SET HIDE_BIG_PICTURE_BUTTON=-we topbar/hide_bp +SET HIDE_PAGE_URL=-we topbar/hide_url +SET SHOW_NAVIGATION_ARROWS=-we topbar/show_arrows +SET ORIGINAL_STYLE_TOP_BAR=-we topbar/vanilla_bar + +:: --- Bottom Bar --- +SET HIDE_BOTTOM_BAR=-we bottombar/hide_bar + +:: --- Window Controls --- +SET WINDOW_CONTROLS=-we windowcontrols/right-all + +GOTO START_SECTION + +:: --------------- +:: --- DEFAULT --- +:: --------------- +:DEFAULT_SECTION +SET CHOSEN_COLORTHEME=adwaita + +:: SET CHOSEN_NO_ROUNDED_CORNERS=%NO_ROUNDED_CORNERS% + +:: SET CHOSEN_HIDE_WHATS_NEW=%HIDE_WHATS_NEW% +:: SET CHOSEN_SIDEBAR_HOVER_ONLY=%SIDEBAR_HOVER_ONLY% + +:: Only uncomment one +:: SET CHOSEN_LOGIN_QR=%LOGIN_HOVER_ONLY_QR% +:: SET CHOSEN_LOGIN_QR=%LOGIN_HIDE_QR% + +:: SET CHOSEN_ORIGINAL_STYLE_TOP_BAR=%ORIGINAL_STYLE_TOP_BAR% +:: SET CHOSEN_HIDE_BIG_PICTURE_BUTTON=%HIDE_BIG_PICTURE_BUTTON% +:: SET CHOSEN_HIDE_PAGE_URL=%HIDE_PAGE_URL% +:: SET CHOSEN_SHOW_NAVIGATION_ARROWS=%SHOW_NAVIGATION_ARROWS% + +:: SET CHOSEN_HIDE_BOTTOM_BAR=%HIDE_BOTTOM_BAR% + +GOTO INSTALL_SECTION + +:: ------------- +:: --- METRO --- +:: ------------- +:METRO_SECTION +SET CHOSEN_COLORTHEME=metro +SET CHOSEN_NO_ROUNDED_CORNERS=%NO_ROUNDED_CORNERS% +GOTO INSTALL_SECTION + +:: -------------- +:: --- CUSTOM --- +:: -------------- +:CUSTOM_SECTION +ECHO --- Colortheme --- +ECHO 1) adwaita +ECHO 2) breeze +ECHO 3) catppuccin-frappe +ECHO 4) catppuccin-macchiato +ECHO 5) catppuccin-mocha +ECHO 6) dracula +ECHO 7) gruvbox +ECHO 8) kate +ECHO 9) metro +ECHO 10) nord +ECHO 11) one-pro +ECHO 12) pop +ECHO 13) tokyo-night +ECHO 14) tomorrow-night +ECHO 15) yaru +SET /p MENUCHOICE="Enter a number: " +IF %MENUCHOICE%==1 SET CHOSEN_COLORTHEME=adwaita +IF %MENUCHOICE%==2 SET CHOSEN_COLORTHEME=breeze +IF %MENUCHOICE%==3 SET CHOSEN_COLORTHEME=catppuccin-frappe +IF %MENUCHOICE%==4 SET CHOSEN_COLORTHEME=catppuccin-macchiato +IF %MENUCHOICE%==5 SET CHOSEN_COLORTHEME=catppuccin-mocha +IF %MENUCHOICE%==6 SET CHOSEN_COLORTHEME=dracula +IF %MENUCHOICE%==7 SET CHOSEN_COLORTHEME=gruvbox +IF %MENUCHOICE%==8 SET CHOSEN_COLORTHEME=kate +IF %MENUCHOICE%==9 SET CHOSEN_COLORTHEME=metro +IF %MENUCHOICE%==10 SET CHOSEN_COLORTHEME=nord +IF %MENUCHOICE%==11 SET CHOSEN_COLORTHEME=one-pro +IF %MENUCHOICE%==12 SET CHOSEN_COLORTHEME=pop +IF %MENUCHOICE%==13 SET CHOSEN_COLORTHEME=tokyo-night +IF %MENUCHOICE%==14 SET CHOSEN_COLORTHEME=tomorrow-night +IF %MENUCHOICE%==15 SET CHOSEN_COLORTHEME=yaru +ECHO. + +ECHO --- General --- +ECHO Disable Rounded Corners? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_NO_ROUNDED_CORNERS=%NO_ROUNDED_CORNERS% +ECHO. + +ECHO --- Library --- +ECHO Hide the Library What's New Shelf? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_HIDE_WHATS_NEW=%HIDE_WHATS_NEW% +ECHO. +ECHO Show Library Sidebar only on mouse over? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_SIDEBAR_HOVER_ONLY=%SIDEBAR_HOVER_ONLY% +ECHO. + +ECHO --- Login --- +ECHO Login Dialog Mobile QR Code +ECHO 1) Show +ECHO 2) Show only on mouse over +ECHO 3) Hide +SET /p MENUCHOICE="Enter a number: " +IF %MENUCHOICE%==2 SET CHOSEN_LOGIN_QR=%LOGIN_HOVER_ONLY_QR% +IF %MENUCHOICE%==3 SET CHOSEN_LOGIN_QR=%LOGIN_HIDE_QR% +ECHO. + +ECHO --- Top Bar --- +ECHO Use the Original Steam Style Top Bar? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_ORIGINAL_STYLE_TOP_BAR=%ORIGINAL_STYLE_TOP_BAR% +ECHO. +ECHO Hide Big Picture Button? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_HIDE_BIG_PICTURE_BUTTON=%HIDE_BIG_PICTURE_BUTTON% +ECHO. +ECHO Hide Page URL? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_HIDE_PAGE_URL=%HIDE_PAGE_URL% +ECHO. +ECHO Show Forward/Backward Navigation Arrows? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_SHOW_NAVIGATION_ARROWS=%SHOW_NAVIGATION_ARROWS% +ECHO. + +ECHO --- Bottom Bar --- +ECHO Hide the Bottom Bar? +SET /p MENUCHOICE="(y/n): " +IF %MENUCHOICE%==y SET CHOSEN_HIDE_BOTTOM_BAR=%HIDE_BOTTOM_BAR% +ECHO. + +GOTO INSTALL_SECTION + +:: ------------- +:: --- START --- +:: ------------- +:START_SECTION + +ECHO. +ECHO ------------------- +ECHO --- Menu Select --- +ECHO ------------------- +ECHO 1) Default Install (Quick) +ECHO 2) Metro Install (Quick) +ECHO 3) Custom Install (Interactive) + +SET /p MENUCHOICE="Enter a number: " + +IF %MENUCHOICE%==2 GOTO METRO_SECTION +IF %MENUCHOICE%==3 GOTO CUSTOM_SECTION + +GOTO DEFAULT_SECTION + +:: --- Install --- +:INSTALL_SECTION +install.py -fi -c %CHOSEN_COLORTHEME% %CHOSEN_NO_ROUNDED_CORNERS% %CHOSEN_HIDE_WHATS_NEW% %CHOSEN_SIDEBAR_HOVER_ONLY% %CHOSEN_LOGIN_QR% %CHOSEN_HIDE_BIG_PICTURE_BUTTON% %CHOSEN_HIDE_PAGE_URL% %CHOSEN_SHOW_NAVIGATION_ARROWS% %CHOSEN_ORIGINAL_STYLE_TOP_BAR% %CHOSEN_HIDE_BOTTOM_BAR% %WINDOW_CONTROLS% +PAUSE