Compare commits
10
Commits
v1.0.0
...
ab4b05b514
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab4b05b514 | ||
|
|
2a3ea43e36 | ||
|
|
d08a47d63c | ||
|
|
cd93fdc242 | ||
|
|
7c75ee9640 | ||
|
|
04fef5ab44 | ||
|
|
9acc794a6f | ||
|
|
fc398f7a2a | ||
|
|
f9b31593c2 | ||
|
|
585ecab616 |
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) [year] [fullname]
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,4 +1,5 @@
|
||||
name,type,mas_id,install_on_setup,category,description,price
|
||||
rcmd,cask,,yes,personalization,Keyboard based app switcher,paid
|
||||
ente-auth,cask,,yes,security,Free secure two-factor auth service,free
|
||||
android-platform-tools,cask,,no,utilities,ADB tools,free
|
||||
sozercan/repo/kaset,cask,,yes,media,MacOS YTM client,free
|
||||
@@ -27,7 +28,6 @@ rectangle,cask,,yes,personalization,Window management tool,free
|
||||
karabiner-elements,cask,,yes,personalization,Keyboard customization tool,free
|
||||
zotero,cask,,no,knowledge,Reference organize tool,free
|
||||
affine,cask,,yes,knowledge,Opensource notion alternative,free
|
||||
busycontacts,cask,,yes,productivity,Contact management tool with CalDAV support,paid
|
||||
affinity,cask,,yes,creativity,Photoshop alternative by canva,free
|
||||
discord,cask,,yes,social,Discord desktop client,free
|
||||
shifty,cask,,yes,personalization,Night shift adjust tool,free
|
||||
@@ -35,7 +35,6 @@ keka,cask,,yes,utilities,File extraction enhancer,free
|
||||
keyboardcleantool,cask,,yes,utilities,Lock keyboard input during cleaning,free
|
||||
appcleaner,cask,,yes,utilities,Remove app without residue,free
|
||||
monitorcontrol,cask,,yes,personalization,Control external monitor brightness,free
|
||||
alcove,cask,,yes,personalization,Notch app,paid
|
||||
tunnelbear,cask,,yes,network,VPN,free
|
||||
arduino-ide,cask,,no,development,Arduino IDE,free
|
||||
clop,cask,,yes,personalization,File compressor,free
|
||||
@@ -45,17 +44,15 @@ openmtp,cask,,yes,utilities,Android device connector,free
|
||||
responsively,cask,,no,development,Browser for responsible website development,free
|
||||
telegram,cask,,yes,social,Telegram desktop client,free
|
||||
wireshark-app,cask,,no,network,Network packets capturer,free
|
||||
git,formula,,yes,development,Version management tool,free
|
||||
git,formula,,yes,development,File version manager,free
|
||||
mole,formula,,yes,utilities,System optimizer,free
|
||||
fastfetch,formula,,yes,utilities,Neofetch alternative,free
|
||||
mas,formula,,yes,utilities,CLI appstore,free
|
||||
tree,formula,,yes,utilities,File structure tree,free
|
||||
scrcpy,formula,,no,utilities,Android screen mirroring,free
|
||||
thaw,formula,,yes,personalization,Menubar hidder,free
|
||||
thaw,cask,,yes,personalization,Menubar hidder,free
|
||||
nmap,formula,,no,network,Network scanner,free
|
||||
davinci resolve ,manual,,no,creativity,Video editor,free
|
||||
reef,manual,,no,personalization,"Shortcuts based app switcher
|
||||
https://github.com/gouwsxander/Reef",free
|
||||
tageditor,mas,984278082,no,utilities,Audio file metadata editor,free
|
||||
Allkdic,mas,1033453958,yes,productivity,Menubar dictionary,free
|
||||
Bitwarden,mas,1352778147,yes,security,Password manager,free
|
||||
@@ -64,7 +61,7 @@ KakaoTalk,mas,869223134,yes,social,KakaoTalk,free
|
||||
Linearity Curve,mas,1219074514,no,creativity,Vector based design tool,free
|
||||
Poolsuite FM,mas,1514817810,no,media,Internet music radio,free
|
||||
Print to PDF,mas,1639234272,yes,utilities,Save pdf to file,free
|
||||
RunCat,mas,1429033973,yes,personalization,Menubar system usage visualizer,free
|
||||
RunCat Neo,mas,6757801838,yes,personalization,Menubar system usage visualizer,free
|
||||
Texty,mas,1538996043,yes,social,Third-party google chat desktop client,free
|
||||
Windows App,mas,1295203466,yes,productivity,Windows RDP client,free
|
||||
WireGuard,mas,1451685025,yes,network,Wireguard client,free
|
||||
@@ -80,9 +77,13 @@ marp-team.marp-vscode,vscode,,no,integration,Support marp(MD based presentation)
|
||||
matt-meyers.vscode-dbml,vscode,,yes,integration,Support DBML,free
|
||||
mechatroner.rainbow-csv,vscode,,yes,format,CSV highlighter,free
|
||||
ms-azuretools.vscode-containers,vscode,,yes,tool,Container tool,free
|
||||
ms-python.black-formatter,vscode,,yes,format,Python formatter,free
|
||||
ms-python.python,vscode,,yes,language,Python integration,free
|
||||
ms-python.debugpy,vscode,,yes,language,Dependency of ms-python.python,free
|
||||
ms-python.vscode-pylance,vscode,,yes,language,Dependency of ms-python.python,free
|
||||
ms-python.vscode-python-envs,vscode,,yes,language,Dependency of ms-python.python,free
|
||||
ms-vscode-remote.remote-ssh,vscode,,yes,tool,SSH conntection,free
|
||||
ms-vscode-remote.remote-ssh-edit,vscode,,yes,tool,Dependency of ms-vscode-remote.remote-ssh,free
|
||||
ms-vscode.remote-explorer,vscode,,yes,tool,Dependency of ms-vscode-remote.remote-ssh,free
|
||||
pkief.material-icon-theme,vscode,,yes,theme,Best icon,free
|
||||
pkief.material-product-icons,vscode,,yes,theme,Best product icon,free
|
||||
pomdtr.excalidraw-editor,vscode,,no,integration,Excalidraw integration,free
|
||||
@@ -92,3 +93,10 @@ svelte.svelte-vscode,vscode,,yes,language,Sevelte integration,free
|
||||
wayou.vscode-todo-highlight,vscode,,yes,tool,Todo file highlighter,free
|
||||
yzhang.markdown-all-in-one,vscode,,yes,language,Markdown highlighter & formatter,free
|
||||
zhuangtongfa.material-theme,vscode,,yes,theme,Best darkmode theme (One Dark Pro),free
|
||||
charliermarsh.ruff,vscode,,yes,format,Python formatter,free
|
||||
droppy,manual,,no,personalization,Notch customization,paid
|
||||
Microsoft word,manual,,no,productivity,Microsoft word,paid
|
||||
Microsoft excel,manual,,no,productivity,Microsoft excel,paid
|
||||
Microsoft powerpoint,manual,,no,productivity,Microsoft powerpoint,paid
|
||||
wget,formula,,yes,utilities,File downloader,free
|
||||
mise,formula,,yes,development,Package version manager,free
|
||||
|
||||
|
+67
-13
@@ -1,3 +1,10 @@
|
||||
import csv
|
||||
import subprocess
|
||||
import shutil
|
||||
import datetime
|
||||
import sys
|
||||
import re
|
||||
|
||||
# ====== Config ======
|
||||
CSV_FILE = './apps.csv'
|
||||
BREWFILE = './Brewfile'
|
||||
@@ -11,14 +18,9 @@ MANUAL_TYPE = 'manual'
|
||||
|
||||
support_types = list(SUPPORT_CONFIG.keys())
|
||||
|
||||
def clear():
|
||||
subprocess.run(['clear'])
|
||||
|
||||
import csv
|
||||
import subprocess
|
||||
import shutil
|
||||
import datetime
|
||||
import sys
|
||||
|
||||
clear = lambda: subprocess.run(['clear'])
|
||||
|
||||
def check_package(name):
|
||||
path = shutil.which(name)
|
||||
@@ -35,6 +37,12 @@ def get_csv():
|
||||
with open(CSV_FILE, 'r', encoding='utf-8-sig') as f:
|
||||
return list(csv.DictReader(f))
|
||||
|
||||
def extract_tap(name):
|
||||
parts = name.split('/')
|
||||
if len(parts) == 3:
|
||||
return f'{parts[0]}/{parts[1]}'
|
||||
return None
|
||||
|
||||
def create_brewfile():
|
||||
try:
|
||||
with open(BREWFILE, 'r') as old:
|
||||
@@ -47,11 +55,15 @@ def create_brewfile():
|
||||
|
||||
raw_list = get_csv()
|
||||
temp = {pkg_type:[] for pkg_type in support_types}
|
||||
taps = set()
|
||||
|
||||
for row in raw_list:
|
||||
pkg_type = row['type']
|
||||
if pkg_type in temp.keys():
|
||||
if row['install_on_setup'] == 'yes':
|
||||
tap = extract_tap(row['name'])
|
||||
if tap:
|
||||
taps.add(tap)
|
||||
content = f'# {row["description"]}\n{SUPPORT_CONFIG[pkg_type]["structure"](row)}\n'
|
||||
temp[pkg_type].append(content)
|
||||
elif pkg_type != MANUAL_TYPE:
|
||||
@@ -59,12 +71,51 @@ def create_brewfile():
|
||||
sys.exit()
|
||||
|
||||
with open(BREWFILE, 'w') as f:
|
||||
if taps:
|
||||
f.write(f'# {"=" * 15} tap {"=" * 15}\n')
|
||||
for tap in sorted(taps):
|
||||
f.write(f'tap "{tap}"\n')
|
||||
f.write('\n')
|
||||
|
||||
for pkg_type in support_types:
|
||||
f.write(f'# {"=" * 15} {pkg_type} {"=" * 15}\n')
|
||||
f.writelines(temp[pkg_type])
|
||||
f.write('\n')
|
||||
|
||||
print('✅ Successfully create Brewfile')
|
||||
print('✅ Successfully created Brewfile')
|
||||
|
||||
def handle_untrusted_taps():
|
||||
taps = set()
|
||||
try:
|
||||
with open(BREWFILE, 'r') as f:
|
||||
for line in f:
|
||||
m = re.fullmatch(r'tap "([^/]+/[^/]+)"', line.strip())
|
||||
if m:
|
||||
taps.add(m.group(1))
|
||||
except FileNotFoundError:
|
||||
print('❌ Unable to find Brewfile (create it first)')
|
||||
return False
|
||||
|
||||
if taps:
|
||||
print('⚠️ These third-party taps are needed')
|
||||
for tap in sorted(taps):
|
||||
print(f' - {tap}')
|
||||
print(' These taps is not official and my execute certain script.\n')
|
||||
if input('Trust these taps? (y/N): ').strip().lower() !='y':
|
||||
print('📢 Operation is canceled as these taps are not allowed.')
|
||||
return False
|
||||
for tap in sorted(taps):
|
||||
try:
|
||||
subprocess.run(['brew', 'tap', tap], check=True)
|
||||
subprocess.run(['brew', 'trust', tap], check=True)
|
||||
print(f'✅ Successfully installed tap "{tap}"')
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f'❌ Failed to install tap "{tap}" ({e.returncode})')
|
||||
return False
|
||||
except FileNotFoundError:
|
||||
print('❌ Unable to find brew')
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_brewfile_types():
|
||||
token_to_type = {SUPPORT_CONFIG[t]['token']: t for t in support_types}
|
||||
@@ -105,6 +156,9 @@ def install_dependencies():
|
||||
return True
|
||||
|
||||
def bundle_install():
|
||||
if not handle_untrusted_taps():
|
||||
return
|
||||
|
||||
if not install_dependencies():
|
||||
print('❌ Aborting install due to missing dependency')
|
||||
return
|
||||
@@ -125,7 +179,7 @@ def bundle_check():
|
||||
['brew', 'bundle', 'check', f'--file={BREWFILE}', '--verbose']
|
||||
)
|
||||
if result.returncode == 0:
|
||||
print('✅ Every packages are installed')
|
||||
print('✅ All packages are installed')
|
||||
return True
|
||||
else:
|
||||
print('⚠️ There are uninstalled package(s)')
|
||||
@@ -139,7 +193,7 @@ def bundle_check():
|
||||
def bundle_cleanup():
|
||||
try:
|
||||
subprocess.run(['brew', 'bundle', 'cleanup', f'--file={BREWFILE}'])
|
||||
if input('⚠️ Are sure want to remove? (y/N): ').strip().lower() == 'y':
|
||||
if input('⚠️ Are sure to remove? (y/N): ').strip().lower() == 'y':
|
||||
subprocess.run(['brew', 'bundle', 'cleanup', f'--file={BREWFILE}', '--force'], check=True)
|
||||
print('✅ Successfully cleanup')
|
||||
else:
|
||||
@@ -171,9 +225,9 @@ def select_option():
|
||||
print()
|
||||
return
|
||||
else:
|
||||
print(f'⚠️ Write valid number\n')
|
||||
except ValueError as e:
|
||||
print(f'⚠️ Write valid number\n')
|
||||
print('⚠️ Write valid number\n')
|
||||
except ValueError:
|
||||
print('⚠️ Write valid number\n')
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user