feat: replace Xterm to own term #169

Merged
Boria138 merged 1 commits from term into main 2026-05-22 06:53:14 +00:00
18 changed files with 2351 additions and 12 deletions

No files matched your search

+1
View File
@@ -61,6 +61,7 @@ PortProtonQt использует код и зависимости от след
- [Icoextract](https://github.com/jlu5/icoextract) — библиотека для извлечения иконок, лицензия [MIT](https://github.com/jlu5/icoextract/blob/master/LICENSE).
- [HowLongToBeat Python API](https://github.com/ScrappyCocco/HowLongToBeat-PythonAPI) — библиотека для взаимодействия с HowLongToBeat, лицензия [MIT](https://github.com/ScrappyCocco/HowLongToBeat-PythonAPI/blob/master/LICENSE.md).
- [iat](https://sourceforge.net/projects/iat.berlios) — библиотека для конвертации mdf в iso, лицензия GPLv3
- [pyte](https://github.com/selectel/pyte) — разбор ANSI escape-кодов, лицензия [LGPLv3](https://github.com/selectel/pyte?tab=LGPL-3.0-1-ov-file)
Полный текст лицензий см. в файле [LICENSE](LICENSE).
> [!WARNING]
@@ -1293,7 +1293,7 @@ pw_init_runtime () {
export PW_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PW_PLUGINS_PATH}/portable/lib/lib64:${PW_PLUGINS_PATH}/portable/lib/lib32"
export PW_VK_LAYER_PATH="${PW_PLUGINS_PATH}/portable/share/vulkan/implicit_layer.d"
if [[ -z "$PW_TERM" ]] ; then
export PW_TERM="env LD_LIBRARY_PATH=\"${PW_LD_LIBRARY_PATH}\" ${PW_PLUGINS_PATH}/portable/bin/xterm -bg black -fg white -e"
export PW_TERM="env LD_LIBRARY_PATH=\"${PW_LD_LIBRARY_PATH}\" python3 -m portprotonqt.easyterm -e"
fi
export pw_runtime="env"
return 0
@@ -1380,7 +1380,7 @@ ${PW_PV_OVERRIDES}/i386-linux-gnu/aliases:\
for PWRTMRW in "${PW_RT_MOUNT_RW[@]}" ; do
export PRESSURE_VESSEL_FILESYSTEMS_RW="${PRESSURE_VESSEL_FILESYSTEMS_RW:+$PRESSURE_VESSEL_FILESYSTEMS_RW:}${PWRTMRW}"
done
export PW_TERM="env LD_LIBRARY_PATH=\"${PW_LD_LIBRARY_PATH}\" ${PW_PLUGINS_PATH}/portable/bin/xterm -bg black -fg white -e"
export PW_TERM="env LD_LIBRARY_PATH=\"${PW_LD_LIBRARY_PATH}\" python3 -m portprotonqt.easyterm -e"
print_info "RUNTIME is enabled"
}
@@ -3722,6 +3722,15 @@ export -f pw_ppd_dbus_has_profile
}
pw_run () {
if [[ "$PW_USE_TERMINAL" == 1 ]] \
&& [[ "${PRESSURE_VESSEL_TERMINAL:-}" != "tty" ]]
then
local pw_terminal_command
printf -v pw_terminal_command "%q " pw_run "$@"
PRESSURE_VESSEL_TERMINAL=tty $PW_TERM "$pw_terminal_command"
return $?
fi
if [[ -n "${PATH_TO_GAME}" ]] \
&& [[ -d "${PATH_TO_GAME}" ]]
then
@@ -3774,7 +3783,6 @@ pw_run () {
"${WINELOADER}" "$@" ${proxy_launch_parameters} &>>"${PW_LOG_FILE}"
else
if [[ "$PW_USE_TERMINAL" == 1 ]] ; then
PW_ADD_TO_ARGS_IN_RUNTIME="--xterm"
pw_init_runtime
fi
echo ""
+4 -9
View File
@@ -200,8 +200,8 @@ if [[ -z "$DOWNLOAD_STEAM_GRID" ]] ; then
fi
if check_gamescope_session
then PW_TERM="env LANG=C $PW_PLUGINS_PATH/portable/bin/xterm -fullscreen -bg black -fg white -e"
else PW_TERM="env LANG=C $PW_PLUGINS_PATH/portable/bin/xterm -bg black -fg white -e"
then PW_TERM="env LANG=C python3 -m portprotonqt.easyterm --fullscreen -e"
else PW_TERM="env LANG=C python3 -m portprotonqt.easyterm -e"
fi
pw_cleanup () {
@@ -433,12 +433,7 @@ Usage examples:
get_wine_and_pfx "$2" "$3"
start_portproton
cd "${PORT_DATA_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c" || fatal
if [[ $PW_DISABLE_RUNTIME_DOWNLOAD == "1" ]]; then
$PW_TERM "pw_run cmd"
else
export PW_USE_TERMINAL=1
pw_run cmd
fi
PW_USE_TERMINAL=1 pw_run cmd
stop_portproton
;;
--winereg)
@@ -474,7 +469,7 @@ Usage examples:
VK_INSTANCE_LAYERS="${PW_VK_INSTANCE_LAYERS}" \
${PW_GAMEMODERUN_SLR} \
${PW_ADD_VAR_SLR} \
${PW_TERM} bash
${PW_TERM}
stop_portproton
;;
--initial)
+51
View File
@@ -8,6 +8,7 @@
- [Theme Variants](#-theme-variants)
- [Style File](#-style-file-stylespy)
- [Style Inheritance](#-style-inheritance)
- [Terminal Color Schemes](#-terminal-color-schemes)
- [Animation configuration](#-animation-configuration)
- [Metadata](#-metadata-metainfoini)
- [Screenshots](#-screenshots)
@@ -162,6 +163,56 @@ Economy mode also forces the compact detail page layout.
---
## 🖥 Terminal Color Schemes
Terminal color schemes are separate Kitty-style `.conf` files. Built-in schemes are stored in `portprotonqt/terminal_schemes/`. User schemes can be placed in:
```text
~/.local/share/PortProtonQt/terminal_schemes/
```
The filename without `.conf` is used as the scheme name. The terminal menu lists all available `.conf` files from the user directory and the built-in directory.
Example:
```conf
foreground #d4d4d4
background #1e1e1e
cursor #bbbbbb
selection_foreground #ffffff
selection_background #264f78
background_opacity 1.0
cursor_shape block
enable_audio_bell no
color0 #000000
color1 #cd3131
color2 #0dbc79
color3 #e5e510
color4 #2472c8
color5 #bc3fbc
color6 #11a8cd
color7 #e5e5e5
font_size 14
font_family Monospace
```
Supported terminal-specific options:
- `foreground`, `background`: default text and background colors.
- `selection_foreground`, `selection_background`: selected text colors.
- `cursor` or `cursor_color`: cursor color.
- `cursor_shape`: `block`, `beam`, or `underline`.
- `enable_audio_bell`: `yes`/`no`, `true`/`false`, `on`/`off`, or `1`/`0`.
- `background_opacity`: background opacity from `0.0` to `1.0`.
- `font_size`, `font_family`: terminal font settings.
- `color0` through `color255`: ANSI palette entries.
If `cursor_shape` is omitted, the terminal uses `beam`. If `enable_audio_bell` is omitted, audio bell is disabled.
---
## 🎥 Animation configuration
The `GAME_CARD_ANIMATION` dictionary controls all animation parameters for game cards:
+51
View File
@@ -8,6 +8,7 @@
- [Варианты темы](#-варианты-темы)
- [Файл стилей](#-файл-стилей-stylespy)
- [Наследование стилей](#-наследование-стилей)
- [Цветовые схемы терминала](#-цветовые-схемы-терминала)
- [Конфигурация анимации](#-конфигурация-анимации)
- [Метаинформация](#-метаинформация-metainfoini)
- [Скриншоты](#-скриншоты)
@@ -162,6 +163,56 @@ DETAIL_PAGE_LAYOUT_MODE = "full"
---
## 🖥 Цветовые схемы терминала
Цветовые схемы терминала задаются отдельными `.conf` файлами в Kitty-style формате. Встроенные схемы находятся в `portprotonqt/terminal_schemes/`. Пользовательские схемы можно положить в:
```text
~/.local/share/PortProtonQt/terminal_schemes/
```
Имя файла без `.conf` используется как имя схемы. Меню терминала показывает все доступные `.conf` файлы из пользовательской и встроенной директорий.
Пример:
```conf
foreground #d4d4d4
background #1e1e1e
cursor #bbbbbb
selection_foreground #ffffff
selection_background #264f78
background_opacity 1.0
cursor_shape block
enable_audio_bell no
color0 #000000
color1 #cd3131
color2 #0dbc79
color3 #e5e510
color4 #2472c8
color5 #bc3fbc
color6 #11a8cd
color7 #e5e5e5
font_size 14
font_family Monospace
```
Поддерживаемые параметры терминала:
- `foreground`, `background`: основные цвета текста и фона.
- `selection_foreground`, `selection_background`: цвета выделенного текста.
- `cursor` или `cursor_color`: цвет курсора.
- `cursor_shape`: `block`, `beam` или `underline`.
- `enable_audio_bell`: `yes`/`no`, `true`/`false`, `on`/`off` или `1`/`0`.
- `background_opacity`: прозрачность фона от `0.0` до `1.0`.
- `font_size`, `font_family`: настройки шрифта терминала.
- `color0` до `color255`: элементы ANSI-палитры.
Если `cursor_shape` не указан, терминал использует `beam`. Если `enable_audio_bell` не указан, звуковой сигнал выключен.
---
## 🎥 Конфигурация анимации
Словарь `GAME_CARD_ANIMATION` управляет всеми параметрами анимации для карточек игр:
+9
View File
@@ -219,6 +219,15 @@ class UIConfig(BaseConfig):
"""Resolve base theme and variant to an installed theme name."""
return _resolve_theme_name(theme_name, variant)
def get_terminal_scheme(self) -> str:
"""Get the current terminal scheme name."""
return self._get_str("terminal_scheme", "default")
def set_terminal_scheme(self, scheme_name: str):
"""Set the terminal scheme name."""
validate_string(scheme_name, "terminal_scheme", min_len=1, max_len=50)
self._save_value("terminal_scheme", scheme_name, "str")
def get_time_detail_level(self) -> str:
"""Get time detail level ('detailed' or 'simple')."""
cp = self._read_config()
File diff suppressed because it is too large. Load diff
+7
View File
@@ -8,6 +8,7 @@ install_data(
'dialogs.py',
'disc_image_utils.py',
'downloader.py',
'easyterm.py',
'game_card.py',
'game_library_manager.py',
@@ -145,6 +146,12 @@ install_subdir(
exclude_files: ['*.pyc'],
)
# Install terminal schemes
install_subdir(
'terminal_schemes',
install_dir: pythondir / meson.project_name(),
)
# Compile and install locales from .po files
msgfmt = find_program('msgfmt', required: true)
foreach lang : ['de', 'es', 'pt', 'ru']
@@ -0,0 +1,36 @@
# Adwaita Theme
foreground #eeeeec
background #1e1e1e
selection_foreground #ffffff
selection_background #3584e4
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #1e1e1e
color8 #555753
# Red
color1 #cc0000
color9 #ef2929
# Green
color2 #4e9a06
color10 #8ae234
# Yellow
color3 #c4a000
color11 #fce94f
# Blue
color4 #3465a4
color12 #729fcf
# Magenta
color5 #75507b
color13 #ad7fa8
# Cyan
color6 #06989a
color14 #34e2e2
# White
color7 #d3d7cf
color15 #eeeeec
font_size 14
font_family Monospace
+36
View File
@@ -0,0 +1,36 @@
# Breeze Theme
foreground #eff0f1
background #232629
selection_foreground #eff0f1
selection_background #3daee9
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #232629
color8 #7f8c8d
# Red
color1 #ed1515
color9 #c0392b
# Green
color2 #11d116
color10 #1cdc9a
# Yellow
color3 #f67400
color11 #fdbc4b
# Blue
color4 #1d99f3
color12 #3daee9
# Magenta
color5 #9b59b6
color13 #8e44ad
# Cyan
color6 #1abc9c
color14 #16a085
# White
color7 #eff0f1
color15 #ffffff
font_size 14
font_family Monospace
@@ -0,0 +1,36 @@
# Default Theme
foreground #d4d4d4
background #1e1e1e
selection_foreground #ffffff
selection_background #264f78
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #000000
color8 #666666
# Red
color1 #cd3131
color9 #f14c4c
# Green
color2 #0dbc79
color10 #23d18b
# Yellow
color3 #e5e510
color11 #f5f543
# Blue
color4 #2472c8
color12 #3b8eea
# Magenta
color5 #bc3fbc
color13 #d670d6
# Cyan
color6 #11a8cd
color14 #29b8db
# White
color7 #e5e5e5
color15 #e5e5e5
font_size 14
font_family Monospace
@@ -0,0 +1,36 @@
# Dracula Theme
foreground #f8f8f2
background #282a36
selection_foreground #ffffff
selection_background #44475a
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #21222c
color8 #6272a4
# Red
color1 #ff5555
color9 #ff6e6e
# Green
color2 #50fa7b
color10 #69ff94
# Yellow
color3 #f1fa8c
color11 #ffffa5
# Blue
color4 #bd93f9
color12 #d6acff
# Magenta
color5 #ff79c6
color13 #ff92df
# Cyan
color6 #8be9fd
color14 #a4ffff
# White
color7 #f8f8f2
color15 #ffffff
font_size 14
font_family Monospace
+36
View File
@@ -0,0 +1,36 @@
# GNOME Theme
foreground #d0cfcc
background #171421
selection_foreground #ffffff
selection_background #12488b
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #171421
color8 #5e5c64
# Red
color1 #c01c28
color9 #f66151
# Green
color2 #26a269
color10 #33d17a
# Yellow
color3 #a2734c
color11 #e9ad0c
# Blue
color4 #12488b
color12 #2a7bde
# Magenta
color5 #a347ba
color13 #c061cb
# Cyan
color6 #2aa1b3
color14 #33c7de
# White
color7 #d0cfcc
color15 #ffffff
font_size 14
font_family Monospace
@@ -0,0 +1,36 @@
# Gruvbox Dark Theme
foreground #ebdbb2
background #282828
selection_foreground #ebdbb2
selection_background #504945
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #282828
color8 #928374
# Red
color1 #cc241d
color9 #fb4934
# Green
color2 #98971a
color10 #b8bb26
# Yellow
color3 #d79921
color11 #fabd2f
# Blue
color4 #458588
color12 #83a598
# Magenta
color5 #b16286
color13 #d3869b
# Cyan
color6 #689d6a
color14 #8ec07c
# White
color7 #a89984
color15 #ebdbb2
font_size 14
font_family Monospace
+36
View File
@@ -0,0 +1,36 @@
# Nord Theme
foreground #d8dee9
background #2e3440
selection_foreground #d8dee9
selection_background #434c5e
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #3b4252
color8 #4c566a
# Red
color1 #bf616a
color9 #bf616a
# Green
color2 #a3be8c
color10 #a3be8c
# Yellow
color3 #ebcb8b
color11 #ebcb8b
# Blue
color4 #81a1c1
color12 #81a1c1
# Magenta
color5 #b48ead
color13 #b48ead
# Cyan
color6 #88c0d0
color14 #8fbcbb
# White
color7 #e5e9f0
color15 #eceff4
font_size 14
font_family Monospace
@@ -0,0 +1,36 @@
# Solarized Dark Theme
foreground #839496
background #002b36
selection_foreground #93a1a1
selection_background #073642
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Black
color0 #073642
color8 #002b36
# Red
color1 #dc322f
color9 #cb4b16
# Green
color2 #859900
color10 #586e75
# Yellow
color3 #b58900
color11 #657b83
# Blue
color4 #268bd2
color12 #839496
# Magenta
color5 #d33682
color13 #6c71c4
# Cyan
color6 #2aa198
color14 #93a1a1
# White
color7 #eee8d5
color15 #fdf6e3
font_size 14
font_family Monospace
@@ -0,0 +1,30 @@
# Solarized Light Theme (Kitty Original)
foreground #52676f
background #fdf6e3
cursor #52676f
selection_foreground #fcf4dc
selection_background #e9e2cb
background_opacity 1.0
cursor_shape block
enable_audio_bell no
# Palette
color0 #e4e4e4
color8 #ffffd7
color1 #d70000
color9 #d75f00
color2 #5f8700
color10 #585858
color3 #af8700
color11 #626262
color4 #0087ff
color12 #808080
color5 #af005f
color13 #5f5faf
color6 #00afaf
color14 #8a8a8a
color7 #262626
color15 #1c1c1c
font_size 14
font_family Monospace
+23
View File
@@ -0,0 +1,23 @@
background #300a24
foreground #eeeeec
cursor #bbbbbb
selection_background #b4d5ff
cursor_shape block
enable_audio_bell no
color0 #2e3436
color8 #555753
color1 #cc0000
color9 #ef2929
color2 #4e9a06
color10 #8ae234
color3 #c4a000
color11 #fce94f
color4 #3465a4
color12 #729fcf
color5 #75507b
color13 #ad7fa8
color6 #06989a
color14 #34e2e2
color7 #d3d7cf
color15 #eeeeec
selection_foreground #300a24