machineconfig 5.30__py3-none-any.whl → 5.31__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/scripts/python/croshell_helpers/__init__.py +0 -0
- machineconfig/scripts/python/devops.py +13 -122
- machineconfig/scripts/python/devops_helpers/cli_config.py +43 -0
- machineconfig/scripts/python/devops_helpers/cli_data.py +18 -0
- machineconfig/scripts/python/devops_helpers/cli_nw.py +39 -0
- machineconfig/scripts/python/{repos.py → devops_helpers/cli_repos.py} +43 -7
- machineconfig/scripts/python/devops_helpers/cli_self.py +41 -0
- machineconfig/scripts/python/devops_navigator.py +806 -0
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +1 -1
- machineconfig/scripts/python/helpers_repos/__init__.py +0 -0
- machineconfig/scripts/python/{secure_repo.py → helpers_repos/secure_repo.py} +1 -1
- machineconfig/scripts/python/interactive.py +2 -2
- machineconfig/scripts/python/nw/__init__.py +0 -0
- machineconfig/scripts/python/sessions.py +1 -1
- machineconfig/scripts/python/sessions_helpers/__init__.py +0 -0
- machineconfig/utils/code.py +13 -3
- {machineconfig-5.30.dist-info → machineconfig-5.31.dist-info}/METADATA +2 -1
- {machineconfig-5.30.dist-info → machineconfig-5.31.dist-info}/RECORD +38 -34
- {machineconfig-5.30.dist-info → machineconfig-5.31.dist-info}/entry_points.txt +1 -0
- machineconfig/scripts/python/gh_models.py +0 -104
- machineconfig/scripts/python/snapshot.py +0 -25
- machineconfig/scripts/python/start_terminals.py +0 -121
- machineconfig/scripts/windows/choose_wezterm_theme.ps1 +0 -1
- machineconfig/scripts/windows/wifi_conn.ps1 +0 -2
- /machineconfig/scripts/python/{pomodoro.py → croshell_helpers/pomodoro.py} +0 -0
- /machineconfig/scripts/python/{scheduler.py → croshell_helpers/scheduler.py} +0 -0
- /machineconfig/scripts/python/{start_slidev.py → croshell_helpers/start_slidev.py} +0 -0
- /machineconfig/scripts/python/{viewer.py → croshell_helpers/viewer.py} +0 -0
- /machineconfig/scripts/python/{viewer_template.py → croshell_helpers/viewer_template.py} +0 -0
- /machineconfig/scripts/{windows/select_pwsh_theme.ps1 → python/devops_helpers/choose_pwsh_theme.ps1} +0 -0
- /machineconfig/scripts/python/{choose_wezterm_theme.py → devops_helpers/choose_wezterm_theme.py} +0 -0
- /machineconfig/scripts/python/{dotfile.py → devops_helpers/cli_config_dotfile.py} +0 -0
- /machineconfig/scripts/python/{share_terminal.py → devops_helpers/cli_terminal.py} +0 -0
- /machineconfig/scripts/python/{cloud_repo_sync.py → helpers_repos/cloud_repo_sync.py} +0 -0
- /machineconfig/scripts/python/{mount_nfs.py → nw/mount_nfs.py} +0 -0
- /machineconfig/scripts/python/{mount_nw_drive.py → nw/mount_nw_drive.py} +0 -0
- /machineconfig/scripts/python/{mount_ssh.py → nw/mount_ssh.py} +0 -0
- /machineconfig/scripts/python/{onetimeshare.py → nw/onetimeshare.py} +0 -0
- /machineconfig/scripts/python/{wifi_conn.py → nw/wifi_conn.py} +0 -0
- /machineconfig/scripts/python/{wsl_windows_transfer.py → nw/wsl_windows_transfer.py} +0 -0
- /machineconfig/scripts/python/{sessions_multiprocess.py → sessions_helpers/sessions_multiprocess.py} +0 -0
- {machineconfig-5.30.dist-info → machineconfig-5.31.dist-info}/WHEEL +0 -0
- {machineconfig-5.30.dist-info → machineconfig-5.31.dist-info}/top_level.txt +0 -0
|
@@ -80,7 +80,7 @@ def check_dotfiles_version_is_beyond(commit_dtm: str, update: bool) -> bool:
|
|
|
80
80
|
if res is False and update is True:
|
|
81
81
|
console = Console()
|
|
82
82
|
console.print(Panel(f"🔄 UPDATE REQUIRED | Updating dotfiles because {dtm} < {datetime.fromisoformat(commit_dtm)}", border_style="bold blue", expand=False))
|
|
83
|
-
from machineconfig.scripts.python.cloud_repo_sync import main
|
|
83
|
+
from machineconfig.scripts.python.helpers_repos.cloud_repo_sync import main
|
|
84
84
|
|
|
85
85
|
main(cloud=None, repo=dotfiles_path)
|
|
86
86
|
return res
|
|
File without changes
|
|
@@ -11,5 +11,5 @@ def main(
|
|
|
11
11
|
on_conflict: Literal["ask", "pushLocalMerge", "overwriteLocal", "InspectRepos", "RemoveLocalRclone"] = typer.Option("ask", "--on-conflict", "-oc", help="Action to take on merge conflict. Default is 'ask'."),
|
|
12
12
|
pwd: Optional[str] = typer.Option(None, "--password", help="Password for encryption/decryption of the remote repository."),
|
|
13
13
|
):
|
|
14
|
-
from machineconfig.scripts.python.cloud_repo_sync import main as program_content
|
|
14
|
+
from machineconfig.scripts.python.helpers_repos.cloud_repo_sync import main as program_content
|
|
15
15
|
program_content(cloud=cloud, repo=repo, message=message, on_conflict=on_conflict, pwd=pwd)
|
|
@@ -157,8 +157,8 @@ Set-Service -Name sshd -StartupType 'Automatic'"""
|
|
|
157
157
|
|
|
158
158
|
if "retrieve_repositories" in selected_options:
|
|
159
159
|
console.print(Panel("📚 [bold bright_magenta]REPOSITORIES[/bold bright_magenta]\n[italic]Project code retrieval[/italic]", border_style="bright_magenta"))
|
|
160
|
-
from machineconfig.scripts.python import
|
|
161
|
-
|
|
160
|
+
from machineconfig.scripts.python.devops_helpers import cli_repos
|
|
161
|
+
cli_repos.clone(directory=str(Path.home() / "code"), cloud="odg1")
|
|
162
162
|
|
|
163
163
|
if "retrieve_data" in selected_options:
|
|
164
164
|
console.print(Panel("💾 [bold bright_cyan]DATA RETRIEVAL[/bold bright_cyan]\n[italic]Backup restoration[/italic]", border_style="bright_cyan"))
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
from typing import Optional, Literal
|
|
4
4
|
import typer
|
|
5
|
-
from machineconfig.scripts.python.sessions_multiprocess import create_from_function
|
|
5
|
+
from machineconfig.scripts.python.sessions_helpers.sessions_multiprocess import create_from_function
|
|
6
6
|
|
|
7
7
|
def balance_load(layout_path: Path = typer.Argument(..., help="Path to the layout.json file"),
|
|
8
8
|
max_thresh: int = typer.Option(..., help="Maximum tabs per layout"),
|
|
File without changes
|
machineconfig/utils/code.py
CHANGED
|
@@ -116,12 +116,22 @@ def run_shell_script(script: str, display_script: bool = True):
|
|
|
116
116
|
|
|
117
117
|
if platform.system() == "Windows":
|
|
118
118
|
import subprocess
|
|
119
|
-
subprocess.run(f'powershell -ExecutionPolicy Bypass -File "{temp_script_path}"', check=True, shell=True)
|
|
119
|
+
proc = subprocess.run(f'powershell -ExecutionPolicy Bypass -File "{temp_script_path}"', check=True, shell=True)
|
|
120
120
|
elif platform.system() == "Linux" or platform.system() == "Darwin":
|
|
121
121
|
import subprocess
|
|
122
|
-
subprocess.run(f"bash {str(temp_script_path)}", check=True, shell=True)
|
|
123
|
-
|
|
122
|
+
proc = subprocess.run(f"bash {str(temp_script_path)}", check=True, shell=True)
|
|
123
|
+
else:
|
|
124
|
+
raise NotImplementedError(f"Platform {platform.system()} not supported.")
|
|
125
|
+
# console.print(f"✅ [green]Script executed successfully:[/green] [blue]{temp_script_path}[/blue]")
|
|
126
|
+
if proc.returncode != 0:
|
|
127
|
+
console.print(f"❌ [red]Script execution failed with return code {proc.returncode}:[/red] [blue]{temp_script_path}[/blue]")
|
|
128
|
+
elif proc.returncode == 0:
|
|
129
|
+
console.print(f"✅ [green]Script executed successfully:[/green] [blue]{temp_script_path}[/blue]")
|
|
130
|
+
else:
|
|
131
|
+
console.print(f"⚠️ [yellow]Script executed with warnings (return code {proc.returncode}):[/yellow] [blue]{temp_script_path}[/blue]")
|
|
124
132
|
temp_script_path.unlink(missing_ok=True)
|
|
133
|
+
console.print(f"🗑️ [blue]Temporary script deleted:[/blue] [green]{temp_script_path}[/green]")
|
|
134
|
+
|
|
125
135
|
|
|
126
136
|
# def run_command(command: str, description: str) -> bool:
|
|
127
137
|
# """Execute a shell command and return success status."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: machineconfig
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.31
|
|
4
4
|
Summary: Dotfiles management package
|
|
5
5
|
Author-email: Alex Al-Saffar <programmer@usa.com>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -27,6 +27,7 @@ Requires-Dist: pyjson5>=1.6.9
|
|
|
27
27
|
Requires-Dist: typer-slim>=0.19.2
|
|
28
28
|
Requires-Dist: questionary>=2.1.1
|
|
29
29
|
Requires-Dist: typer>=0.19.2
|
|
30
|
+
Requires-Dist: textual>=6.1.0
|
|
30
31
|
Provides-Extra: windows
|
|
31
32
|
Requires-Dist: pywin32; extra == "windows"
|
|
32
33
|
Provides-Extra: docs
|
|
@@ -139,36 +139,16 @@ machineconfig/scripts/linux/wifi_conn,sha256=X4TH3OvcVZfOveSbF9WW8uXb4U_G7ZSnCER
|
|
|
139
139
|
machineconfig/scripts/linux/z_ls,sha256=ATZtu0ccN3AKvAOxkwLq1xgQjJ3en5byEWJ3Q8afnNg,3340
|
|
140
140
|
machineconfig/scripts/python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
141
141
|
machineconfig/scripts/python/agents.py,sha256=OgxGnsmhkPU3n-GsNUJeECWQ01_RP3OHppaSglc3Yf8,9931
|
|
142
|
-
machineconfig/scripts/python/choose_wezterm_theme.py,sha256=pRXAGe2IpysYshsaF8CKEwHI8EGPtLcM8PtiAqM7vmM,3425
|
|
143
142
|
machineconfig/scripts/python/cloud_copy.py,sha256=fcWbSo2nGiubtMYjGci8s5tVjZ9D-u8mteCawZmbw3I,8379
|
|
144
143
|
machineconfig/scripts/python/cloud_mount.py,sha256=GwcXbd5ohoHGESfX5edtCEl2-umDDxH_AZapmFSzc9E,6740
|
|
145
|
-
machineconfig/scripts/python/cloud_repo_sync.py,sha256=7CAJDZold4vg3nDLVC_1HAiDa9mgwHH6GbTSOnc5oMs,9064
|
|
146
144
|
machineconfig/scripts/python/cloud_sync.py,sha256=RWGpAfJ9fnN18yNBSgN44dzA38Hmd4879JL5r2pcyrM,3514
|
|
147
145
|
machineconfig/scripts/python/croshell.py,sha256=LgmwB17EVgNgRkXgwLOZPQWrHqSYDo7Kd-d6vkqA3PY,6459
|
|
148
|
-
machineconfig/scripts/python/devops.py,sha256=
|
|
149
|
-
machineconfig/scripts/python/
|
|
146
|
+
machineconfig/scripts/python/devops.py,sha256=3mG-4RlF9vzcfXO7ISsxwRICQpJRR8JMqxtxKLE70fs,1822
|
|
147
|
+
machineconfig/scripts/python/devops_navigator.py,sha256=iR6HAYt0TA7efV_g6Lr9gPczN6mqvS0V5hShD1x-9R8,29537
|
|
150
148
|
machineconfig/scripts/python/fire_jobs.py,sha256=iHcuADhRFlN2wgr7zUV1RAacfUPnnvvOGbEDzFM61gs,13476
|
|
151
149
|
machineconfig/scripts/python/ftpx.py,sha256=QfQTp-6jQP6yxfbLc5sKxiMtTgAgc8sjN7d17_uLiZc,9400
|
|
152
|
-
machineconfig/scripts/python/
|
|
153
|
-
machineconfig/scripts/python/
|
|
154
|
-
machineconfig/scripts/python/mount_nfs.py,sha256=aECrL64j9g-9rF49sVJAjGmzaoGgcMnl3g9v17kQF4c,3239
|
|
155
|
-
machineconfig/scripts/python/mount_nw_drive.py,sha256=iru6AtnTyvyuk6WxlK5R4lDkuliVpPV5_uBTVVhXtjQ,1550
|
|
156
|
-
machineconfig/scripts/python/mount_ssh.py,sha256=k2fKq3f5dKq_7anrFOlqvJoI_3U4EWNHLRZ1o3Lsy6M,2268
|
|
157
|
-
machineconfig/scripts/python/onetimeshare.py,sha256=xRd8by6qUm-od2Umty2MYsXyJwzXw-CBTd7VellNaKY,2498
|
|
158
|
-
machineconfig/scripts/python/pomodoro.py,sha256=SPkfeoZGv8rylGiOyzQ7UK3aXZ3G2FIOuGkSuBUggOI,2019
|
|
159
|
-
machineconfig/scripts/python/repos.py,sha256=EytbeRBJf692KAtjrYdZKRCPrseNyIkH_kVe22WI-As,8218
|
|
160
|
-
machineconfig/scripts/python/scheduler.py,sha256=rKhssuxkD697EY6qaV6CSdNhxpAQLDWO4fE8GMCQ9FA,3061
|
|
161
|
-
machineconfig/scripts/python/secure_repo.py,sha256=xwV3mHg918EmVjUH-gJuZFnzIoBhOnJspx4_ZxNhurk,979
|
|
162
|
-
machineconfig/scripts/python/sessions.py,sha256=oCNGhhAYxr5DFyGCkL7jup3hPb4qCdBome2Qr9Evwao,8694
|
|
163
|
-
machineconfig/scripts/python/sessions_multiprocess.py,sha256=jtFci9vugJ8sMiw3qupUtANICy2RSorT2W8sdppkRN4,2914
|
|
164
|
-
machineconfig/scripts/python/share_terminal.py,sha256=-SNCDrQHBDUZw2cNNrEw3K3owzmZASBjd5deBKB49YY,5358
|
|
165
|
-
machineconfig/scripts/python/snapshot.py,sha256=aDvKeoniZaeTSNv9zWBUajaj2yagAxVdfuvO1_tgq5Y,1026
|
|
166
|
-
machineconfig/scripts/python/start_slidev.py,sha256=FAJ1_WkAQ7KcbRZ3cSN_72NDgV_flRrwxmXv1imyulI,4897
|
|
167
|
-
machineconfig/scripts/python/start_terminals.py,sha256=DRWbMZumhPmL0DvvsCsbRNFL5AVQn1SgaziafTio3YQ,6149
|
|
168
|
-
machineconfig/scripts/python/viewer.py,sha256=heQNjB9fwn3xxbPgMofhv1Lp6Vtkl76YjjexWWBM0pM,2041
|
|
169
|
-
machineconfig/scripts/python/viewer_template.py,sha256=ve3Q1-iKhCLc0VJijKvAeOYp2xaFOeIOC_XW956GWCc,3944
|
|
170
|
-
machineconfig/scripts/python/wifi_conn.py,sha256=4GdLhgma9GRmZ6OFg3oxOX-qY3sr45njPckozlpM_A0,15566
|
|
171
|
-
machineconfig/scripts/python/wsl_windows_transfer.py,sha256=534zlYe3Xsr0mqegAnZrVru8Fif-9jZyQK38Q90AtDo,3389
|
|
150
|
+
machineconfig/scripts/python/interactive.py,sha256=Rd406f3WpdTzDv7-dY1xbB90YHBk-EUBpsViX3QDGZM,11773
|
|
151
|
+
machineconfig/scripts/python/sessions.py,sha256=03WhAVvOA5ZuvXegA8OZ8UATnriCmIoYB8iB9D3GTYY,8711
|
|
172
152
|
machineconfig/scripts/python/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
173
153
|
machineconfig/scripts/python/ai/generate_files.py,sha256=Vfjgd0skJu-WTgqUxmOVFzaNMfSFBaFmY5oGGVY7MZY,2860
|
|
174
154
|
machineconfig/scripts/python/ai/initai.py,sha256=FJriMm1-x44xx6yEnqgI-F5lfRw44xleOluv4TcRs0I,2237
|
|
@@ -196,7 +176,22 @@ machineconfig/scripts/python/ai/solutions/gemini/settings.json,sha256=tFdtqZkyti
|
|
|
196
176
|
machineconfig/scripts/python/ai/solutions/kilocode/privacy.md,sha256=oKOXnfFOdUuMlKwVf5MqeqCc24hZcjKE_e1MEXpijJI,117
|
|
197
177
|
machineconfig/scripts/python/ai/solutions/opencode/opencode.json,sha256=nahHKRw1dNzkUCS_vCX_fy2TisRtfg8DXH-D4N1iUVU,99
|
|
198
178
|
machineconfig/scripts/python/ai/solutions/opencode/opencode.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
179
|
+
machineconfig/scripts/python/croshell_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
180
|
+
machineconfig/scripts/python/croshell_helpers/pomodoro.py,sha256=SPkfeoZGv8rylGiOyzQ7UK3aXZ3G2FIOuGkSuBUggOI,2019
|
|
181
|
+
machineconfig/scripts/python/croshell_helpers/scheduler.py,sha256=rKhssuxkD697EY6qaV6CSdNhxpAQLDWO4fE8GMCQ9FA,3061
|
|
182
|
+
machineconfig/scripts/python/croshell_helpers/start_slidev.py,sha256=FAJ1_WkAQ7KcbRZ3cSN_72NDgV_flRrwxmXv1imyulI,4897
|
|
183
|
+
machineconfig/scripts/python/croshell_helpers/viewer.py,sha256=heQNjB9fwn3xxbPgMofhv1Lp6Vtkl76YjjexWWBM0pM,2041
|
|
184
|
+
machineconfig/scripts/python/croshell_helpers/viewer_template.py,sha256=ve3Q1-iKhCLc0VJijKvAeOYp2xaFOeIOC_XW956GWCc,3944
|
|
199
185
|
machineconfig/scripts/python/devops_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
186
|
+
machineconfig/scripts/python/devops_helpers/choose_pwsh_theme.ps1,sha256=bl27f8XAeLrm6WggorGmPR5uhsNwj5ayWsxus4UrKI8,1843
|
|
187
|
+
machineconfig/scripts/python/devops_helpers/choose_wezterm_theme.py,sha256=pRXAGe2IpysYshsaF8CKEwHI8EGPtLcM8PtiAqM7vmM,3425
|
|
188
|
+
machineconfig/scripts/python/devops_helpers/cli_config.py,sha256=LObo-YBjpfCB0_0CYQlYBqTtApM1RUOE_H28gEcH7PY,2870
|
|
189
|
+
machineconfig/scripts/python/devops_helpers/cli_config_dotfile.py,sha256=9W9i8Qbs6i2NfTq0knywB3StvE_sHaZYZ0RslTyoVz8,2734
|
|
190
|
+
machineconfig/scripts/python/devops_helpers/cli_data.py,sha256=f_2espL92n6SoNb5sFVMvrK7LA29HzfrFAKhxKaud1M,510
|
|
191
|
+
machineconfig/scripts/python/devops_helpers/cli_nw.py,sha256=J3_ugdGrEhuL-4sEOTHrlZR4WYvQOYR9ALXNjxBWIlA,1397
|
|
192
|
+
machineconfig/scripts/python/devops_helpers/cli_repos.py,sha256=eFWyVxzy0YdutJpE2fdQu_Z1WCAumy6dTP4xstSTSg4,9712
|
|
193
|
+
machineconfig/scripts/python/devops_helpers/cli_self.py,sha256=XGWPZVZmwKaDOY_5IYj2l_Ke0ocjhfXP9NK5-nFwFSg,1467
|
|
194
|
+
machineconfig/scripts/python/devops_helpers/cli_terminal.py,sha256=-SNCDrQHBDUZw2cNNrEw3K3owzmZASBjd5deBKB49YY,5358
|
|
200
195
|
machineconfig/scripts/python/devops_helpers/devops_add_identity.py,sha256=wvjNgqsLmqD2SxbNCW_usqfp0LI-TDvcJJKGOWt2oFw,3775
|
|
201
196
|
machineconfig/scripts/python/devops_helpers/devops_add_ssh_key.py,sha256=BXB-9RvuSZO0YTbnM2azeABW2ngLW4SKhhAGAieMzfw,6873
|
|
202
197
|
machineconfig/scripts/python/devops_helpers/devops_backup_retrieve.py,sha256=JLJHmi8JmZ_qVTeMW-qBEAYGt1fmfWXzZ7Gm-Q-GDcU,5585
|
|
@@ -207,7 +202,7 @@ machineconfig/scripts/python/helpers/cloud_helpers.py,sha256=GA-bxXouUmknk9fyQAs
|
|
|
207
202
|
machineconfig/scripts/python/helpers/helpers2.py,sha256=2QeQ2aii6hVc4S-oi3SVTSyPxKPTDUWBD7GnkCEr7Qs,7304
|
|
208
203
|
machineconfig/scripts/python/helpers/helpers4.py,sha256=iKR5vVJygaDIpFXhcdma9jOpyxKtUhmqcmalFxJmY0w,4749
|
|
209
204
|
machineconfig/scripts/python/helpers/helpers5.py,sha256=dPBvA9Tcyx9TMgM6On49A1CueGMhBdRzikDnlJGf3J0,1123
|
|
210
|
-
machineconfig/scripts/python/helpers/repo_sync_helpers.py,sha256=
|
|
205
|
+
machineconfig/scripts/python/helpers/repo_sync_helpers.py,sha256=Fp7C5iz6kYpul0zzu63NyQtozFQuuDrArHcxPAk1J38,3945
|
|
211
206
|
machineconfig/scripts/python/helpers_fire/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
212
207
|
machineconfig/scripts/python/helpers_fire/fire_agents_help_launch.py,sha256=wQb4RotkDgRrSB2pvJSVx_W4uLgtWNnm0f3CIjLp9SA,5500
|
|
213
208
|
machineconfig/scripts/python/helpers_fire/fire_agents_help_search.py,sha256=qIfSS_su2YJ1Gb0_lu4cbjlJlYMBw0v52NTGiSrGjk8,2991
|
|
@@ -226,7 +221,17 @@ machineconfig/scripts/python/helpers_fire_command/cloud_manager.py,sha256=YN0DYL
|
|
|
226
221
|
machineconfig/scripts/python/helpers_fire_command/fire_jobs_args_helper.py,sha256=UUrGB2N_pR7PxFKtKTJxIUiS58WjQX0U50y2ft8Ul4w,4334
|
|
227
222
|
machineconfig/scripts/python/helpers_fire_command/fire_jobs_route_helper.py,sha256=9zGuh_bMkQgfMS0nnFoa2oIWdmLAkSNtlEH4H-FprmM,5373
|
|
228
223
|
machineconfig/scripts/python/helpers_fire_command/fire_jobs_streamlit_helper.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
224
|
+
machineconfig/scripts/python/helpers_repos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
225
|
+
machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py,sha256=7CAJDZold4vg3nDLVC_1HAiDa9mgwHH6GbTSOnc5oMs,9064
|
|
229
226
|
machineconfig/scripts/python/helpers_repos/grource.py,sha256=IywQ1NDPcLXM5Tr9xhmq4tHfYspLRs3pF20LP2TlgIQ,14595
|
|
227
|
+
machineconfig/scripts/python/helpers_repos/secure_repo.py,sha256=G_quiKOLNkWD5UG8ekexgh9xbpW4Od-J1pLJbLLWnpg,993
|
|
228
|
+
machineconfig/scripts/python/nw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
229
|
+
machineconfig/scripts/python/nw/mount_nfs.py,sha256=aECrL64j9g-9rF49sVJAjGmzaoGgcMnl3g9v17kQF4c,3239
|
|
230
|
+
machineconfig/scripts/python/nw/mount_nw_drive.py,sha256=iru6AtnTyvyuk6WxlK5R4lDkuliVpPV5_uBTVVhXtjQ,1550
|
|
231
|
+
machineconfig/scripts/python/nw/mount_ssh.py,sha256=k2fKq3f5dKq_7anrFOlqvJoI_3U4EWNHLRZ1o3Lsy6M,2268
|
|
232
|
+
machineconfig/scripts/python/nw/onetimeshare.py,sha256=xRd8by6qUm-od2Umty2MYsXyJwzXw-CBTd7VellNaKY,2498
|
|
233
|
+
machineconfig/scripts/python/nw/wifi_conn.py,sha256=4GdLhgma9GRmZ6OFg3oxOX-qY3sr45njPckozlpM_A0,15566
|
|
234
|
+
machineconfig/scripts/python/nw/wsl_windows_transfer.py,sha256=534zlYe3Xsr0mqegAnZrVru8Fif-9jZyQK38Q90AtDo,3389
|
|
230
235
|
machineconfig/scripts/python/repos_helpers/count_lines.py,sha256=ZLEajCLmlFFY969BehabqGOB9_kkpATO3Lt09L7KULk,15968
|
|
231
236
|
machineconfig/scripts/python/repos_helpers/count_lines_frontend.py,sha256=jOlMCcVgE2a-NhdUtzNK1wKMf-VGldwGHR6QA1tnFa8,559
|
|
232
237
|
machineconfig/scripts/python/repos_helpers/repos_helper.py,sha256=aP-Cy0V-4fj2dDHGdI72vPkBj33neOK_GvBgMD43dKg,2853
|
|
@@ -234,8 +239,9 @@ machineconfig/scripts/python/repos_helpers/repos_helper_action.py,sha256=byWcGh_
|
|
|
234
239
|
machineconfig/scripts/python/repos_helpers/repos_helper_clone.py,sha256=9vGb9NCXT0lkerPzOJjmFfhU8LSzE-_1LDvjkhgnal0,5461
|
|
235
240
|
machineconfig/scripts/python/repos_helpers/repos_helper_record.py,sha256=dtnnInQPn00u1cyr0oOgJ_jB12O3bSiNctwzC3W7_3w,10994
|
|
236
241
|
machineconfig/scripts/python/repos_helpers/repos_helper_update.py,sha256=AYyKIB7eQ48yoYmFjydIhRI1lV39TBv_S4_LCa-oKuQ,11042
|
|
242
|
+
machineconfig/scripts/python/sessions_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
243
|
+
machineconfig/scripts/python/sessions_helpers/sessions_multiprocess.py,sha256=jtFci9vugJ8sMiw3qupUtANICy2RSorT2W8sdppkRN4,2914
|
|
237
244
|
machineconfig/scripts/windows/agents.ps1,sha256=DqdrC_Xc2rwQ6kGzT0xh5CJz4B_0p5ZwB7s8XE6rPCM,77
|
|
238
|
-
machineconfig/scripts/windows/choose_wezterm_theme.ps1,sha256=LiXJ0a4LKjb6E-oH_bAg6DjegV4SqDUdiMp_svGCFlI,95
|
|
239
245
|
machineconfig/scripts/windows/cloud_copy.ps1,sha256=llTFhN2uInZTcoZYZuuhJcf5Ifo5MF226I5MpOzvc3A,82
|
|
240
246
|
machineconfig/scripts/windows/cloud_mount.ps1,sha256=wSQO5II8DbqktexRIuI-RUn8kVCEk-SWT7imZqd7Qdk,82
|
|
241
247
|
machineconfig/scripts/windows/cloud_sync.ps1,sha256=YrltSWkEKBoG7LMaB-gmot7IswRJEyhDH3fJ2Rlez6c,82
|
|
@@ -258,7 +264,6 @@ machineconfig/scripts/windows/nano.ps1,sha256=H1PNN1x3UnOCGwijgMij-K2ZM2E20sfsLT
|
|
|
258
264
|
machineconfig/scripts/windows/pomodoro.ps1,sha256=9r61cwRy4M2_1A-NFb0fxUuUONxXBLJmLYtY3apkyQA,80
|
|
259
265
|
machineconfig/scripts/windows/reload_path.ps1,sha256=81hQY18LFApVZWFiUfgMzzPH2pJ1WD1fHInfmicBZFA,217
|
|
260
266
|
machineconfig/scripts/windows/scheduler.ps1,sha256=YfOlBxCkPfeQPeyCiNw0g3kIpdbjjf6daLEWuyHSaXY,81
|
|
261
|
-
machineconfig/scripts/windows/select_pwsh_theme.ps1,sha256=bl27f8XAeLrm6WggorGmPR5uhsNwj5ayWsxus4UrKI8,1843
|
|
262
267
|
machineconfig/scripts/windows/sessions.ps1,sha256=cQdgSS3rVWvhthsUi5lyFI05_GKiRGI-j4FB1SZNKpM,80
|
|
263
268
|
machineconfig/scripts/windows/share_cloud.cmd,sha256=exD7JCdxw2LqVjw2MKCYHbVZlEqmelXtwnATng-dhJ4,1028
|
|
264
269
|
machineconfig/scripts/windows/share_nfs.ps1,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -267,7 +272,6 @@ machineconfig/scripts/windows/snapshot.ps1,sha256=dSHwz8LRTe446lU9BkjiugBMWRS384
|
|
|
267
272
|
machineconfig/scripts/windows/start_slidev.ps1,sha256=jow4mcguhuCFiUaOkHYUpq9EFKkgs5fp8G2rVMyVcR4,83
|
|
268
273
|
machineconfig/scripts/windows/start_terminals.ps1,sha256=qoQNkv8waF2ZvfIIuUt8ZXdr2v2It2MPuzQj2ZQ5ToI,87
|
|
269
274
|
machineconfig/scripts/windows/unlock_bitlocker.ps1,sha256=Wv-SLscdckV-1mG3p82VXKPY9zW3hgkRmcLUXIZ1daE,253
|
|
270
|
-
machineconfig/scripts/windows/wifi_conn.ps1,sha256=M4D8gT4Ae0nG6zdhHTkmaF_Wu_w1IRvmltV4qpC6Bqw,82
|
|
271
275
|
machineconfig/scripts/windows/wsl_rdp_windows_port_forwarding.ps1,sha256=dGKAoP8WsQzHiAZjD8WT1Ne8RRQU8xf9HdH9bDkihh4,1720
|
|
272
276
|
machineconfig/scripts/windows/wsl_ssh_windows_port_forwarding.ps1,sha256=dr6t49UCnMHAhA0AR4gHluN0HvS5wzyygCNmjORfknU,2715
|
|
273
277
|
machineconfig/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -399,7 +403,7 @@ machineconfig/setup_windows/wt_and_pwsh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
|
|
|
399
403
|
machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py,sha256=ogxJnwpdcpH7N6dFJu95UCNoGYirZKQho_3X0F_hmXs,6791
|
|
400
404
|
machineconfig/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
401
405
|
machineconfig/utils/accessories.py,sha256=W_9dLzjwNTW5JQk_pe3B2ijQ1nA2-8Kdg2r7VBtzgQs,4340
|
|
402
|
-
machineconfig/utils/code.py,sha256=
|
|
406
|
+
machineconfig/utils/code.py,sha256=0dwPUAGQTaGfPtqlNnsKYkCC6D8ntCVXo2XIr-7MzOI,6409
|
|
403
407
|
machineconfig/utils/installer.py,sha256=ZnhW_gRmGlq5uXwzNvIn-x1vXuOJxkzVqjNu188f37s,10465
|
|
404
408
|
machineconfig/utils/io.py,sha256=3axJBhNZCZiWJbzBvF7keDjCmqnbSKtoTnyDtq1I5BE,2871
|
|
405
409
|
machineconfig/utils/links.py,sha256=GQExBsMoxewOhwIrNdERuzk9HVKcmWgNUGO-RzPMS6M,22588
|
|
@@ -434,8 +438,8 @@ machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=Xbi59rU35AzR
|
|
|
434
438
|
machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoSpdmTIdgS9LS-RvE-QZ-D260tD3o,1214
|
|
435
439
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
|
|
436
440
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
437
|
-
machineconfig-5.
|
|
438
|
-
machineconfig-5.
|
|
439
|
-
machineconfig-5.
|
|
440
|
-
machineconfig-5.
|
|
441
|
-
machineconfig-5.
|
|
441
|
+
machineconfig-5.31.dist-info/METADATA,sha256=m6XsqS0EKt06UBZ8re8-fVkkF3IoWSjYS4qSj2RQdH4,2525
|
|
442
|
+
machineconfig-5.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
443
|
+
machineconfig-5.31.dist-info/entry_points.txt,sha256=HprziWQM36Ra08mjGDqDsGB1q5krpRSNUG7V7M2EJxg,1074
|
|
444
|
+
machineconfig-5.31.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
445
|
+
machineconfig-5.31.dist-info/RECORD,,
|
|
@@ -4,6 +4,7 @@ choose_wezterm_theme = machineconfig.scripts.python.choose_wezterm_theme:main
|
|
|
4
4
|
cloud_copy = machineconfig.scripts.python.cloud_copy:arg_parser
|
|
5
5
|
cloud_mount = machineconfig.scripts.python.cloud_mount:arg_parser
|
|
6
6
|
cloud_sync = machineconfig.scripts.python.cloud_sync:arg_parser
|
|
7
|
+
commands = machineconfig.scripts.python.command_navigator:main_from_parser
|
|
7
8
|
croshell = machineconfig.scripts.python.croshell:arg_parser
|
|
8
9
|
devops = machineconfig.scripts.python.devops:app
|
|
9
10
|
fire = machineconfig.scripts.python.fire_jobs:main_from_parser
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# # as per https://github.com/marketplace/models/azure-openai/o1-preview
|
|
2
|
-
# from openai import OpenAI
|
|
3
|
-
# from machineconfig.utils.path_reduced import P as PathExtended
|
|
4
|
-
# from machineconfig.utils.utils2 import read_ini
|
|
5
|
-
# from rich import print as rprint
|
|
6
|
-
# from rich.panel import Panel
|
|
7
|
-
# from typing import Any
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# gh_token = read_ini(PathExtended.home().joinpath("dotfiles/creds/git/git_host_tokens.ini"))['thisismygitrepo']['newLongterm']
|
|
11
|
-
# endpoint = "https://models.inference.ai.azure.com"
|
|
12
|
-
# model_name_preferences = ["o3-mini", "o1-preview", "o1-mini", "GPT-4o", "GPT-4-o-mini"]
|
|
13
|
-
# client__ = OpenAI(
|
|
14
|
-
# base_url=endpoint,
|
|
15
|
-
# api_key=gh_token,
|
|
16
|
-
# )
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# def get_response(client: Any, model_name: str, messages: list[dict[str, str]]):
|
|
20
|
-
# print(f"""
|
|
21
|
-
# ┌────────────────────────────────────────────────────────────────
|
|
22
|
-
# │ 🤖 Querying Model: {model_name}
|
|
23
|
-
# │ Sending request to API...
|
|
24
|
-
# └────────────────────────────────────────────────────────────────""")
|
|
25
|
-
# try:
|
|
26
|
-
# response = client.chat.completions.create(
|
|
27
|
-
# messages=messages,
|
|
28
|
-
# model=model_name
|
|
29
|
-
# )
|
|
30
|
-
# return response.choices
|
|
31
|
-
# except Exception as e:
|
|
32
|
-
# print(f"""
|
|
33
|
-
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
34
|
-
# ┃ ❌ API Error with model {model_name}
|
|
35
|
-
# ┃ {str(e)}
|
|
36
|
-
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━""")
|
|
37
|
-
# return None
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
# def interactive_chat():
|
|
41
|
-
# conversation_history = []
|
|
42
|
-
# model_index = 0
|
|
43
|
-
# model_name = model_name_preferences[model_index]
|
|
44
|
-
|
|
45
|
-
# print("""
|
|
46
|
-
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
47
|
-
# ┃ 🚀 Interactive Chat Started
|
|
48
|
-
# ┃ Type your message and press Enter to chat
|
|
49
|
-
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━""")
|
|
50
|
-
|
|
51
|
-
# while True:
|
|
52
|
-
# header = f" 🤖 Using Model: {model_name} "
|
|
53
|
-
# print(f"\n{header.center(80, '═')}\n")
|
|
54
|
-
|
|
55
|
-
# while True:
|
|
56
|
-
# try:
|
|
57
|
-
# user_input = input("💬 You: ")
|
|
58
|
-
# conversation_history.append({"role": "user", "content": user_input})
|
|
59
|
-
|
|
60
|
-
# while True:
|
|
61
|
-
# choices = get_response(client__, model_name, conversation_history)
|
|
62
|
-
# if choices is None:
|
|
63
|
-
# model_index += 1
|
|
64
|
-
# model_name = model_name_preferences[model_index % len(model_name_preferences)]
|
|
65
|
-
# print(f"""
|
|
66
|
-
# ┌────────────────────────────────────────────────────────────────
|
|
67
|
-
# │ 🔄 Model Switch
|
|
68
|
-
# │ Now using: {model_name}
|
|
69
|
-
# └────────────────────────────────────────────────────────────────""")
|
|
70
|
-
# continue
|
|
71
|
-
# else:
|
|
72
|
-
# break
|
|
73
|
-
|
|
74
|
-
# for a_choice in choices:
|
|
75
|
-
# response_content = a_choice.message.content
|
|
76
|
-
# print("\n" * 2)
|
|
77
|
-
# try:
|
|
78
|
-
# rprint(Panel(
|
|
79
|
-
# f"{response_content}",
|
|
80
|
-
# title=f"🤖 AI ({model_name})",
|
|
81
|
-
# border_style="blue"
|
|
82
|
-
# ))
|
|
83
|
-
# except Exception:
|
|
84
|
-
# # Fallback if rich formatting fails
|
|
85
|
-
# print(f"""
|
|
86
|
-
# ┌────────────────────────────────────────────────────────────────
|
|
87
|
-
# │ 🤖 AI ({model_name}):
|
|
88
|
-
# │
|
|
89
|
-
# {response_content}
|
|
90
|
-
# └────────────────────────────────────────────────────────────────""")
|
|
91
|
-
|
|
92
|
-
# conversation_history.append({"role": "assistant", "content": response_content})
|
|
93
|
-
# print("\n")
|
|
94
|
-
# except KeyboardInterrupt:
|
|
95
|
-
# print("""
|
|
96
|
-
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
97
|
-
# ┃ 👋 Chat Session Ended
|
|
98
|
-
# ┃ Thank you for using the interactive chat!
|
|
99
|
-
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━""")
|
|
100
|
-
# return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
# if __name__ == "__main__":
|
|
104
|
-
# interactive_chat()
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# def main():
|
|
2
|
-
# print("\n" + "=" * 50)
|
|
3
|
-
# print("📸 Welcome to the Snapshot Tool")
|
|
4
|
-
# print("=" * 50 + "\n")
|
|
5
|
-
|
|
6
|
-
# parser = argparse.ArgumentParser(description='📷 Capture snapshots using your webcam.')
|
|
7
|
-
# parser.add_argument("--to_text", "-t", help="📝 Convert the snapshot to text using OCR.", action="store_true")
|
|
8
|
-
# args = parser.parse_args()
|
|
9
|
-
|
|
10
|
-
# print("📷 Capturing image from webcam...")
|
|
11
|
-
# img_path = capture_from_webcam(show=False, wait=False, save=True)
|
|
12
|
-
# print(f"✅ Image captured and saved at: {img_path}\n")
|
|
13
|
-
|
|
14
|
-
# if args.to_text:
|
|
15
|
-
# print("🔍 Converting image to text using Tesseract OCR...")
|
|
16
|
-
# q = Terminal().run(f"cd ~/AppData/Local/Tesseract-OCR; pytesseract '{img_path}'", shell="pwsh").capture().op
|
|
17
|
-
# print("📝 Extracted Text:")
|
|
18
|
-
# print("-" * 50)
|
|
19
|
-
# print(q)
|
|
20
|
-
# print("-" * 50 + "\n")
|
|
21
|
-
# else:
|
|
22
|
-
# print("📂 Image saved successfully. No text extraction requested.\n")
|
|
23
|
-
|
|
24
|
-
# if __name__ == '__main__':
|
|
25
|
-
# main()
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"""Script to start terminals on windows and wsl"""
|
|
2
|
-
|
|
3
|
-
from machineconfig.utils.options import choose_from_options, get_ssh_hosts
|
|
4
|
-
import platform
|
|
5
|
-
from itertools import cycle
|
|
6
|
-
from typing import Literal, Optional, Annotated
|
|
7
|
-
import typer
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
COLOR_SCHEMES = ["Campbell", "Campbell Powershell", "Solarized Dark", "Ubuntu-ColorScheme", "Retro"]
|
|
11
|
-
THEMES_ITER = cycle(COLOR_SCHEMES)
|
|
12
|
-
INIT_COMMANDS = ["ls", "lf", "cpufetch", "fastfetch", "btm"]
|
|
13
|
-
INIT_COMMANDS_ITER = cycle(INIT_COMMANDS)
|
|
14
|
-
SIZE_ITER = cycle([0.6, 0.4, 0.3])
|
|
15
|
-
ORIENTATION = ["vertical", "horizontal"]
|
|
16
|
-
ORIENTATION_ITER = cycle(ORIENTATION)
|
|
17
|
-
ORIENTATION_TYPE = Literal["vertical", "horizontal"]
|
|
18
|
-
|
|
19
|
-
THIS_MACHINE = "this"
|
|
20
|
-
THIS_MACHINE_WSL = "thiswsl"
|
|
21
|
-
THIS_MACHINE_HOSTNAME = platform.node()
|
|
22
|
-
THIS_MACHINE_HOSTNAME_WSL = f"{THIS_MACHINE_HOSTNAME}wsl"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def main_windows_and_wsl(window: int, hosts: list[str], orientation: ORIENTATION_TYPE = "vertical", mprocs: bool = False):
|
|
26
|
-
print("\n🔧 Configuring terminal layout for Windows and WSL...")
|
|
27
|
-
orientation_oposite = "horizontal" if orientation == "vertical" else "vertical"
|
|
28
|
-
orientation_swap = "up" if orientation == "horizontal" else "left"
|
|
29
|
-
orientation_opposite_move_focus = "up" if orientation_oposite == "horizontal" else "left"
|
|
30
|
-
orientation_opposite_move_focus_other = "down" if orientation_oposite == "horizontal" else "right"
|
|
31
|
-
sleep = 3
|
|
32
|
-
sep = f"\nsleep {sleep}; wt --window {window}" # or '`;'
|
|
33
|
-
ssh_cmd = "-t 'mprocs'" if mprocs else "" # 'wsl_ssh_windows_port_forwarding.ps1'
|
|
34
|
-
split_per_machine = 1 / len(hosts)
|
|
35
|
-
size = 0.3
|
|
36
|
-
known_hosts = get_ssh_hosts()
|
|
37
|
-
if len(hosts) == 1:
|
|
38
|
-
print("🖥️ Single host detected. Configuring layout...")
|
|
39
|
-
if "wsl" in hosts[0] or f"{hosts[0]}wsl" in known_hosts: # its a windows machine with wsl
|
|
40
|
-
host_wind = hosts[0] if "wsl" not in hosts[0] else hosts[0].split("wsl")[0]
|
|
41
|
-
host_linux = f"{host_wind}wsl"
|
|
42
|
-
cmd = f"""
|
|
43
|
-
wt --window {window} --title {hosts[0]} powershell -Command "ssh {host_linux} {ssh_cmd}" `; split-pane --{orientation} --title {hosts[0]}wsl --size 0.5 powershell -Command "ssh {host_wind} `; split-pane --{orientation_oposite} --size 0.5 powershell "
|
|
44
|
-
"""
|
|
45
|
-
else: # its a windows machine without wsl
|
|
46
|
-
cmd = f"""wt --window {window} --title {hosts[0]} powershell -Command "ssh {hosts[0]} {ssh_cmd}" `; split-pane --{orientation} --title {hosts[0]}wsl --size 0.1 powershell """
|
|
47
|
-
|
|
48
|
-
elif len(hosts) > 1:
|
|
49
|
-
print("🖥️ Multiple hosts detected. Configuring layout...")
|
|
50
|
-
pane_cmd = f'powershell -Command "ssh {hosts[0]} {ssh_cmd}" ' if hosts[0] != THIS_MACHINE else ""
|
|
51
|
-
cmd = f"""wt --window {window} --title {hosts[0]} {pane_cmd} """
|
|
52
|
-
for a_host in hosts[1:]:
|
|
53
|
-
if a_host != THIS_MACHINE:
|
|
54
|
-
pane_cmd = f'powershell -Command "ssh {a_host} {ssh_cmd}" '
|
|
55
|
-
else:
|
|
56
|
-
pane_cmd = "powershell"
|
|
57
|
-
cmd += f"""{sep} split-pane --{orientation_oposite} --title {a_host}Windows --size {split_per_machine} {pane_cmd} """
|
|
58
|
-
for idx, a_host in enumerate(hosts[::-1]):
|
|
59
|
-
if f"{a_host}wsl" not in known_hosts and a_host != THIS_MACHINE:
|
|
60
|
-
continue
|
|
61
|
-
pane_cmd = f'powershell -Command "ssh {a_host}wsl"' if a_host != THIS_MACHINE else "wsl"
|
|
62
|
-
if idx == 0:
|
|
63
|
-
tmp = ""
|
|
64
|
-
else:
|
|
65
|
-
tmp = f"move-focus {orientation_opposite_move_focus}" if idx % 2 == 1 else f"move-focus {orientation_opposite_move_focus_other}"
|
|
66
|
-
cmd += f"""{sep} {tmp} split-pane --{orientation} --title {a_host}wsl --size {size} {pane_cmd} """
|
|
67
|
-
cmd += f"""{sep} swap-pane {orientation_swap} """
|
|
68
|
-
else:
|
|
69
|
-
raise NotImplementedError(f"❌ len(hosts) = {len(hosts)}. Only 1 or 2 hosts are supported.")
|
|
70
|
-
print("✅ Terminal layout configured successfully!\n")
|
|
71
|
-
return cmd
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def main(
|
|
75
|
-
panes: Annotated[Optional[int], typer.Option("--panes", "-p", help="🔲 The number of panes to open.")] = 4,
|
|
76
|
-
vertical: Annotated[bool, typer.Option("--vertical", "-V", help="↕️ Switch orientation to vertical from default horizontal.")] = False,
|
|
77
|
-
window: Annotated[int, typer.Option("--window", "-w", help="🪟 The window ID to use.")] = 0,
|
|
78
|
-
hosts: Annotated[Optional[list[str]], typer.Option("--hosts", "-H", help="🌐 The hosts to connect to.")] = None,
|
|
79
|
-
) -> None:
|
|
80
|
-
print("\n" + "=" * 50)
|
|
81
|
-
print("🖥️ Welcome to the Terminal Starter Tool")
|
|
82
|
-
print("=" * 50 + "\n")
|
|
83
|
-
|
|
84
|
-
if panes:
|
|
85
|
-
print("🔲 Configuring panes...")
|
|
86
|
-
cmd = f"wt --window {window} --colorScheme '{next(THEMES_ITER)}' pwsh -NoExit -Command '{next(INIT_COMMANDS_ITER)}' "
|
|
87
|
-
cmd += f" `; new-tab --colorScheme '{next(THEMES_ITER)}' --profile pwsh --title 't2' --tabColor '#f59218' "
|
|
88
|
-
cmd += f" `; new-tab --colorScheme '{next(THEMES_ITER)}' --profile pwsh --title 't3' --tabColor '#009999' "
|
|
89
|
-
for idx in range(panes):
|
|
90
|
-
if idx % 2 == 0:
|
|
91
|
-
cmd += f" `; move-focus down split-pane --horizontal --size {next(SIZE_ITER)} --colorScheme '{next(THEMES_ITER)}' pwsh -NoExit -Command '{next(INIT_COMMANDS_ITER)}' "
|
|
92
|
-
else:
|
|
93
|
-
cmd += f" `; move-focus up split-pane --vertical --size {next(SIZE_ITER)} --colorScheme '{next(THEMES_ITER)}' pwsh -NoExit -Command '{next(INIT_COMMANDS_ITER)}' "
|
|
94
|
-
|
|
95
|
-
else:
|
|
96
|
-
if hosts is None:
|
|
97
|
-
print("🌐 No hosts provided. Displaying options...")
|
|
98
|
-
hosts = choose_from_options(msg="Select hosts:", options=get_ssh_hosts() + [THIS_MACHINE], multi=True, fzf=True)
|
|
99
|
-
else:
|
|
100
|
-
print("🌐 Using provided hosts:", hosts)
|
|
101
|
-
assert isinstance(hosts, list)
|
|
102
|
-
cmd = main_windows_and_wsl(window=window, hosts=hosts, orientation="vertical" if vertical else "horizontal")
|
|
103
|
-
|
|
104
|
-
print("\n📋 Generated Command:")
|
|
105
|
-
print("-" * 50)
|
|
106
|
-
print(cmd)
|
|
107
|
-
print("-" * 50 + "\n")
|
|
108
|
-
|
|
109
|
-
# PROGRAM_PATH.write_text(cmd, encoding="utf-8")
|
|
110
|
-
import subprocess
|
|
111
|
-
|
|
112
|
-
subprocess.run(cmd, shell=True)
|
|
113
|
-
print("✅ Command saved successfully!\n")
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def arg_parser() -> None:
|
|
117
|
-
typer.run(main)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if __name__ == "__main__":
|
|
121
|
-
arg_parser()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
uv run --python 3.13 --no-dev --project $HOME/code/machineconfig choose_wezterm_theme $args[0]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/machineconfig/scripts/{windows/select_pwsh_theme.ps1 → python/devops_helpers/choose_pwsh_theme.ps1}
RENAMED
|
File without changes
|
/machineconfig/scripts/python/{choose_wezterm_theme.py → devops_helpers/choose_wezterm_theme.py}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/machineconfig/scripts/python/{sessions_multiprocess.py → sessions_helpers/sessions_multiprocess.py}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|