From 2b576d429ba50e62ae41bd51f3f82bc81733abd7 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sat, 2 Aug 2025 17:27:51 +0200 Subject: [PATCH] Update README.md --- .scripts/modify-psname.py | 95 +++++++++++++++++++++++++++++++++++++ README.md | 22 ++++++--- backgrounds | 2 +- hypr/hyprland/keybinds.conf | 2 +- 4 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 .scripts/modify-psname.py diff --git a/.scripts/modify-psname.py b/.scripts/modify-psname.py new file mode 100644 index 0000000..89aade6 --- /dev/null +++ b/.scripts/modify-psname.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 +import sys +import os +from pathlib import Path + +try: + from fontTools.ttLib import TTFont + from fontTools.ttLib.ttCollection import TTCollection +except ImportError: + print("fontTools not installed. Please install with: pip install fonttools") + sys.exit(1) + + +def modify_ttc_psname_fonttools(input_path, new_psname, output_path): + """使用 fonttools 修改 TTC 文件的 PostScript 名称""" + + try: + # 检查是否为 TTC 文件 + if input_path.lower().endswith('.ttc'): + # 打开 TTC 文件 + ttc = TTCollection(input_path) + print(f"Found {len(ttc.fonts)} fonts in TTC file") + + for i, font in enumerate(ttc.fonts): + print(f"Processing font {i+1}/{len(ttc.fonts)}") + + # 修改 name 表中的各种名称 + name_table = font['name'] + + # 为多字体 TTC 添加索引后缀 + psname = f"{new_psname}-{i}" if len(ttc.fonts) > 1 else new_psname + family_name = new_psname.split('-')[0] if '-' in new_psname else new_psname + full_name = f"{new_psname} {i}" if len(ttc.fonts) > 1 else new_psname + + for record in name_table.names: + if record.nameID == 1: # Font family name + record.string = family_name + elif record.nameID == 4: # Full font name + record.string = full_name + elif record.nameID == 6: # PostScript name + record.string = psname + + print(f" PostScript name: {psname}") + print(f" Family name: {family_name}") + print(f" Full name: {full_name}") + + # 保存修改后的 TTC + ttc.save(output_path) + print(f"Successfully saved modified TTC: {output_path}") + + else: + # 处理单个 TTF 文件 + font = TTFont(input_path) + name_table = font['name'] + + family_name = new_psname.split('-')[0] if '-' in new_psname else new_psname + + for record in name_table.names: + if record.nameID == 1: # Font family name + record.string = family_name + elif record.nameID == 4: # Full font name + record.string = new_psname + elif record.nameID == 6: # PostScript name + record.string = new_psname + + font.save(output_path) + print(f"Successfully saved modified TTF: {output_path}") + + except Exception as e: + print(f"Error modifying font file: {e}") + sys.exit(1) + + +def main(): + if len(sys.argv) != 4: + print("Usage: python modify-psname-fonttools.py ") + print("Example: python modify-psname-fonttools.py input.ttc 'Microsoft YaHei' output.ttc") + sys.exit(1) + + input_path = sys.argv[1] + new_psname = sys.argv[2] + output_path = sys.argv[3] + + if not os.path.exists(input_path): + print(f"Input file does not exist: {input_path}") + sys.exit(1) + + modify_ttc_psname_fonttools(input_path, new_psname, output_path) + + +if __name__ == "__main__": + # 直接调用示例 + modify_ttc_psname_fonttools("/home/kolkas/Downloads/wqy/wqy-zenhei.ttc", + "Microsoft YaHei", + "/home/kolkas/Downloads/wqy/wqy-zenhei-modified.ttc") diff --git a/README.md b/README.md index 0f03bc2..0ac52c4 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,21 @@ - - - +## Screenshots + +- desktop with a few widgets: + + + +- dynamic flavor based on Catppuccin Mocha: + + +- the grub menu looks like: + ## Setup Overview @@ -16,8 +24,8 @@ - **Bar**: Waybar - **Shell**: Fish - **Prompt**: Oh My Posh -- **Terminal**: Kitty & Ghostty (floating) -- **Colorscheme**: Catppuccin-mocha (dynamic flavor) +- **Terminal**: Kitty & Ghostty +- **Colorscheme**: Catppuccin-mocha - **App Launcher**: Rofi - **Logout Screen**: Wlogout - **Desktop Widgets**: Eww @@ -30,7 +38,7 @@ Based on [end-4/dots-hyprland](https://github.com/end-4/dots-hyprland) but witho ## Eww - `main`, main dashboard, modified from [syndrizzle/hotfiles](https://github.com/syndrizzle/hotfiles/tree/bspwm) without notification center. -- `lyrics`, scrolling lyrics player, dependents on api from [akashrchandran/spotify-lyrics-api](https://github.com/akashrchandran/spotify-lyrics-api) and [a small program](https://github.com/Uyanide/spotify-lyrics) from myself (which also happens to be my frist Golang program :D). +- `lyrics`, scrolling lyrics player, dependents on [a small program](https://github.com/Uyanide/spotify-lyrics) from myself (which also happens to be my frist Golang program :D). - `lyrics-single`, similar to `lyrics`, but only with a single line and can be easily embeded into the status bar. ## Rofi diff --git a/backgrounds b/backgrounds index 0f7914d..9f14800 160000 --- a/backgrounds +++ b/backgrounds @@ -1 +1 @@ -Subproject commit 0f7914d34693a30ffeefa353820bbcc25ca93b00 +Subproject commit 9f148001d6329f6c0b3b539023e8811afc5aa204 diff --git a/hypr/hyprland/keybinds.conf b/hypr/hyprland/keybinds.conf index 922c0c7..ee98001 100755 --- a/hypr/hyprland/keybinds.conf +++ b/hypr/hyprland/keybinds.conf @@ -103,7 +103,7 @@ bind = Super+Alt, F, fullscreenstate, 0 3 # Toggle fake fullscreen bind = Super, F, fullscreen, 0 bind = Super, D, fullscreen, 1 bind = Super, J, togglesplit -bind = Super, P, pseudo +# bind = Super, P, pseudo #! ##! Workspace navigation