mirror of
https://github.com/StepanovPlaton/dotfiles.git
synced 2026-04-03 20:30:46 +04:00
050125
This commit is contained in:
108
.scripts/create_telegram_theme.py
Executable file
108
.scripts/create_telegram_theme.py
Executable file
@@ -0,0 +1,108 @@
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def create_pro_dark_theme():
|
||||
if len(sys.argv) < 2:
|
||||
print("Использование: python3 gen_telegram.py /путь/к/colors.json")
|
||||
return
|
||||
|
||||
colors_path = os.path.expanduser(sys.argv[1])
|
||||
|
||||
if not os.path.exists(colors_path):
|
||||
print(f"Файл '{colors_path}' не найден.")
|
||||
return
|
||||
|
||||
try:
|
||||
with open(colors_path, "r") as f:
|
||||
wal = json.load(f)
|
||||
|
||||
c = wal["colors"]
|
||||
bg = wal["special"]["background"]
|
||||
fg = wal["special"]["foreground"]
|
||||
|
||||
# Настройки для максимальной темноты
|
||||
real_bg = bg
|
||||
darker_bg = c["color0"] # Самый темный из палитры
|
||||
selection_bg = c["color8"] # Цвет для выделения (серый)
|
||||
accent = c["color3"] # Основной акцент
|
||||
|
||||
# Генерация расширенной темы
|
||||
theme_content = f"""
|
||||
// Основное окно
|
||||
windowBg: {real_bg};
|
||||
windowFg: {fg};
|
||||
windowBgOver: {selection_bg};
|
||||
windowBgRipple: {darker_bg};
|
||||
windowFgOver: {fg};
|
||||
windowSubTextFg: {c['color7']};
|
||||
windowBoldFg: {fg};
|
||||
windowActiveTextFg: {accent};
|
||||
|
||||
// --- ВАШИ СООБЩЕНИЯ (Исходящие) ---
|
||||
// Делаем их темными, почти как фон, но с заметной границей или чуть светлее
|
||||
msgOutBg: {darker_bg};
|
||||
msgOutBgSelected: {selection_bg};
|
||||
msgOutTxtFg: {fg};
|
||||
msgOutServiceFg: {accent};
|
||||
msgOutShadow: #00000000;
|
||||
|
||||
// Входящие сообщения
|
||||
msgInBg: {darker_bg};
|
||||
msgInBgSelected: {selection_bg};
|
||||
msgInTxtFg: {fg};
|
||||
msgInShadow: #00000000;
|
||||
|
||||
// --- МЕНЮ И ВЫПАДАЮЩИЕ СПИСКИ ---
|
||||
// Исправляем отсутствие выделения в меню
|
||||
menuBg: {real_bg};
|
||||
menuBgOver: {selection_bg};
|
||||
menuBgRipple: {darker_bg};
|
||||
menuFg: {fg};
|
||||
menuFgOver: {c['color15']};
|
||||
menuIconFg: {c['color7']};
|
||||
menuIconFgOver: {accent};
|
||||
|
||||
// Списки (выбор в настройках, контакты)
|
||||
listBgOver: {selection_bg};
|
||||
listFgOver: {fg};
|
||||
|
||||
// Боковая панель (Список чатов)
|
||||
dialogsBg: {real_bg};
|
||||
dialogsBgOver: {selection_bg};
|
||||
dialogsBgActive: {selection_bg};
|
||||
dialogsNameFg: {fg};
|
||||
dialogsTextFg: {c['color7']};
|
||||
dialogsUnreadBg: {accent};
|
||||
dialogsUnreadFg: {real_bg};
|
||||
|
||||
// Поле ввода
|
||||
historyComposeAreaBg: {real_bg};
|
||||
historyComposeIconFg: {c['color7']};
|
||||
historyComposeIconFgOver: {accent};
|
||||
|
||||
// Скроллбар
|
||||
scrollBarBg: {darker_bg}80;
|
||||
scrollBarBgOver: {selection_bg};
|
||||
|
||||
// Кнопки
|
||||
activeButtonBg: {accent};
|
||||
activeButtonBgOver: {c['color12']};
|
||||
activeButtonFg: {real_bg};
|
||||
"""
|
||||
|
||||
output_path = os.path.expanduser(
|
||||
"~/.config/colorschemes/telegram.tdesktop-theme"
|
||||
)
|
||||
with open(output_path, "w") as f:
|
||||
f.write(theme_content)
|
||||
|
||||
print(f"Тема обновлена: {output_path}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Ошибка: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
create_pro_dark_theme()
|
||||
11
.scripts/dwmblocks/cpu
Executable file
11
.scripts/dwmblocks/cpu
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/env bash
|
||||
colors_path=$HOME/.cache/wal/colors.sh
|
||||
cpu_usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
|
||||
|
||||
# cpu_usage=$(echo "$cpu_usage" | cut -c1-1)
|
||||
cpu_usage=$(printf "%.0f" "$cpu_usage")
|
||||
|
||||
if [ -f "$colors_path" ]; then
|
||||
source $colors_path
|
||||
echo "^b$color1^^c$color0^ ^d^^b$color8^^c$color0^ $cpu_usage% ^d^"
|
||||
fi
|
||||
6
.scripts/dwmblocks/date
Executable file
6
.scripts/dwmblocks/date
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/env bash
|
||||
colors_path=$HOME/.cache/wal/colors.sh
|
||||
if [ -f "$colors_path" ]; then
|
||||
source $colors_path
|
||||
echo "^c$color0^^b$color1^$(date +" %d") ^d^^c$color0^^b$color8^$(date +" %I:%M%p") ^d^ ^d^ "
|
||||
fi
|
||||
9
.scripts/dwmblocks/memory
Executable file
9
.scripts/dwmblocks/memory
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/env bash
|
||||
colors_path=$HOME/.cache/wal/colors.sh
|
||||
|
||||
memory_usage=$(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)
|
||||
|
||||
if [ -f "$colors_path" ]; then
|
||||
source $colors_path
|
||||
echo "^b$color1^^c$color0^ ^d^^b$color8^^c$color0^ $memory_usage ^d^"
|
||||
fi
|
||||
18
.scripts/dwmblocks/volume_mic
Executable file
18
.scripts/dwmblocks/volume_mic
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/env bash
|
||||
|
||||
colors_path=$HOME/.cache/wal/colors.sh
|
||||
|
||||
vol=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F "Volume: " '{print $2}')
|
||||
vol=$(echo "$vol * 100" | bc)
|
||||
vol=$(printf "%.0f" "$vol")
|
||||
|
||||
mic=$(wpctl get-volume @DEFAULT_SOURCE@ | awk -F "Volume: " '{print $2}')
|
||||
mic=$(echo "$mic * 100" | bc)
|
||||
mic=$(printf "%.0f" "$mic")
|
||||
|
||||
|
||||
if [ -f "$colors_path" ]; then
|
||||
source $colors_path
|
||||
echo "^b$color1^^c$color0^ $vol ^d^^b$color8^^c$color0^ $mic ^d^"
|
||||
fi
|
||||
|
||||
10
.scripts/weather.sh
Executable file
10
.scripts/weather.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/env bash
|
||||
colors_path=$HOME/.cache/wal/colors.sh
|
||||
|
||||
WEATHER=$(curl --silent v2d.wttr.in/Samara | grep "Weather:")
|
||||
TEMP=$(echo $WEATHER | tr "," "\n" | grep "°C")
|
||||
|
||||
if [ -f "$colors_path" ]; then
|
||||
source $colors_path
|
||||
[[ ! -z "$TEMP" ]] && echo "^b$color1^^c$color0^ ^d^^b$color8^^c$color0^$TEMP ^d^"
|
||||
fi
|
||||
Reference in New Issue
Block a user