|
1 | 1 | # ok_computer |
| 2 | +# ok_computer |
2 | 3 |
|
3 | | -Simple repo pour ré-installer plus vite un ordinateur neuf (macOS, Windows, Linux). |
| 4 | +Repository to quickly reconfigure a new computer (macOS, Windows, Linux). |
4 | 5 |
|
5 | | -## Installation rapide |
| 6 | +## Quick Install |
6 | 7 |
|
7 | | -### Via les releases (recommandé) |
| 8 | +### From releases (recommended) |
8 | 9 |
|
9 | | -Télécharger la dernière release : |
| 10 | +Download the latest release and extract: |
10 | 11 | ```bash |
11 | 12 | curl -fsSL -o init-computer.tar.gz \ |
12 | 13 | https://github.com/axgd-code/ok_computer/releases/download/$(curl -s https://api.github.com/repos/axgd-code/ok_computer/releases/latest | grep tag_name | cut -d'"' -f4)/init-mac-scripts.tar.gz |
13 | 14 | tar -xzf init-computer.tar.gz |
14 | | -bash init.sh |
15 | 15 | ``` |
16 | 16 |
|
17 | | -Ou télécharger manuellement depuis [releases](https://github.com/axgd-code/ok_computer/releases), puis : |
| 17 | +Run the installer using the `okc` helper included in the archive: |
| 18 | +```bash |
| 19 | +chmod +x okc |
| 20 | +./okc init |
| 21 | +``` |
| 22 | + |
| 23 | +If you prefer, install `okc` system-wide first and then run: |
18 | 24 | ```bash |
19 | | -tar -xzf init-mac-scripts.tar.gz |
20 | | -bash init.sh |
| 25 | +chmod +x okc install_okc.sh |
| 26 | +./install_okc.sh # or sudo ./install_okc.sh |
| 27 | +okc init |
21 | 28 | ``` |
22 | 29 |
|
23 | | -### Depuis le code source |
| 30 | +### From source |
24 | 31 |
|
25 | | -Cloner et exécuter depuis les sources : |
26 | 32 | ```bash |
27 | 33 | git clone https://github.com/axgd-code/ok_computer.git |
28 | 34 | cd ok_computer |
29 | | -bash src/init.sh |
| 35 | +chmod +x okc install_okc.sh |
| 36 | +./install_okc.sh # optional: install okc into your PATH |
| 37 | +okc init |
30 | 38 | ``` |
31 | 39 |
|
32 | 40 | ## Structure |
33 | 41 |
|
34 | | -- [src](src) : scripts et configuration principale |
35 | | - - [src/init.sh](src/init.sh) : orchestrateur qui détecte l'OS et déclenche l'installation |
36 | | - - [src/init_conf_macOs.sh](src/init_conf_macOs.sh) / [src/init_conf_windows.sh](src/init_conf_windows.sh) : réglages spécifiques macOS ou Windows |
37 | | - - [src/packages.conf](src/packages.conf) : catalogue des packages installés |
38 | | - - [src/app.sh](src/app.sh) : gestionnaire d'applications (ajout/suppression/list) |
39 | | - - [src/dotfiles.sh](src/dotfiles.sh) : gestion et synchro des dotfiles |
40 | | - - [src/wifi_from_kdbx.sh](src/wifi_from_kdbx.sh) : import Wi-Fi depuis KeePassXC |
41 | | - - [src/install_fonts.sh](src/install_fonts.sh), [src/setup_auto_update.sh](src/setup_auto_update.sh), [src/update.sh](src/update.sh) |
42 | | -- [test](test) : vérifications locales |
43 | | - - [test/test.sh](test/test.sh) : `bash -n` + `shellcheck` (si présent) |
44 | | - |
45 | | -## Fichiers du projet |
46 | | - |
47 | | -### 📋 Configuration |
48 | | -- [src/packages.conf](src/packages.conf) : fichier de configuration unifié listant tous les packages à installer pour macOS et Windows |
49 | | - - Format : `TYPE|NOM_MAC|NOM_WINDOWS|DESCRIPTION` |
50 | | - - Les packages s'installent automatiquement lors de l'exécution de [src/init.sh](src/init.sh) |
51 | | - |
52 | | -### 🔧 Scripts d'installation |
53 | | -- [src/init.sh](src/init.sh) : script principal qui détecte le système d'exploitation et lance la configuration appropriée |
54 | | -- [src/init_conf_macOs.sh](src/init_conf_macOs.sh) : configuration spécifique à macOS (préférences système, Dock, Finder, etc.) |
55 | | -- [src/init_conf_windows.sh](src/init_conf_windows.sh) : installation des packages via Chocolatey pour Windows |
56 | | -- [src/install_fonts.sh](src/install_fonts.sh) : installation des polices de caractères (macOS) |
57 | | -- [src/app.sh](src/app.sh) : gestionnaire d'applications simple pour installer/désinstaller des apps et mettre à jour [src/packages.conf](src/packages.conf) |
58 | | -- [src/dotfiles.sh](src/dotfiles.sh) : gestionnaire des dotfiles synchronisés via OneDrive, Synology Drive, etc. |
59 | | -- [src/wifi_from_kdbx.sh](src/wifi_from_kdbx.sh) : import de profils Wi-Fi depuis un vault KeePassXC |
60 | | - |
61 | | -### 🔄 Mise à jour automatique |
62 | | -- [src/update.sh](src/update.sh) : script de mise à jour des packages |
63 | | - - Exécutable manuellement : `bash src/update.sh` |
64 | | - - Met à jour automatiquement tous les packages selon le système : |
65 | | - - macOS : Homebrew, casks |
66 | | - - Windows : Chocolatey |
67 | | - - Linux : apt/dnf/yum |
68 | | - |
69 | | -- [src/setup_auto_update.sh](src/setup_auto_update.sh) : configure la mise à jour automatique quotidienne à 21h00 |
70 | | - - Utilise launchd sur macOS |
71 | | - - Utilise Task Scheduler sur Windows |
72 | | - - Utilise cron sur Linux |
73 | | - - Commande : `bash src/setup_auto_update.sh` |
74 | | - |
75 | | -## Systèmes supportés |
76 | | - |
77 | | -### 🍎 macOS |
78 | | -- Installation via Homebrew |
79 | | -- Configuration automatique des préférences système |
80 | | -- Installation de polices personnalisées |
81 | | -- Mise à jour automatique des packages |
82 | | - |
83 | | -### 🪟 Windows |
84 | | -- Installation via Chocolatey (installation automatique si absent) |
85 | | -- Support de Git Bash, WSL, CYGWIN et MINGW |
86 | | -- Mise à jour automatique via Task Scheduler |
87 | | - |
88 | | -### 🐧 Linux |
89 | | -- Détection automatique du gestionnaire de packages (apt, dnf, yum) |
90 | | -- Mise à jour automatique via cron |
91 | | - |
92 | | -## Packages inclus |
93 | | - |
94 | | -Les packages installés incluent : |
95 | | -- Outils de développement : Git, Node.js, Docker, VS Code, OpenJDK, etc. |
96 | | -- Navigateurs : Firefox, Tor Browser |
97 | | -- Communication : Thunderbird, Signal |
98 | | -- Sécurité : KeePassXC, Cryptomator, VeraCrypt |
99 | | -- Productivité : Notion, Obsidian, Postman, Bruno |
100 | | -- Multimédia : VLC, FFmpeg |
101 | | -- Utilitaires : 7-Zip, TeamViewer, Transmission |
102 | | -- Et bien d'autres... |
103 | | - |
104 | | -## Configuration de la mise à jour automatique |
105 | | - |
106 | | -Pour activer la mise à jour automatique quotidienne à 21h00 : |
| 42 | +- `src/`: main scripts and configuration |
| 43 | + - `src/init.sh`: orchestrator that detects OS and runs setup |
| 44 | + - `src/init_conf_macOs.sh` / `src/init_conf_windows.sh`: platform-specific configuration |
| 45 | + - `src/packages.conf`: list of packages to install |
| 46 | + - `src/app.sh`: simple app manager (add/remove/list) |
| 47 | + - `src/dotfiles.sh`: dotfiles sync manager |
| 48 | + - `src/wifi_from_kdbx.sh`: import Wi‑Fi profiles from KeePassXC |
| 49 | + - `src/update.sh`: update script for packages |
| 50 | + - `src/setup_auto_update.sh`: configure automatic daily updates |
| 51 | +- `test/`: local checks |
| 52 | + |
| 53 | +## Configuration |
| 54 | + |
| 55 | +Copy `.env.example` to `.env.local` and edit to match your paths. |
| 56 | +Typical variables: |
| 57 | +- `SYNC_DIR` — path to your synchronized folder (OneDrive, Synology Drive, Dropbox, ...) |
| 58 | +- `PACKAGES_CONF_DIR` — optional remote folder to store a shared `packages.conf` |
| 59 | +- `OBSIDIAN_VAULT`, `VSCODE_CONFIG` — optional sync targets |
| 60 | + |
| 61 | +Automatic update schedule (optional): |
| 62 | +- `AUTO_UPDATE_HOUR` — hour in 0-23 (default: 21) |
| 63 | +- `AUTO_UPDATE_MINUTE` — minute in 0-59 (default: 0) |
| 64 | + |
| 65 | +Example `.env.local` additions: |
| 66 | +```dotenv |
| 67 | +AUTO_UPDATE_HOUR=21 |
| 68 | +AUTO_UPDATE_MINUTE=0 |
| 69 | +``` |
| 70 | + |
| 71 | +`src/setup_auto_update.sh` reads `.env.local` (one level up) and uses these values to configure: |
| 72 | +- macOS: a `launchd` agent (`$HOME/Library/LaunchAgents/...plist`) |
| 73 | +- Windows: a scheduled task via `schtasks` (uses the provided time) |
| 74 | +- Linux: a cron job (uses the provided minute/hour) |
| 75 | + |
| 76 | +## Commands using `okc` |
| 77 | + |
| 78 | +Use `okc` to run repository scripts without typing `bash src/...`. |
| 79 | + |
| 80 | +Dotfiles examples: |
107 | 81 | ```bash |
108 | | -bash src/setup_auto_update.sh |
| 82 | +okc dotfiles init # initialize sync |
| 83 | +okc dotfiles setup # create symlinks |
| 84 | +okc dotfiles sync # push changes to sync folder |
| 85 | +okc dotfiles restore # restore from sync folder |
| 86 | +okc dotfiles status # show status |
109 | 87 | ``` |
110 | 88 |
|
111 | | -### Commandes de gestion |
| 89 | +App manager examples: |
| 90 | +```bash |
| 91 | +okc app install firefox |
| 92 | +okc app uninstall firefox |
| 93 | +okc app list |
| 94 | +okc app add some-app |
| 95 | +okc app remove some-app |
| 96 | +``` |
112 | 97 |
|
113 | | -**macOS** : |
| 98 | +Automatic updates setup: |
114 | 99 | ```bash |
115 | | -# Désactiver |
116 | | -launchctl unload ~/Library/LaunchAgents/com.user.packages.update.plist |
| 100 | +okc setup_auto_update |
| 101 | +``` |
117 | 102 |
|
118 | | -# Réactiver |
119 | | -launchctl load ~/Library/LaunchAgents/com.user.packages.update.plist |
| 103 | +If you prefer to run the script directly: |
| 104 | +```bash |
| 105 | +bash src/setup_auto_update.sh |
120 | 106 | ``` |
121 | 107 |
|
122 | | -**Windows** : |
123 | | -```cmd |
124 | | -# Désactiver |
125 | | -schtasks //Change //TN "PackagesAutoUpdate" //DISABLE |
| 108 | +## Wi‑Fi import from KeePassXC |
126 | 109 |
|
127 | | -# Réactiver |
128 | | -schtasks //Change //TN "PackagesAutoUpdate" //ENABLE |
| 110 | +Use `okc` or run the script directly: |
| 111 | +```bash |
| 112 | +okc wifi_from_kdbx --db /path/to/vault.kdbx --group "Wi-Fi" |
| 113 | +# or |
| 114 | +bash src/wifi_from_kdbx.sh --db /path/to/vault.kdbx --group "Wi-Fi" |
| 115 | +``` |
| 116 | + |
| 117 | +## Tests |
129 | 118 |
|
130 | | -# Supprimer |
131 | | -schtasks //Delete //TN "PackagesAutoUpdate" //F |
| 119 | +Run local checks: |
| 120 | +```bash |
| 121 | +bash test/test.sh |
132 | 122 | ``` |
133 | 123 |
|
134 | | -**Linux** : |
| 124 | +## okc — quick helper |
| 125 | + |
| 126 | +The `okc` script dispatches to `src/<command>.sh` so you can run tasks like `okc init`, `okc app`, `okc dotfiles`. |
| 127 | + |
| 128 | +Install example (local): |
135 | 129 | ```bash |
136 | | -# Voir les tâches cron |
137 | | -crontab -l |
| 130 | +chmod +x okc |
| 131 | +./okc init |
| 132 | +``` |
138 | 133 |
|
139 | | -# Éditer les tâches cron |
140 | | -crontab -e |
| 134 | +Install example (system): |
| 135 | +```bash |
| 136 | +chmod +x okc install_okc.sh |
| 137 | +sudo ./install_okc.sh |
| 138 | +okc init |
141 | 139 | ``` |
142 | 140 |
|
143 | | -## Logs |
| 141 | +## License |
144 | 142 |
|
145 | | -Les logs de mise à jour sont sauvegardés dans : |
146 | | -- `update.log` : sortie standard |
147 | | -- `update_error.log` : erreurs (macOS uniquement) |
| 143 | +See [LICENSE](LICENSE) |
148 | 144 |
|
149 | | -## Ajouter ou modifier des packages |
| 145 | +Run local checks: |
| 146 | +```bash |
| 147 | +bash test/test.sh |
| 148 | +``` |
150 | 149 |
|
| 150 | +## License |
| 151 | + |
| 152 | +See [LICENSE](LICENSE) |
151 | 153 | ### Configuration personnalisée (recommandé) |
152 | 154 |
|
153 | 155 | Pour avoir votre propre liste de packages synchronisée entre vos machines : |
@@ -456,3 +458,36 @@ GitHub Actions crée la release automatiquement. |
456 | 458 | ## License |
457 | 459 |
|
458 | 460 | Voir le fichier [LICENSE](LICENSE) |
| 461 | + |
| 462 | +## okc — utilitaire rapide |
| 463 | + |
| 464 | +Le script `okc` permet d'appeler rapidement les scripts présents dans `src/` sans préfixer par `bash src/...`. |
| 465 | + |
| 466 | +Exemples : |
| 467 | + |
| 468 | +```bash |
| 469 | +okc init # lance src/init.sh |
| 470 | +okc app install firefox # lance src/app.sh install firefox |
| 471 | +okc dotfiles sync # lance src/dotfiles.sh sync |
| 472 | +okc packages sync # alias géré via src/dotfiles.sh packages |
| 473 | +``` |
| 474 | + |
| 475 | +Installation recommandée (copie/symlink dans votre PATH) : |
| 476 | + |
| 477 | +```bash |
| 478 | +chmod +x okc install_okc.sh |
| 479 | +./install_okc.sh |
| 480 | +# ou (installation système) |
| 481 | +sudo ./install_okc.sh |
| 482 | +``` |
| 483 | + |
| 484 | +Le script `install_okc.sh` installe `okc` dans `/usr/local/bin` si possible, sinon dans `~/.local/bin` et ajoute `~/.local/bin` à `~/.profile` si nécessaire. |
| 485 | + |
| 486 | +Vous pouvez aussi installer manuellement : |
| 487 | + |
| 488 | +```bash |
| 489 | +chmod +x okc |
| 490 | +sudo ln -sf "$PWD/okc" /usr/local/bin/okc |
| 491 | +``` |
| 492 | + |
| 493 | +Après installation, exécutez `okc` depuis n'importe où. |
0 commit comments