Nahrát soubory do „/“
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import curses, os
|
||||
|
||||
items = [
|
||||
["AirBattery ", "Get the battery usage of all your devices", "lihaoyun6/tap/airbattery"],
|
||||
["Crossover ", "Tool to run Windows software", "--cask crossover"],
|
||||
["Diffusion Bee ", "Run Stable Diffusion locally", "--cask diffusionbee"],
|
||||
["ffmpeg ", "Play, record, convert, and stream select audio and video codecs", "ffmpeg"],
|
||||
["fish ", "User-friendly command-line shell for UNIX-like operating systems", "fish"],
|
||||
["FreeTube ", "YouTube player focusing on privacy", "--cask freetube"],
|
||||
["Grayjay desktop ", "Multi-platform video player", "--cask grayjay"],
|
||||
["Helium ", "Chromium-based web browser", "--cask helium-browser"],
|
||||
["Heroic Games Launcher", "Game launcher", "--cask heroic"],
|
||||
["Hytale ", "Official Hytale Launcher", "--cask hytale"],
|
||||
["KeyClu ", "Find shortcuts for any installed application", "--cask keyclu"],
|
||||
["LibreOffice ", "Free cross-platform office suite, fresh version", "--cask libreoffice"],
|
||||
["Macs Fan Control ", "Controls and monitors all fans on Apple computers", "--cask macs-fan-control"],
|
||||
["mactop ", "Apple Silicon Monitor Top written in Go Lang", "mactop"],
|
||||
["micro ", "Modern and intuitive terminal-based text editor", "micro"],
|
||||
["mole ", "Deep clean and optimize your Mac", "mole"],
|
||||
["Mozilla Firefox ", "Web browser", "--cask firefox"],
|
||||
["Msty Studio ", "AI platform with local and online models", "--cask mstystudio"],
|
||||
["Orion Browser ", "WebKit based web browser", "--cask orion"],
|
||||
["Pinta ", "Simple Gtk# Paint Program", "--cask pinta"],
|
||||
["Prism Launcher ", "Minecraft launcher", "--cask prismlauncher"],
|
||||
["Steam ", "Video game digital distribution service", "--cask steam"],
|
||||
["Transmission ", "Open-source BitTorrent client", "--cask transmission"],
|
||||
["UTM ", "Virtual machines UI using QEMU", "--cask utm"],
|
||||
["VLC media player ", "Multimedia player", "--cask vlc"],
|
||||
["Windows App ", "Connect to Windows", "--cask windows-app"],
|
||||
["yt-dlp ", "Feature-rich command-line audio/video downloader", "yt-dlp"],
|
||||
["Zen Browser ", "Gecko based web browser", "--cask zen"],
|
||||
["- DONE", "", ""]]
|
||||
|
||||
selected = [False] * len(items)
|
||||
progress, progress_total = 1, 3
|
||||
|
||||
def brew_install():
|
||||
os.system('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"')
|
||||
brew analytics off
|
||||
|
||||
def brew_choose_default_apps(stdscr):
|
||||
curses.curs_set(0)
|
||||
stdscr.clear()
|
||||
current_row = 0
|
||||
while True:
|
||||
stdscr.clear()
|
||||
stdscr.addstr(0, 0, "Select items with arrow keys and space bar:", curses.A_BOLD)
|
||||
for idx, item in enumerate(items):
|
||||
checkbox = "[X]" if selected[idx] else "[ ]"
|
||||
if idx == current_row:
|
||||
stdscr.addstr(idx + 1, 0, f"> {checkbox} {item[0]} - {item[1]}", curses.A_BOLD)
|
||||
else:
|
||||
stdscr.addstr(idx + 1, 0, f" {checkbox} {item[0]} - {item[1]}")
|
||||
stdscr.refresh()
|
||||
key = stdscr.getch()
|
||||
if key == curses.KEY_UP and current_row > 0:
|
||||
current_row -= 1
|
||||
elif key == curses.KEY_DOWN and current_row < len(items) - 1:
|
||||
current_row += 1
|
||||
elif key == ord(' '):
|
||||
if current_row == len(items) - 1:
|
||||
break
|
||||
selected[current_row] = not selected[current_row]
|
||||
|
||||
def brew_choose_custom_apps():
|
||||
pass
|
||||
|
||||
def brew_install_apps():
|
||||
for idx, item in enumerate(items):
|
||||
if selected[idx]:
|
||||
os.system("brew install " + items[idx][2])
|
||||
|
||||
input(f"[{progress}/{progress_total}] Install Brew. Needs sudo")
|
||||
brew_install()
|
||||
progress += 1
|
||||
input(f"[{progress}/{progress_total}] Choose apps")
|
||||
curses.wrapper(brew_choose_default_apps)
|
||||
progress += 1
|
||||
input(f"[{progress}/{progress_total}] Install apps")
|
||||
brew_install_apps()
|
||||
Reference in New Issue
Block a user