machineconfig 2.0__py3-none-any.whl → 2.2__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/cluster/cloud_manager.py +0 -3
- machineconfig/cluster/data_transfer.py +0 -1
- machineconfig/cluster/file_manager.py +0 -1
- machineconfig/cluster/job_params.py +0 -3
- machineconfig/cluster/loader_runner.py +0 -3
- machineconfig/cluster/remote_machine.py +0 -1
- machineconfig/cluster/script_notify_upon_completion.py +0 -1
- machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +5 -6
- machineconfig/cluster/sessions_managers/archive/session_managers.py +0 -1
- machineconfig/cluster/sessions_managers/enhanced_command_runner.py +17 -57
- machineconfig/cluster/sessions_managers/wt_local.py +36 -110
- machineconfig/cluster/sessions_managers/wt_local_manager.py +42 -112
- machineconfig/cluster/sessions_managers/wt_remote.py +23 -30
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +20 -62
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +10 -15
- machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +27 -127
- machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +10 -43
- machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +22 -101
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +11 -39
- machineconfig/cluster/sessions_managers/zellij_local.py +49 -102
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +34 -78
- machineconfig/cluster/sessions_managers/zellij_remote.py +17 -24
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +7 -13
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +4 -2
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +6 -6
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +18 -88
- machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +2 -6
- machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +12 -40
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +3 -2
- machineconfig/cluster/templates/cli_click.py +0 -1
- machineconfig/cluster/templates/cli_gooey.py +0 -2
- machineconfig/cluster/templates/cli_trogon.py +0 -1
- machineconfig/cluster/templates/run_cloud.py +0 -1
- machineconfig/cluster/templates/run_cluster.py +0 -1
- machineconfig/cluster/templates/run_remote.py +0 -1
- machineconfig/cluster/templates/utils.py +27 -46
- machineconfig/jobs/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/linux/msc/cli_agents.sh +16 -0
- machineconfig/jobs/python/check_installations.py +2 -1
- machineconfig/jobs/python/create_bootable_media.py +0 -2
- machineconfig/jobs/python/python_ve_symlink.py +9 -11
- machineconfig/jobs/python/tasks.py +0 -1
- machineconfig/jobs/python/vscode/api.py +5 -5
- machineconfig/jobs/python/vscode/link_ve.py +13 -14
- machineconfig/jobs/python/vscode/select_interpreter.py +21 -22
- machineconfig/jobs/python/vscode/sync_code.py +9 -13
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +13 -13
- machineconfig/jobs/python_custom_installers/dev/aider.py +7 -15
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +9 -18
- machineconfig/jobs/python_custom_installers/dev/brave.py +10 -19
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +8 -15
- machineconfig/jobs/python_custom_installers/dev/code.py +12 -32
- machineconfig/jobs/python_custom_installers/dev/cursor.py +3 -14
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +8 -7
- machineconfig/jobs/python_custom_installers/dev/espanso.py +15 -19
- machineconfig/jobs/python_custom_installers/dev/goes.py +5 -12
- machineconfig/jobs/python_custom_installers/dev/lvim.py +9 -17
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +12 -19
- machineconfig/jobs/python_custom_installers/dev/redis.py +12 -20
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +12 -19
- machineconfig/jobs/python_custom_installers/dev/winget.py +5 -23
- machineconfig/jobs/python_custom_installers/docker.py +12 -21
- machineconfig/jobs/python_custom_installers/gh.py +11 -19
- machineconfig/jobs/python_custom_installers/hx.py +32 -16
- machineconfig/jobs/python_custom_installers/warp-cli.py +12 -20
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/python_generic_installers/config.json +1 -1
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +1 -1
- machineconfig/jobs/windows/msc/cli_agents.bat +0 -0
- machineconfig/jobs/windows/msc/cli_agents.ps1 +0 -0
- machineconfig/jobs/windows/start_terminal.ps1 +1 -1
- machineconfig/profile/create.py +38 -26
- machineconfig/profile/create_hardlinks.py +29 -20
- machineconfig/profile/shell.py +56 -32
- machineconfig/scripts/__init__.py +0 -2
- machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/cloud/init.sh +2 -2
- machineconfig/scripts/linux/checkout_versions +1 -1
- machineconfig/scripts/linux/choose_wezterm_theme +1 -1
- machineconfig/scripts/linux/cloud_copy +1 -1
- machineconfig/scripts/linux/cloud_manager +1 -1
- machineconfig/scripts/linux/cloud_mount +1 -1
- machineconfig/scripts/linux/cloud_repo_sync +1 -1
- machineconfig/scripts/linux/cloud_sync +1 -1
- machineconfig/scripts/linux/croshell +1 -1
- machineconfig/scripts/linux/devops +7 -7
- machineconfig/scripts/linux/fire +1 -1
- machineconfig/scripts/linux/fire_agents +3 -2
- machineconfig/scripts/linux/ftpx +1 -1
- machineconfig/scripts/linux/gh_models +1 -1
- machineconfig/scripts/linux/kill_process +1 -1
- machineconfig/scripts/linux/mcinit +1 -1
- machineconfig/scripts/linux/repos +1 -1
- machineconfig/scripts/linux/scheduler +1 -1
- machineconfig/scripts/linux/start_slidev +1 -1
- machineconfig/scripts/linux/start_terminals +1 -1
- machineconfig/scripts/linux/url2md +1 -1
- machineconfig/scripts/linux/warp-cli.sh +122 -0
- machineconfig/scripts/linux/wifi_conn +1 -1
- machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_agents.cpython-313.pyc +0 -0
- machineconfig/scripts/python/ai/__init__.py +0 -0
- machineconfig/scripts/python/ai/generate_files.py +83 -0
- machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +2 -2
- machineconfig/scripts/python/ai/mcinit.py +14 -7
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +10 -5
- machineconfig/scripts/python/archive/tmate_conn.py +5 -5
- machineconfig/scripts/python/archive/tmate_start.py +7 -7
- machineconfig/scripts/python/choose_wezterm_theme.py +35 -32
- machineconfig/scripts/python/cloud_copy.py +23 -14
- machineconfig/scripts/python/cloud_mount.py +36 -24
- machineconfig/scripts/python/cloud_repo_sync.py +40 -27
- machineconfig/scripts/python/cloud_sync.py +4 -4
- machineconfig/scripts/python/croshell.py +40 -29
- machineconfig/scripts/python/devops.py +45 -27
- machineconfig/scripts/python/devops_add_identity.py +15 -25
- machineconfig/scripts/python/devops_add_ssh_key.py +8 -8
- machineconfig/scripts/python/devops_backup_retrieve.py +18 -16
- machineconfig/scripts/python/devops_devapps_install.py +25 -20
- machineconfig/scripts/python/devops_update_repos.py +232 -59
- machineconfig/scripts/python/dotfile.py +17 -15
- machineconfig/scripts/python/fire_agents.py +48 -22
- machineconfig/scripts/python/fire_jobs.py +93 -58
- machineconfig/scripts/python/ftpx.py +26 -15
- machineconfig/scripts/python/get_zellij_cmd.py +8 -7
- machineconfig/scripts/python/helpers/cloud_helpers.py +33 -28
- machineconfig/scripts/python/helpers/helpers2.py +27 -16
- machineconfig/scripts/python/helpers/helpers4.py +45 -32
- machineconfig/scripts/python/helpers/helpers5.py +1 -1
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +32 -10
- machineconfig/scripts/python/mount_nfs.py +9 -16
- machineconfig/scripts/python/mount_nw_drive.py +10 -5
- machineconfig/scripts/python/mount_ssh.py +9 -7
- machineconfig/scripts/python/repos.py +216 -58
- machineconfig/scripts/python/snapshot.py +0 -1
- machineconfig/scripts/python/start_slidev.py +11 -6
- machineconfig/scripts/python/start_terminals.py +22 -16
- machineconfig/scripts/python/viewer_template.py +0 -1
- machineconfig/scripts/python/wifi_conn.py +49 -75
- machineconfig/scripts/python/wsl_windows_transfer.py +9 -7
- machineconfig/scripts/windows/checkout_version.ps1 +1 -3
- machineconfig/scripts/windows/choose_wezterm_theme.ps1 +1 -3
- machineconfig/scripts/windows/cloud_copy.ps1 +2 -6
- machineconfig/scripts/windows/cloud_manager.ps1 +1 -1
- machineconfig/scripts/windows/cloud_repo_sync.ps1 +1 -2
- machineconfig/scripts/windows/cloud_sync.ps1 +2 -2
- machineconfig/scripts/windows/croshell.ps1 +2 -2
- machineconfig/scripts/windows/devops.ps1 +1 -4
- machineconfig/scripts/windows/dotfile.ps1 +1 -3
- machineconfig/scripts/windows/fire.ps1 +1 -1
- machineconfig/scripts/windows/ftpx.ps1 +2 -2
- machineconfig/scripts/windows/gpt.ps1 +1 -1
- machineconfig/scripts/windows/kill_process.ps1 +1 -2
- machineconfig/scripts/windows/mcinit.ps1 +1 -1
- machineconfig/scripts/windows/mount_nfs.ps1 +1 -1
- machineconfig/scripts/windows/mount_ssh.ps1 +1 -1
- machineconfig/scripts/windows/pomodoro.ps1 +1 -1
- machineconfig/scripts/windows/py2exe.ps1 +1 -3
- machineconfig/scripts/windows/repos.ps1 +1 -1
- machineconfig/scripts/windows/scheduler.ps1 +1 -1
- machineconfig/scripts/windows/snapshot.ps1 +2 -2
- machineconfig/scripts/windows/start_slidev.ps1 +1 -1
- machineconfig/scripts/windows/start_terminals.ps1 +1 -1
- machineconfig/scripts/windows/wifi_conn.ps1 +1 -1
- machineconfig/scripts/windows/wsl_windows_transfer.ps1 +1 -3
- machineconfig/settings/lf/linux/lfrc +2 -1
- machineconfig/settings/linters/.ruff_cache/.gitignore +2 -0
- machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +1 -0
- machineconfig/settings/lvim/windows/archive/config_additional.lua +1 -1
- machineconfig/settings/svim/linux/init.toml +1 -1
- machineconfig/settings/svim/windows/init.toml +1 -1
- machineconfig/setup_linux/web_shortcuts/croshell.sh +3 -52
- machineconfig/setup_linux/web_shortcuts/interactive.sh +6 -6
- machineconfig/setup_linux/web_shortcuts/ssh.sh +0 -4
- machineconfig/setup_windows/web_shortcuts/all.ps1 +2 -2
- machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +1 -1
- machineconfig/setup_windows/web_shortcuts/croshell.ps1 +1 -1
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +5 -5
- machineconfig/setup_windows/wt_and_pwsh/install_fonts.ps1 +51 -15
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +58 -13
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +45 -37
- machineconfig/utils/ai/generate_file_checklist.py +8 -10
- machineconfig/utils/ai/url2md.py +4 -2
- machineconfig/utils/cloud/onedrive/setup_oauth.py +1 -0
- machineconfig/utils/cloud/onedrive/transaction.py +63 -98
- machineconfig/utils/code.py +62 -41
- machineconfig/utils/installer.py +29 -35
- machineconfig/utils/installer_utils/installer_abc.py +11 -11
- machineconfig/utils/installer_utils/installer_class.py +155 -74
- machineconfig/utils/links.py +112 -31
- machineconfig/utils/notifications.py +211 -0
- machineconfig/utils/options.py +41 -42
- machineconfig/utils/path.py +13 -6
- machineconfig/utils/path_reduced.py +614 -311
- machineconfig/utils/procs.py +48 -42
- machineconfig/utils/scheduling.py +0 -1
- machineconfig/utils/source_of_truth.py +27 -0
- machineconfig/utils/ssh.py +146 -85
- machineconfig/utils/terminal.py +84 -37
- machineconfig/utils/upgrade_packages.py +91 -0
- machineconfig/utils/utils2.py +39 -50
- machineconfig/utils/utils5.py +195 -116
- machineconfig/utils/ve.py +13 -5
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/METADATA +14 -13
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/RECORD +212 -237
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
- machineconfig/jobs/python/archive/python_tools.txt +0 -12
- machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/update.py +0 -3
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/linux/activate_ve +0 -87
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/windows/activate_ve.ps1 +0 -54
- machineconfig/setup_linux/web_shortcuts/all.sh +0 -48
- machineconfig/setup_linux/web_shortcuts/update_system.sh +0 -48
- machineconfig/utils/utils.py +0 -95
- /machineconfig/setup_linux/web_shortcuts/{tmp.sh → android.sh} +0 -0
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/WHEEL +0 -0
- {machineconfig-2.0.dist-info → machineconfig-2.2.dist-info}/top_level.txt +0 -0
|
@@ -43,59 +43,45 @@ from rich.table import Table
|
|
|
43
43
|
|
|
44
44
|
console = Console()
|
|
45
45
|
|
|
46
|
+
|
|
46
47
|
def get_available_networks() -> List[Dict[str, str]]:
|
|
47
48
|
"""Get list of available WiFi networks"""
|
|
48
49
|
networks = []
|
|
49
50
|
|
|
50
51
|
try:
|
|
51
52
|
if platform.system() == "Windows":
|
|
52
|
-
result = subprocess.run(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
for line in result.stdout.split('\n'):
|
|
58
|
-
if 'All User Profile' in line:
|
|
59
|
-
ssid = line.split(':')[1].strip()
|
|
53
|
+
result = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output=True, text=True, check=True)
|
|
54
|
+
|
|
55
|
+
for line in result.stdout.split("\n"):
|
|
56
|
+
if "All User Profile" in line:
|
|
57
|
+
ssid = line.split(":")[1].strip()
|
|
60
58
|
networks.append({"ssid": ssid, "signal": "Unknown"})
|
|
61
59
|
|
|
62
60
|
# Also get available networks
|
|
63
|
-
result = subprocess.run(
|
|
64
|
-
["netsh", "wlan", "show", "networks"],
|
|
65
|
-
capture_output=True, text=True, check=True
|
|
66
|
-
)
|
|
61
|
+
result = subprocess.run(["netsh", "wlan", "show", "networks"], capture_output=True, text=True, check=True)
|
|
67
62
|
|
|
68
63
|
current_ssid = None
|
|
69
|
-
for line in result.stdout.split(
|
|
70
|
-
if
|
|
71
|
-
current_ssid = line.split(
|
|
72
|
-
elif
|
|
73
|
-
signal = line.split(
|
|
64
|
+
for line in result.stdout.split("\n"):
|
|
65
|
+
if "SSID" in line and "BSSID" not in line:
|
|
66
|
+
current_ssid = line.split(":")[1].strip()
|
|
67
|
+
elif "Signal" in line and current_ssid:
|
|
68
|
+
signal = line.split(":")[1].strip()
|
|
74
69
|
# Avoid duplicates
|
|
75
|
-
if not any(net[
|
|
70
|
+
if not any(net["ssid"] == current_ssid for net in networks):
|
|
76
71
|
networks.append({"ssid": current_ssid, "signal": signal})
|
|
77
72
|
current_ssid = None
|
|
78
73
|
|
|
79
74
|
elif platform.system() in ["Linux", "Darwin"]:
|
|
80
75
|
if platform.system() == "Linux":
|
|
81
|
-
result = subprocess.run(
|
|
82
|
-
["nmcli", "-t", "-f", "SSID,SIGNAL", "device", "wifi", "list"],
|
|
83
|
-
capture_output=True, text=True, check=True
|
|
84
|
-
)
|
|
76
|
+
result = subprocess.run(["nmcli", "-t", "-f", "SSID,SIGNAL", "device", "wifi", "list"], capture_output=True, text=True, check=True)
|
|
85
77
|
else: # Darwin/macOS - using airport command
|
|
86
|
-
result = subprocess.run(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
for line in result.stdout.strip().split('\n'):
|
|
92
|
-
if line and ':' in line:
|
|
93
|
-
parts = line.split(':')
|
|
78
|
+
result = subprocess.run(["/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport", "-s"], capture_output=True, text=True, check=True)
|
|
79
|
+
|
|
80
|
+
for line in result.stdout.strip().split("\n"):
|
|
81
|
+
if line and ":" in line:
|
|
82
|
+
parts = line.split(":")
|
|
94
83
|
if len(parts) >= 2 and parts[0].strip():
|
|
95
|
-
networks.append({
|
|
96
|
-
"ssid": parts[0].strip(),
|
|
97
|
-
"signal": f"{parts[1].strip()}%"
|
|
98
|
-
})
|
|
84
|
+
networks.append({"ssid": parts[0].strip(), "signal": f"{parts[1].strip()}%"})
|
|
99
85
|
|
|
100
86
|
except subprocess.CalledProcessError as e:
|
|
101
87
|
console.print(f"[red]❌ Error scanning networks: {e}[/red]")
|
|
@@ -106,13 +92,14 @@ def get_available_networks() -> List[Dict[str, str]]:
|
|
|
106
92
|
seen = set()
|
|
107
93
|
unique_networks = []
|
|
108
94
|
for net in networks:
|
|
109
|
-
ssid = net[
|
|
95
|
+
ssid = net["ssid"]
|
|
110
96
|
if ssid and ssid not in seen:
|
|
111
97
|
seen.add(ssid)
|
|
112
98
|
unique_networks.append(net)
|
|
113
99
|
|
|
114
100
|
return unique_networks
|
|
115
101
|
|
|
102
|
+
|
|
116
103
|
def display_and_select_network() -> Optional[Dict[str, str]]:
|
|
117
104
|
"""Display available networks and let user select one"""
|
|
118
105
|
console.print("\n[blue]📡 Scanning for available WiFi networks...[/blue]")
|
|
@@ -130,18 +117,15 @@ def display_and_select_network() -> Optional[Dict[str, str]]:
|
|
|
130
117
|
table.add_column("Signal Strength", style="yellow")
|
|
131
118
|
|
|
132
119
|
for i, network in enumerate(networks, 1):
|
|
133
|
-
table.add_row(str(i), network[
|
|
120
|
+
table.add_row(str(i), network["ssid"], network["signal"])
|
|
134
121
|
|
|
135
122
|
console.print(table)
|
|
136
123
|
|
|
137
124
|
# Let user select
|
|
138
125
|
try:
|
|
139
|
-
choice = Prompt.ask(
|
|
140
|
-
"\n[blue]Select network number (or 'q' to quit)[/blue]",
|
|
141
|
-
default="q"
|
|
142
|
-
)
|
|
126
|
+
choice = Prompt.ask("\n[blue]Select network number (or 'q' to quit)[/blue]", default="q")
|
|
143
127
|
|
|
144
|
-
if choice.lower() ==
|
|
128
|
+
if choice.lower() == "q":
|
|
145
129
|
return None
|
|
146
130
|
|
|
147
131
|
index = int(choice) - 1
|
|
@@ -154,16 +138,15 @@ def display_and_select_network() -> Optional[Dict[str, str]]:
|
|
|
154
138
|
except ValueError:
|
|
155
139
|
console.print("[red]❌ Invalid input. Please enter a number.[/red]")
|
|
156
140
|
return None
|
|
141
|
+
|
|
142
|
+
|
|
157
143
|
def connect(name: str, ssid: str):
|
|
158
144
|
"""Connect to a WiFi network"""
|
|
159
145
|
console.print(f"\n[blue]🌐 Connecting to network: {name} (SSID: {ssid})[/blue]")
|
|
160
146
|
|
|
161
147
|
try:
|
|
162
148
|
if platform.system() == "Windows":
|
|
163
|
-
subprocess.run(
|
|
164
|
-
["netsh", "wlan", "connect", f"name={name}", f"ssid={ssid}", "interface=Wi-Fi"],
|
|
165
|
-
capture_output=True, text=True, check=True
|
|
166
|
-
)
|
|
149
|
+
subprocess.run(["netsh", "wlan", "connect", f"name={name}", f"ssid={ssid}", "interface=Wi-Fi"], capture_output=True, text=True, check=True)
|
|
167
150
|
elif platform.system() == "Linux":
|
|
168
151
|
subprocess.run(f"nmcli connection up '{name}'", shell=True, check=True)
|
|
169
152
|
|
|
@@ -176,6 +159,7 @@ def connect(name: str, ssid: str):
|
|
|
176
159
|
console.print(f"[red]❌ Unexpected error: {e}[/red]")
|
|
177
160
|
raise
|
|
178
161
|
|
|
162
|
+
|
|
179
163
|
def connect_to_new_network(ssid: str, password: str):
|
|
180
164
|
"""Connect to a new network with SSID and password"""
|
|
181
165
|
try:
|
|
@@ -199,6 +183,7 @@ def connect_to_new_network(ssid: str, password: str):
|
|
|
199
183
|
console.print(f"[red]❌ Failed to connect to {ssid}: {e}[/red]")
|
|
200
184
|
raise
|
|
201
185
|
|
|
186
|
+
|
|
202
187
|
def display_available_networks():
|
|
203
188
|
"""Display available networks (legacy function for compatibility)"""
|
|
204
189
|
console.print("\n[blue]📡 Scanning for available networks...[/blue]")
|
|
@@ -216,14 +201,11 @@ def display_available_networks():
|
|
|
216
201
|
except Exception as e:
|
|
217
202
|
console.print(f"[red]❌ Unexpected error: {e}[/red]")
|
|
218
203
|
|
|
204
|
+
|
|
219
205
|
def try_config_connection(config_ssid: str) -> bool:
|
|
220
206
|
"""Try to connect using configuration file"""
|
|
221
207
|
try:
|
|
222
|
-
config_paths = [
|
|
223
|
-
Path.home() / 'dotfiles/machineconfig/setup/wifi.ini',
|
|
224
|
-
Path.home() / '.config/wifi.ini',
|
|
225
|
-
Path.cwd() / 'wifi.ini'
|
|
226
|
-
]
|
|
208
|
+
config_paths = [Path.home() / "dotfiles/machineconfig/setup/wifi.ini", Path.home() / ".config/wifi.ini", Path.cwd() / "wifi.ini"]
|
|
227
209
|
|
|
228
210
|
creds = configparser.ConfigParser()
|
|
229
211
|
config_found = False
|
|
@@ -245,8 +227,8 @@ def try_config_connection(config_ssid: str) -> bool:
|
|
|
245
227
|
console.print(f"[blue]Available configured networks: {', '.join(available_ssids)}[/blue]")
|
|
246
228
|
return False
|
|
247
229
|
|
|
248
|
-
ssid = creds[config_ssid][
|
|
249
|
-
password = creds[config_ssid][
|
|
230
|
+
ssid = creds[config_ssid]["SSID"]
|
|
231
|
+
password = creds[config_ssid]["pwd"]
|
|
250
232
|
|
|
251
233
|
console.print(f"[green]✅ Found configuration for {config_ssid}[/green]")
|
|
252
234
|
connect_to_new_network(ssid, password)
|
|
@@ -256,6 +238,7 @@ def try_config_connection(config_ssid: str) -> bool:
|
|
|
256
238
|
console.print(f"[red]❌ Error reading configuration: {e}[/red]")
|
|
257
239
|
return False
|
|
258
240
|
|
|
241
|
+
|
|
259
242
|
def manual_network_selection() -> bool:
|
|
260
243
|
"""Manual network selection and connection"""
|
|
261
244
|
network = display_and_select_network()
|
|
@@ -263,7 +246,7 @@ def manual_network_selection() -> bool:
|
|
|
263
246
|
if not network:
|
|
264
247
|
return False
|
|
265
248
|
|
|
266
|
-
ssid = network[
|
|
249
|
+
ssid = network["ssid"]
|
|
267
250
|
console.print(f"\n[blue]Selected network: {ssid}[/blue]")
|
|
268
251
|
|
|
269
252
|
# Get password from user
|
|
@@ -279,18 +262,15 @@ def manual_network_selection() -> bool:
|
|
|
279
262
|
except Exception:
|
|
280
263
|
return False
|
|
281
264
|
|
|
265
|
+
|
|
282
266
|
def main():
|
|
283
267
|
"""Main function with fallback network selection"""
|
|
284
|
-
console.print(Panel(
|
|
285
|
-
"📶 Welcome to the WiFi Connector Tool",
|
|
286
|
-
title="[bold blue]WiFi Connection[/bold blue]",
|
|
287
|
-
border_style="blue"
|
|
288
|
-
))
|
|
268
|
+
console.print(Panel("📶 Welcome to the WiFi Connector Tool", title="[bold blue]WiFi Connection[/bold blue]", border_style="blue"))
|
|
289
269
|
|
|
290
|
-
parser = argparse.ArgumentParser(description=
|
|
291
|
-
parser.add_argument(
|
|
292
|
-
parser.add_argument(
|
|
293
|
-
parser.add_argument(
|
|
270
|
+
parser = argparse.ArgumentParser(description="WiFi Connector")
|
|
271
|
+
parser.add_argument("-n", "--ssid", help="🔗 SSID of WiFi (from config)", default="MyPhoneHotSpot")
|
|
272
|
+
parser.add_argument("-m", "--manual", action="store_true", help="🔍 Manual network selection mode")
|
|
273
|
+
parser.add_argument("-l", "--list", action="store_true", help="📡 List available networks only")
|
|
294
274
|
|
|
295
275
|
args = parser.parse_args()
|
|
296
276
|
|
|
@@ -326,16 +306,14 @@ def main():
|
|
|
326
306
|
else:
|
|
327
307
|
console.print("[blue]👋 Goodbye![/blue]")
|
|
328
308
|
|
|
309
|
+
|
|
329
310
|
def get_current_wifi_name() -> str:
|
|
330
311
|
"""Get the name of the currently connected WiFi network"""
|
|
331
312
|
console.print("\n[blue]🔍 Checking current WiFi connection...[/blue]")
|
|
332
313
|
|
|
333
314
|
try:
|
|
334
315
|
if platform.system() == "Windows":
|
|
335
|
-
result = subprocess.run(
|
|
336
|
-
["netsh", "wlan", "show", "interface"],
|
|
337
|
-
capture_output=True, text=True, check=True
|
|
338
|
-
)
|
|
316
|
+
result = subprocess.run(["netsh", "wlan", "show", "interface"], capture_output=True, text=True, check=True)
|
|
339
317
|
|
|
340
318
|
for line in result.stdout.split("\n"):
|
|
341
319
|
if "SSID" in line and "BSSID" not in line:
|
|
@@ -348,10 +326,7 @@ def get_current_wifi_name() -> str:
|
|
|
348
326
|
return "Not connected to WiFi"
|
|
349
327
|
|
|
350
328
|
elif platform.system() == "Linux":
|
|
351
|
-
result = subprocess.run(
|
|
352
|
-
["iwgetid", "-r"],
|
|
353
|
-
capture_output=True, text=True, check=True
|
|
354
|
-
)
|
|
329
|
+
result = subprocess.run(["iwgetid", "-r"], capture_output=True, text=True, check=True)
|
|
355
330
|
|
|
356
331
|
wifi_name = result.stdout.strip()
|
|
357
332
|
if wifi_name:
|
|
@@ -371,6 +346,7 @@ def get_current_wifi_name() -> str:
|
|
|
371
346
|
console.print("[yellow]⚠️ System not supported[/yellow]\n")
|
|
372
347
|
return "System not supported"
|
|
373
348
|
|
|
349
|
+
|
|
374
350
|
def create_new_connection(name: str, ssid: str, password: str):
|
|
375
351
|
"""Create a new WiFi connection profile"""
|
|
376
352
|
console.print(f"\n[blue]🔧 Creating new connection: {name} (SSID: {ssid})[/blue]")
|
|
@@ -407,10 +383,7 @@ def create_new_connection(name: str, ssid: str, password: str):
|
|
|
407
383
|
profile_path = f"{name}.xml"
|
|
408
384
|
Path(profile_path).write_text(xml_config, encoding="utf-8")
|
|
409
385
|
|
|
410
|
-
subprocess.run(
|
|
411
|
-
["netsh", "wlan", "add", "profile", f"filename={profile_path}", "interface=Wi-Fi"],
|
|
412
|
-
capture_output=True, text=True, check=True
|
|
413
|
-
)
|
|
386
|
+
subprocess.run(["netsh", "wlan", "add", "profile", f"filename={profile_path}", "interface=Wi-Fi"], capture_output=True, text=True, check=True)
|
|
414
387
|
|
|
415
388
|
# Clean up the XML file
|
|
416
389
|
try:
|
|
@@ -439,5 +412,6 @@ def create_new_connection(name: str, ssid: str, password: str):
|
|
|
439
412
|
console.print(f"[red]❌ Unexpected error: {e}[/red]")
|
|
440
413
|
raise
|
|
441
414
|
|
|
442
|
-
|
|
415
|
+
|
|
416
|
+
if __name__ == "__main__":
|
|
443
417
|
main()
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
"""TWSL
|
|
2
|
-
"""
|
|
1
|
+
"""TWSL"""
|
|
3
2
|
|
|
4
|
-
from machineconfig.utils.path_reduced import
|
|
3
|
+
from machineconfig.utils.path_reduced import PathExtended as PathExtended
|
|
5
4
|
import argparse
|
|
6
5
|
import platform
|
|
7
6
|
import getpass
|
|
@@ -9,7 +8,7 @@ from pathlib import Path
|
|
|
9
8
|
|
|
10
9
|
system = platform.system() # e.g. "Windows", "Linux", "Darwin" (macOS)
|
|
11
10
|
# HostName = platform.node() # e.g. "MY-SURFACE", os.env["COMPUTERNAME") only works for windows.
|
|
12
|
-
UserName
|
|
11
|
+
UserName = getpass.getuser() # e.g: username, os.env["USERNAME") only works for windows.
|
|
13
12
|
# UserDomain = os.environ["USERDOMAIN"] # e.g. HAD OR MY-SURFACE
|
|
14
13
|
# UserDomainRoaming = PathExtended(os.environ["USERDOMAIN_ROAMINGPROFILE"]) # e.g. SURFACE
|
|
15
14
|
# LogonServer = os.environ["LOGONSERVER"] # e.g. "\\MY-SURFACE"
|
|
@@ -26,9 +25,11 @@ def main():
|
|
|
26
25
|
print("🔄 Welcome to the WSL-Windows File Transfer Tool")
|
|
27
26
|
print("=" * 50 + "\n")
|
|
28
27
|
|
|
29
|
-
parser = argparse.ArgumentParser(
|
|
28
|
+
parser = argparse.ArgumentParser(
|
|
29
|
+
description="""📂 Move and copy files across WSL & Windows.
|
|
30
30
|
The direction is automatically determined by sensing the execution environment.
|
|
31
|
-
Otherwise, a flag must be raised to indicate the direction."""
|
|
31
|
+
Otherwise, a flag must be raised to indicate the direction."""
|
|
32
|
+
)
|
|
32
33
|
|
|
33
34
|
# positional argument
|
|
34
35
|
parser.add_argument("path", help="📁 Path of file/folder to transfer over.")
|
|
@@ -57,6 +58,7 @@ Otherwise, a flag must be raised to indicate the direction.""")
|
|
|
57
58
|
else:
|
|
58
59
|
from machineconfig.utils.ssh import SSH
|
|
59
60
|
import platform
|
|
61
|
+
|
|
60
62
|
port = int(args.port) if args.port else (2222 if system == "Windows" else 22)
|
|
61
63
|
username = UserName
|
|
62
64
|
hostname = platform.node()
|
|
@@ -66,5 +68,5 @@ Otherwise, a flag must be raised to indicate the direction.""")
|
|
|
66
68
|
print("✅ SSH transfer completed successfully!\n")
|
|
67
69
|
|
|
68
70
|
|
|
69
|
-
if __name__ ==
|
|
71
|
+
if __name__ == "__main__":
|
|
70
72
|
main()
|
|
@@ -8,9 +8,7 @@ else {
|
|
|
8
8
|
$name = $args[0]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
# . $PSScriptRoot/activate_ve.ps1 ve
|
|
13
|
-
. "$HOME\scripts\activate_ve.ps1" ve
|
|
11
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
14
12
|
|
|
15
13
|
python -m fire machineconfig.scripts.python.choose_wezterm_theme main2 $args[0]
|
|
16
14
|
.$profile # reload the profile
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
#~/
|
|
2
|
+
#~/code/machineconfig/.venv/Scripts/Activate.ps1
|
|
3
3
|
# . $PSScriptRoot/activate_ve.ps1
|
|
4
4
|
# python -m machineconfig.scripts.python.cloud_copy $args
|
|
5
5
|
# deactivate -ErrorAction SilentlyContinue
|
|
6
6
|
try {
|
|
7
|
-
|
|
8
|
-
. "$PSScriptRoot/activate_ve.ps1" ve
|
|
9
|
-
} else {
|
|
10
|
-
. "$HOME/activate_ve.ps1" ve
|
|
11
|
-
}
|
|
7
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
12
8
|
python -m machineconfig.scripts.python.cloud_copy $args
|
|
13
9
|
} catch {
|
|
14
10
|
Write-Error $_.Exception.Message
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
# . $PSScriptRoot/activate_ve.ps1 ve # use the default ve.
|
|
3
|
-
. "$HOME\
|
|
3
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
4
4
|
|
|
5
5
|
# python -i $PSScriptRoot/../python/cloud_manager.py $args
|
|
6
6
|
python -i -m machineconfig.scripts.python.cloud_manager $args
|
|
@@ -5,8 +5,8 @@ if (Test-Path $op_script ) {
|
|
|
5
5
|
Remove-Item $op_script
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
9
|
+
|
|
10
10
|
# python $PSScriptRoot/../python/cloud_sync.py $args
|
|
11
11
|
python -m machineconfig.scripts.python.cloud_sync $args
|
|
12
12
|
|
|
@@ -5,7 +5,7 @@ if (Test-Path $op_script ) {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
$ErrorActionPreference = "Stop"
|
|
8
|
-
#~/
|
|
8
|
+
#~/code/machineconfig/.venv/Scripts/Activate.ps1 # fixed ve
|
|
9
9
|
|
|
10
10
|
# Locate the python script to run relative to the current directory (which might be a symlink)
|
|
11
11
|
# $script_root = (Get-Item $PSScriptRoot).Target # resolves symlink if any
|
|
@@ -18,7 +18,7 @@ $ErrorActionPreference = "Stop"
|
|
|
18
18
|
# }
|
|
19
19
|
|
|
20
20
|
$script_root = $MyInvocation.MyCommand.Path
|
|
21
|
-
. "$HOME\
|
|
21
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
22
22
|
|
|
23
23
|
#. "$script_root\..\activate_ve.ps1" # dynamic v
|
|
24
24
|
|
|
@@ -6,10 +6,7 @@ if (Test-Path $op_script ) {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# . $PSScriptRoot/activate_ve.ps1 've'
|
|
11
|
-
# . "$HOME\scripts\activate_ve.ps1" ve
|
|
12
|
-
. "$HOME\venvs\ve\Scripts\activate.ps1"
|
|
9
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
13
10
|
|
|
14
11
|
# Locate the python script to run relative to the current directory (which might be a symlink)
|
|
15
12
|
$script_root = (Get-Item $PSScriptRoot).Target # resolves symlink if any
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
#~/venvs/ve/Scripts/Activate.ps1
|
|
4
|
-
. "$HOME\scripts\activate_ve.ps1" ve
|
|
2
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
5
3
|
|
|
6
4
|
# python $PSScriptRoot/../python/dotfile.py $args
|
|
7
5
|
python -m machineconfig.scripts.python.dotfile $args
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
#~/
|
|
3
|
-
. $
|
|
2
|
+
#~/code/machineconfig/.venv/Scripts/Activate.ps1
|
|
3
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
4
4
|
python $PSScriptRoot/../python/ftpx.py $args
|
|
5
5
|
deactivate -ErrorAction SilentlyContinue
|
|
@@ -18,7 +18,7 @@ $driveLetter=''
|
|
|
18
18
|
$options = "rw,sec=sys,no_subtree_check"
|
|
19
19
|
|
|
20
20
|
# . activate_ve
|
|
21
|
-
. $HOME/
|
|
21
|
+
. $HOME/code/machineconfig/.venv/Scripts/activate.ps1
|
|
22
22
|
|
|
23
23
|
python -m machineconfig.scripts.python.mount_nfs
|
|
24
24
|
. $HOME/tmp_results/shells/python_return_command.ps1
|
|
@@ -8,7 +8,7 @@ $sharePath = ''
|
|
|
8
8
|
$driveLetter = ''
|
|
9
9
|
|
|
10
10
|
# . activate_ve
|
|
11
|
-
. $HOME/
|
|
11
|
+
. $HOME/code/machineconfig/.venv/Scripts/activate.ps1
|
|
12
12
|
|
|
13
13
|
python -m machineconfig.scripts.python.mount_ssh
|
|
14
14
|
. $HOME/tmp_results/shells/python_return_command.ps1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
# . $PSScriptRoot/activate_ve.ps1
|
|
3
|
-
|
|
3
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
4
4
|
|
|
5
5
|
# python -m fire $PSScriptRoot/../python/pomodoro.py pomodoro $args
|
|
6
6
|
python -m fire machineconfig.scripts.python.pomodoro pomodoro $args
|
|
@@ -12,7 +12,7 @@ if (Test-Path $op_script ) {
|
|
|
12
12
|
# if ( $script_root -eq $null) { # this does happen if a virtual enviroment is activated before running this script (don't know why)
|
|
13
13
|
# $script_root = $PSScriptRoot
|
|
14
14
|
# }
|
|
15
|
-
.
|
|
15
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
16
16
|
|
|
17
17
|
# python $script_root/../python/repos.py $args
|
|
18
18
|
python -m machineconfig.scripts.python.repos $args
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
. $PSScriptRoot/activate_ve.ps1 've'
|
|
4
|
-
# python $PSScriptRoot/../python/wsl_windows_transfer.py $args
|
|
2
|
+
. "$HOME\code\machineconfig\.venv\Scripts\activate.ps1"
|
|
5
3
|
python -m machineconfig.scripts.python.wsl_windows_transfer $args
|
|
6
4
|
deactivate -ErrorAction SilentlyContinue
|
|
7
5
|
|
|
@@ -70,7 +70,7 @@ map <c-u> # half-up
|
|
|
70
70
|
# e edit
|
|
71
71
|
map e # edit modal key.
|
|
72
72
|
map eh $hx $f
|
|
73
|
-
map eH
|
|
73
|
+
map eH !source ~/code/machineconfig/.venv/bin/activate;hx $f
|
|
74
74
|
map en $nano $f
|
|
75
75
|
map el $lvim $f
|
|
76
76
|
map ev $nvim $f
|
|
@@ -89,6 +89,7 @@ map wr $~/scripts/croshell
|
|
|
89
89
|
map i !~/code/machineconfig/src/machineconfig/settings/lf/linux/exe/previewer.sh $f
|
|
90
90
|
map I !cat $f | gum pager
|
|
91
91
|
map R $~/scripts/croshell -r $f
|
|
92
|
+
map O $~/scripts/croshell -rj $f
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
# o file/folder Operations
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Signature: 8a477f597d28d172789f06886806bc55
|
|
@@ -33,7 +33,7 @@ require('dap').configurations.python = { {
|
|
|
33
33
|
local dap = require('dap')
|
|
34
34
|
dap.adapters.python = {
|
|
35
35
|
type = 'executable';
|
|
36
|
-
command = "C:/Users/alex/
|
|
36
|
+
command = "C:/Users/alex/code/machineconfig/.venv/Scripts/python.exe";
|
|
37
37
|
args = {"-i" };
|
|
38
38
|
}
|
|
39
39
|
|