split hypr* & hyprland stow packages; add success_count in change-colortheme script
This commit is contained in:
13 files changed
+11
-4
No files matched your search
@@ -1,2 +0,0 @@
|
||||
shaders
|
||||
wallpaper*
|
||||
Executable → Regular
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -13,6 +13,7 @@ import argparse
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from threading import Lock
|
||||
|
||||
MAX_WORKERS = 8
|
||||
|
||||
@@ -60,6 +61,10 @@ SCRIPTS = {
|
||||
# or simply `find [-L] <CONFIG_DIR> -type f -name 'apply-color*'` to get all available scripts,
|
||||
# but I need the exact application names anyway, so hardcoding does make some sense
|
||||
|
||||
# A thread-safe counter
|
||||
success_count = 0
|
||||
success_count_lock = Lock()
|
||||
|
||||
|
||||
def hex2rgb(hex_color: str) -> tuple[int, int, int]:
|
||||
"""#rrggbb to (r, g, b)"""
|
||||
@@ -231,6 +236,9 @@ def run_script(script_path: Path, args: list[str]):
|
||||
print(f"Error running {script_path}:\n{result.stderr.strip()}")
|
||||
else:
|
||||
print(f"✓ {script_path}")
|
||||
with success_count_lock:
|
||||
global success_count
|
||||
success_count += 1
|
||||
except Exception as e:
|
||||
print(f"Exception running {script_path}: {e}")
|
||||
|
||||
@@ -329,7 +337,7 @@ def main():
|
||||
"-a",
|
||||
"change-colortheme",
|
||||
"Colortheme Changed",
|
||||
f"Palette: {palette_name}\nFlavor: {flavor}\nApplied to {len(apps)} apps",
|
||||
f"Palette: {palette_name}\nFlavor: {flavor}\nApplied to {success_count} apps",
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user