machineconfig 1.94__py3-none-any.whl → 1.96__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 +445 -343
- machineconfig/cluster/data_transfer.py +63 -56
- machineconfig/cluster/distribute.py +284 -280
- machineconfig/cluster/file_manager.py +234 -237
- machineconfig/cluster/job_params.py +133 -133
- machineconfig/cluster/loader_runner.py +183 -149
- machineconfig/cluster/remote_machine.py +269 -252
- machineconfig/cluster/script_execution.py +215 -209
- machineconfig/cluster/script_notify_upon_completion.py +50 -43
- machineconfig/cluster/self_ssh.py +52 -54
- machineconfig/cluster/sessions_managers/__init__.py +0 -0
- machineconfig/cluster/sessions_managers/archive/__init__.py +0 -0
- machineconfig/{jobs/python → cluster/sessions_managers/archive}/create_zellij_template.py +5 -3
- machineconfig/cluster/sessions_managers/archive/session_managers.py +184 -0
- machineconfig/cluster/sessions_managers/demo_rich_zellij.py +0 -0
- machineconfig/cluster/sessions_managers/enhanced_command_runner.py +160 -0
- machineconfig/cluster/sessions_managers/wt_local.py +494 -0
- machineconfig/cluster/sessions_managers/wt_local_manager.py +577 -0
- machineconfig/cluster/sessions_managers/wt_remote.py +288 -0
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +483 -0
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +196 -0
- machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +418 -0
- machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +175 -0
- machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +300 -0
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +228 -0
- machineconfig/cluster/sessions_managers/zellij_local.py +418 -0
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +533 -0
- machineconfig/cluster/sessions_managers/zellij_remote.py +229 -0
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +188 -0
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +64 -0
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +126 -0
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +334 -0
- machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +68 -0
- machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +119 -0
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +85 -0
- machineconfig/cluster/templates/cli_click.py +0 -1
- machineconfig/cluster/templates/cli_gooey.py +102 -104
- machineconfig/cluster/templates/run_cloud.py +51 -51
- machineconfig/cluster/templates/run_cluster.py +103 -59
- machineconfig/cluster/templates/run_remote.py +57 -58
- machineconfig/cluster/templates/utils.py +69 -36
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/linux/msc/lid.sh +2 -4
- machineconfig/jobs/linux/msc/network.sh +3 -6
- machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/check_installations.py +258 -190
- machineconfig/jobs/python/create_bootable_media.py +7 -3
- machineconfig/jobs/python/python_cargo_build_share.py +50 -50
- machineconfig/jobs/python/python_ve_symlink.py +10 -10
- machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
- machineconfig/jobs/python/vscode/api.py +3 -3
- machineconfig/jobs/python/vscode/link_ve.py +6 -6
- machineconfig/jobs/python/vscode/select_interpreter.py +13 -9
- machineconfig/jobs/python/vscode/sync_code.py +14 -11
- machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +5 -5
- machineconfig/jobs/python_custom_installers/dev/aider.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +7 -6
- machineconfig/jobs/python_custom_installers/dev/brave.py +11 -7
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +7 -8
- machineconfig/jobs/python_custom_installers/dev/code.py +7 -5
- machineconfig/jobs/python_custom_installers/dev/cursor.py +66 -5
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +4 -5
- machineconfig/jobs/python_custom_installers/dev/espanso.py +21 -17
- machineconfig/jobs/python_custom_installers/dev/goes.py +6 -12
- machineconfig/jobs/python_custom_installers/dev/lvim.py +7 -6
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +5 -5
- machineconfig/jobs/python_custom_installers/dev/redis.py +11 -7
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +12 -8
- machineconfig/jobs/python_custom_installers/dev/winget.py +194 -0
- machineconfig/jobs/python_custom_installers/{dev/docker.py → docker.py} +12 -7
- machineconfig/jobs/python_custom_installers/gh.py +10 -9
- machineconfig/jobs/python_custom_installers/hx.py +36 -65
- machineconfig/jobs/python_custom_installers/scripts/linux/brave.sh +4 -8
- machineconfig/jobs/python_custom_installers/scripts/linux/docker.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/docker_start.sh +3 -6
- machineconfig/jobs/python_custom_installers/scripts/linux/edge.sh +3 -6
- machineconfig/jobs/python_custom_installers/scripts/linux/nerdfont.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/pgsql.sh +4 -8
- machineconfig/jobs/python_custom_installers/scripts/linux/redis.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/timescaledb.sh +6 -12
- machineconfig/jobs/python_custom_installers/scripts/linux/vscode.sh +101 -33
- machineconfig/jobs/python_custom_installers/scripts/linux/warp-cli.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/wezterm.sh +3 -6
- machineconfig/jobs/python_custom_installers/{dev/warp-cli.py → warp-cli.py} +5 -5
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/config.json +133 -9
- machineconfig/jobs/python_generic_installers/dev/config.json +208 -37
- machineconfig/jobs/python_generic_installers/update.py +3 -0
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_linux_installers/config.json +42 -6
- machineconfig/jobs/python_linux_installers/dev/config.json +79 -11
- machineconfig/jobs/python_windows_installers/config.json +6 -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/profile/create.py +5 -5
- machineconfig/profile/create_hardlinks.py +5 -5
- machineconfig/profile/shell.py +69 -63
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/cloud/init.sh +9 -18
- machineconfig/scripts/linux/fire +5 -24
- machineconfig/scripts/linux/fire_agents +27 -0
- machineconfig/scripts/linux/share_cloud.sh +6 -12
- machineconfig/scripts/linux/wifi_conn +24 -0
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/__init__.cpython-313.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/archive/im2text.py +28 -30
- machineconfig/scripts/python/archive/tmate_conn.py +10 -13
- machineconfig/scripts/python/archive/tmate_start.py +12 -16
- machineconfig/scripts/python/choose_wezterm_theme.py +12 -21
- machineconfig/scripts/python/cloud_copy.py +49 -104
- machineconfig/scripts/python/cloud_manager.py +77 -91
- machineconfig/scripts/python/cloud_mount.py +36 -46
- machineconfig/scripts/python/cloud_repo_sync.py +33 -79
- machineconfig/scripts/python/cloud_sync.py +35 -45
- machineconfig/scripts/python/croshell.py +70 -92
- machineconfig/scripts/python/devops.py +54 -113
- machineconfig/scripts/python/devops_add_identity.py +71 -109
- machineconfig/scripts/python/devops_add_ssh_key.py +42 -149
- machineconfig/scripts/python/devops_backup_retrieve.py +31 -119
- machineconfig/scripts/python/devops_devapps_install.py +6 -10
- machineconfig/scripts/python/devops_update_repos.py +5 -4
- machineconfig/scripts/python/dotfile.py +10 -7
- machineconfig/scripts/python/fire_agents.py +69 -0
- machineconfig/scripts/python/fire_jobs.py +117 -78
- machineconfig/scripts/python/ftpx.py +8 -8
- machineconfig/scripts/python/get_zellij_cmd.py +3 -3
- machineconfig/scripts/python/gh_models.py +6 -4
- 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/python/helpers/cloud_helpers.py +49 -46
- machineconfig/scripts/python/helpers/helpers2.py +26 -39
- machineconfig/scripts/python/helpers/helpers4.py +23 -35
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +33 -67
- machineconfig/scripts/python/mount_nfs.py +8 -11
- machineconfig/scripts/python/mount_nw_drive.py +4 -4
- machineconfig/scripts/python/mount_ssh.py +2 -2
- machineconfig/scripts/python/onetimeshare.py +56 -57
- machineconfig/scripts/python/pomodoro.py +55 -55
- machineconfig/scripts/python/repos.py +72 -49
- machineconfig/scripts/python/scheduler.py +70 -53
- machineconfig/scripts/python/snapshot.py +21 -24
- machineconfig/scripts/python/start_slidev.py +6 -5
- machineconfig/scripts/python/start_terminals.py +3 -1
- machineconfig/scripts/python/viewer.py +5 -4
- machineconfig/scripts/python/viewer_template.py +138 -140
- machineconfig/scripts/python/wifi_conn.py +416 -62
- machineconfig/scripts/python/wsl_windows_transfer.py +18 -3
- machineconfig/scripts/windows/fire.ps1 +27 -15
- machineconfig/settings/linters/.pylintrc +6 -7
- machineconfig/settings/lvim/windows/config.lua +0 -0
- machineconfig/settings/shells/bash/init.sh +6 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +7 -6
- machineconfig/settings/shells/pwsh/init.ps1 +6 -6
- machineconfig/settings/shells/wt/settings.json +51 -266
- machineconfig/setup_linux/nix/cli_installation.sh +9 -18
- machineconfig/setup_linux/others/openssh-server_add_pub_key.sh +3 -6
- machineconfig/setup_linux/web_shortcuts/all.sh +5 -10
- machineconfig/setup_linux/web_shortcuts/ascii_art.sh +7 -14
- machineconfig/setup_linux/web_shortcuts/croshell.sh +6 -12
- machineconfig/setup_linux/web_shortcuts/interactive.sh +39 -70
- machineconfig/setup_linux/web_shortcuts/ssh.sh +8 -16
- machineconfig/setup_linux/web_shortcuts/update_system.sh +7 -14
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +3 -6
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +27 -21
- machineconfig/utils/ai/browser_user_wrapper.py +60 -45
- machineconfig/utils/ai/generate_file_checklist.py +4 -7
- machineconfig/utils/ai/url2md.py +15 -7
- machineconfig/utils/cloud/onedrive/setup_oauth.py +59 -0
- machineconfig/utils/cloud/onedrive/transaction.py +796 -0
- machineconfig/utils/{utils_code.py → code.py} +25 -22
- machineconfig/utils/installer.py +81 -44
- machineconfig/utils/installer_utils/installer_abc.py +7 -6
- machineconfig/utils/installer_utils/installer_class.py +44 -25
- machineconfig/utils/io_save.py +107 -0
- machineconfig/utils/{utils_links.py → links.py} +28 -35
- machineconfig/utils/{utils_options.py → options.py} +14 -28
- machineconfig/utils/path.py +112 -0
- machineconfig/utils/path_reduced.py +608 -0
- machineconfig/utils/procs.py +134 -73
- machineconfig/utils/scheduling.py +312 -222
- machineconfig/utils/utils.py +19 -26
- machineconfig/utils/utils2.py +42 -0
- machineconfig/utils/utils5.py +84 -0
- machineconfig/utils/ve.py +49 -103
- {machineconfig-1.94.dist-info → machineconfig-1.96.dist-info}/METADATA +5 -3
- machineconfig-1.96.dist-info/RECORD +437 -0
- {machineconfig-1.94.dist-info → machineconfig-1.96.dist-info}/WHEEL +1 -1
- machineconfig/cluster/session_managers.py +0 -183
- machineconfig/cluster/templates/f.py +0 -4
- machineconfig/jobs/python/__pycache__/check_installations.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/checkout_version.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
- machineconfig/jobs/python/checkout_version.py +0 -123
- machineconfig/jobs/python/vscode/__pycache__/api.cpython-311.pyc +0 -0
- machineconfig/jobs/python/vscode/__pycache__/link_ve.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/__pycache__/hx.cpython-311.pyc +0 -0
- machineconfig/jobs/python_windows_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/.mypy_cache/.gitignore +0 -2
- machineconfig/scripts/python/.mypy_cache/3.11/@plugins_snapshot.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/__future__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/__future__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_ast.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_ast.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_bz2.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_bz2.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_codecs.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_codecs.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_collections_abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_collections_abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_compression.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_compression.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_decimal.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_decimal.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib_external.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib_external.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_io.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_io.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_locale.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_locale.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_stat.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_stat.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_struct.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_struct.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_thread.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_thread.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/importlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/importlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_warnings.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_warnings.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakref.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakref.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakrefset.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakrefset.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/argparse.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/argparse.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/ast.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/ast.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/binascii.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/binascii.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/builtins.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/builtins.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/bz2.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/bz2.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/calendar.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/calendar.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/codecs.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/codecs.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/configparser.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/configparser.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/contextlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/contextlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dataclasses.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dataclasses.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/datetime.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/datetime.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/decimal.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/decimal.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dis.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dis.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/_policybase.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/_policybase.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/charset.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/charset.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/contentmanager.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/contentmanager.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/errors.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/errors.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/header.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/header.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/message.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/message.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/policy.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/policy.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/enum.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/enum.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/fnmatch.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/fnmatch.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/functools.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/functools.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/genericpath.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/genericpath.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/getpass.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/getpass.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/cmd.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/cmd.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/compat.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/compat.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/config.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/config.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/db.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/db.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/diff.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/diff.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/exc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/exc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/fun.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/fun.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/typ.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/typ.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/blob.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/blob.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/commit.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/commit.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/fun.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/fun.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/root.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/root.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tag.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tag.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tree.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tree.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/head.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/head.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/log.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/log.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/reference.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/reference.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/remote.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/remote.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/symbolic.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/symbolic.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/tag.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/tag.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/remote.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/remote.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/fun.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/fun.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/types.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/types.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/glob.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/glob.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gzip.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gzip.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap_external.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap_external.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/machinery.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/machinery.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/_meta.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/_meta.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/readers.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/readers.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/_common.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/_common.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/inspect.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/inspect.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/io.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/io.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/itertools.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/itertools.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/locale.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/locale.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/logging/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/logging/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mimetypes.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mimetypes.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mmap.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mmap.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/numbers.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/numbers.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/opcode.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/opcode.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/path.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/path.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/pathlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/pathlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/platform.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/platform.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/posixpath.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/posixpath.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/re.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/re.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/resource.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/resource.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shlex.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shlex.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shutil.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shutil.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/signal.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/signal.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/python/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/python/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_compile.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_compile.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_constants.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_constants.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_parse.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_parse.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/stat.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/stat.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/string.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/string.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/struct.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/struct.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/subprocess.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/subprocess.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sys/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sys/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tarfile.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tarfile.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tempfile.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tempfile.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/textwrap.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/textwrap.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/threading.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/threading.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/time.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/time.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/types.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/types.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing_extensions.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing_extensions.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/parse.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/parse.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/uuid.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/uuid.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/warnings.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/warnings.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/weakref.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/weakref.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zipfile/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zipfile/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/CACHEDIR.TAG +0 -3
- machineconfig/scripts/python/__pycache__/cloud_repo_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/gh_models.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/url2md.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/viewer.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/vscode_api.cpython-311.pyc +0 -0
- machineconfig/settings/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/linters/.ruff_cache/.gitignore +0 -2
- machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +0 -1
- machineconfig/settings/shells/ipy/profiles/default/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/playext.cpython-311.pyc +0 -0
- machineconfig/utils/utils_path.py +0 -151
- machineconfig/utils/ve_utils/ve1.py +0 -111
- machineconfig/utils/ve_utils/ve2.py +0 -142
- machineconfig-1.94.dist-info/RECORD +0 -710
- {machineconfig-1.94.dist-info → machineconfig-1.96.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
"""Wifi connect
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Linux requirements:
|
|
4
|
+
- sudo apt-get install network-manager
|
|
5
|
+
|
|
6
|
+
Windows requirements:
|
|
7
|
+
- Run as Administrator for netsh commands
|
|
8
|
+
|
|
9
|
+
Configuration file format (wifi.ini):
|
|
10
|
+
[MyPhoneHotSpot]
|
|
11
|
+
SSID = MyPhoneHotSpot
|
|
12
|
+
pwd = mypassword123
|
|
13
|
+
|
|
14
|
+
[HomeWiFi]
|
|
15
|
+
SSID = HomeNetwork
|
|
16
|
+
pwd = homepassword456
|
|
17
|
+
|
|
18
|
+
Configuration file locations checked (in order):
|
|
19
|
+
- ~/dotfiles/machineconfig/setup/wifi.ini
|
|
20
|
+
- ~/.config/wifi.ini
|
|
21
|
+
- ./wifi.ini
|
|
22
|
+
|
|
23
|
+
Usage examples:
|
|
24
|
+
python wifi_conn.py # Use default SSID from config
|
|
25
|
+
python wifi_conn.py -n HomeWiFi # Use specific configured network
|
|
26
|
+
python wifi_conn.py -m # Manual network selection
|
|
27
|
+
python wifi_conn.py -l # List available networks only
|
|
4
28
|
|
|
5
29
|
"""
|
|
6
30
|
|
|
@@ -10,81 +34,411 @@ from pathlib import Path
|
|
|
10
34
|
import os
|
|
11
35
|
import platform
|
|
12
36
|
import subprocess
|
|
37
|
+
import getpass
|
|
38
|
+
from typing import List, Dict, Optional
|
|
39
|
+
from rich.console import Console
|
|
40
|
+
from rich.panel import Panel
|
|
41
|
+
from rich.prompt import Prompt, Confirm
|
|
42
|
+
from rich.table import Table
|
|
13
43
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
console = Console()
|
|
45
|
+
|
|
46
|
+
def get_available_networks() -> List[Dict[str, str]]:
|
|
47
|
+
"""Get list of available WiFi networks"""
|
|
48
|
+
networks = []
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
if platform.system() == "Windows":
|
|
52
|
+
result = subprocess.run(
|
|
53
|
+
["netsh", "wlan", "show", "profiles"],
|
|
54
|
+
capture_output=True, text=True, check=True
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
for line in result.stdout.split('\n'):
|
|
58
|
+
if 'All User Profile' in line:
|
|
59
|
+
ssid = line.split(':')[1].strip()
|
|
60
|
+
networks.append({"ssid": ssid, "signal": "Unknown"})
|
|
61
|
+
|
|
62
|
+
# Also get available networks
|
|
63
|
+
result = subprocess.run(
|
|
64
|
+
["netsh", "wlan", "show", "networks"],
|
|
65
|
+
capture_output=True, text=True, check=True
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
current_ssid = None
|
|
69
|
+
for line in result.stdout.split('\n'):
|
|
70
|
+
if 'SSID' in line and 'BSSID' not in line:
|
|
71
|
+
current_ssid = line.split(':')[1].strip()
|
|
72
|
+
elif 'Signal' in line and current_ssid:
|
|
73
|
+
signal = line.split(':')[1].strip()
|
|
74
|
+
# Avoid duplicates
|
|
75
|
+
if not any(net['ssid'] == current_ssid for net in networks):
|
|
76
|
+
networks.append({"ssid": current_ssid, "signal": signal})
|
|
77
|
+
current_ssid = None
|
|
78
|
+
|
|
79
|
+
elif platform.system() in ["Linux", "Darwin"]:
|
|
80
|
+
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
|
+
)
|
|
85
|
+
else: # Darwin/macOS - using airport command
|
|
86
|
+
result = subprocess.run(
|
|
87
|
+
["/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport", "-s"],
|
|
88
|
+
capture_output=True, text=True, check=True
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
for line in result.stdout.strip().split('\n'):
|
|
92
|
+
if line and ':' in line:
|
|
93
|
+
parts = line.split(':')
|
|
94
|
+
if len(parts) >= 2 and parts[0].strip():
|
|
95
|
+
networks.append({
|
|
96
|
+
"ssid": parts[0].strip(),
|
|
97
|
+
"signal": f"{parts[1].strip()}%"
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
except subprocess.CalledProcessError as e:
|
|
101
|
+
console.print(f"[red]❌ Error scanning networks: {e}[/red]")
|
|
102
|
+
except Exception as e:
|
|
103
|
+
console.print(f"[red]❌ Unexpected error: {e}[/red]")
|
|
104
|
+
|
|
105
|
+
# Remove duplicates and empty SSIDs
|
|
106
|
+
seen = set()
|
|
107
|
+
unique_networks = []
|
|
108
|
+
for net in networks:
|
|
109
|
+
ssid = net['ssid']
|
|
110
|
+
if ssid and ssid not in seen:
|
|
111
|
+
seen.add(ssid)
|
|
112
|
+
unique_networks.append(net)
|
|
113
|
+
|
|
114
|
+
return unique_networks
|
|
28
115
|
|
|
116
|
+
def display_and_select_network() -> Optional[Dict[str, str]]:
|
|
117
|
+
"""Display available networks and let user select one"""
|
|
118
|
+
console.print("\n[blue]📡 Scanning for available WiFi networks...[/blue]")
|
|
119
|
+
|
|
120
|
+
networks = get_available_networks()
|
|
121
|
+
|
|
122
|
+
if not networks:
|
|
123
|
+
console.print("[red]❌ No networks found or error occurred[/red]")
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
# Display networks in a table
|
|
127
|
+
table = Table(title="Available WiFi Networks")
|
|
128
|
+
table.add_column("Index", style="cyan", no_wrap=True)
|
|
129
|
+
table.add_column("SSID", style="green")
|
|
130
|
+
table.add_column("Signal Strength", style="yellow")
|
|
131
|
+
|
|
132
|
+
for i, network in enumerate(networks, 1):
|
|
133
|
+
table.add_row(str(i), network['ssid'], network['signal'])
|
|
134
|
+
|
|
135
|
+
console.print(table)
|
|
136
|
+
|
|
137
|
+
# Let user select
|
|
138
|
+
try:
|
|
139
|
+
choice = Prompt.ask(
|
|
140
|
+
"\n[blue]Select network number (or 'q' to quit)[/blue]",
|
|
141
|
+
default="q"
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
if choice.lower() == 'q':
|
|
145
|
+
return None
|
|
146
|
+
|
|
147
|
+
index = int(choice) - 1
|
|
148
|
+
if 0 <= index < len(networks):
|
|
149
|
+
return networks[index]
|
|
150
|
+
else:
|
|
151
|
+
console.print(f"[red]❌ Invalid selection. Please choose 1-{len(networks)}[/red]")
|
|
152
|
+
return None
|
|
153
|
+
|
|
154
|
+
except ValueError:
|
|
155
|
+
console.print("[red]❌ Invalid input. Please enter a number.[/red]")
|
|
156
|
+
return None
|
|
29
157
|
def connect(name: str, ssid: str):
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
158
|
+
"""Connect to a WiFi network"""
|
|
159
|
+
console.print(f"\n[blue]🌐 Connecting to network: {name} (SSID: {ssid})[/blue]")
|
|
160
|
+
|
|
161
|
+
try:
|
|
162
|
+
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
|
+
)
|
|
167
|
+
elif platform.system() == "Linux":
|
|
168
|
+
subprocess.run(f"nmcli connection up '{name}'", shell=True, check=True)
|
|
169
|
+
|
|
170
|
+
console.print("[green]✅ Connected successfully![/green]\n")
|
|
171
|
+
|
|
172
|
+
except subprocess.CalledProcessError as e:
|
|
173
|
+
console.print(f"[red]❌ Error connecting: {e}[/red]")
|
|
174
|
+
raise
|
|
175
|
+
except Exception as e:
|
|
176
|
+
console.print(f"[red]❌ Unexpected error: {e}[/red]")
|
|
177
|
+
raise
|
|
178
|
+
|
|
179
|
+
def connect_to_new_network(ssid: str, password: str):
|
|
180
|
+
"""Connect to a new network with SSID and password"""
|
|
181
|
+
try:
|
|
182
|
+
if platform.system() == "Windows":
|
|
183
|
+
# For Windows, we create a temporary profile and connect
|
|
184
|
+
create_new_connection(ssid, ssid, password)
|
|
185
|
+
connect(ssid, ssid)
|
|
186
|
+
elif platform.system() == "Linux":
|
|
187
|
+
# For Linux, we can connect directly or create a connection
|
|
188
|
+
try:
|
|
189
|
+
# Try to connect directly first
|
|
190
|
+
command = f"nmcli device wifi connect '{ssid}' password '{password}'"
|
|
191
|
+
subprocess.run(command, shell=True, check=True)
|
|
192
|
+
console.print("[green]✅ Connected successfully![/green]\n")
|
|
193
|
+
except subprocess.CalledProcessError:
|
|
194
|
+
# If direct connection fails, create a connection profile
|
|
195
|
+
create_new_connection(ssid, ssid, password)
|
|
196
|
+
connect(ssid, ssid)
|
|
197
|
+
|
|
198
|
+
except Exception as e:
|
|
199
|
+
console.print(f"[red]❌ Failed to connect to {ssid}: {e}[/red]")
|
|
200
|
+
raise
|
|
38
201
|
|
|
39
202
|
def display_available_networks():
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
203
|
+
"""Display available networks (legacy function for compatibility)"""
|
|
204
|
+
console.print("\n[blue]📡 Scanning for available networks...[/blue]")
|
|
205
|
+
|
|
206
|
+
try:
|
|
207
|
+
if platform.system() == "Windows":
|
|
208
|
+
subprocess.run(["netsh", "wlan", "show", "networks", "interface=Wi-Fi"], check=True)
|
|
209
|
+
elif platform.system() == "Linux":
|
|
210
|
+
subprocess.run(["nmcli", "device", "wifi", "list"], check=True)
|
|
211
|
+
|
|
212
|
+
console.print("[green]✅ Network scan completed![/green]\n")
|
|
213
|
+
|
|
214
|
+
except subprocess.CalledProcessError as e:
|
|
215
|
+
console.print(f"[red]❌ Error scanning networks: {e}[/red]")
|
|
216
|
+
except Exception as e:
|
|
217
|
+
console.print(f"[red]❌ Unexpected error: {e}[/red]")
|
|
46
218
|
|
|
47
|
-
def
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
219
|
+
def try_config_connection(config_ssid: str) -> bool:
|
|
220
|
+
"""Try to connect using configuration file"""
|
|
221
|
+
try:
|
|
222
|
+
config_paths = [
|
|
223
|
+
Path.home() / 'dotfiles/machineconfig/setup/wifi.ini',
|
|
224
|
+
Path.home() / '.config/wifi.ini',
|
|
225
|
+
Path.cwd() / 'wifi.ini'
|
|
226
|
+
]
|
|
227
|
+
|
|
228
|
+
creds = configparser.ConfigParser()
|
|
229
|
+
config_found = False
|
|
230
|
+
|
|
231
|
+
for config_path in config_paths:
|
|
232
|
+
if config_path.exists():
|
|
233
|
+
creds.read(config_path)
|
|
234
|
+
config_found = True
|
|
235
|
+
break
|
|
236
|
+
|
|
237
|
+
if not config_found:
|
|
238
|
+
console.print("[yellow]⚠️ No WiFi configuration file found in standard locations[/yellow]")
|
|
239
|
+
return False
|
|
240
|
+
|
|
241
|
+
if config_ssid not in creds:
|
|
242
|
+
console.print(f"[yellow]⚠️ SSID '{config_ssid}' not found in configuration[/yellow]")
|
|
243
|
+
available_ssids = list(creds.sections())
|
|
244
|
+
if available_ssids:
|
|
245
|
+
console.print(f"[blue]Available configured networks: {', '.join(available_ssids)}[/blue]")
|
|
246
|
+
return False
|
|
247
|
+
|
|
248
|
+
ssid = creds[config_ssid]['SSID']
|
|
249
|
+
password = creds[config_ssid]['pwd']
|
|
250
|
+
|
|
251
|
+
console.print(f"[green]✅ Found configuration for {config_ssid}[/green]")
|
|
252
|
+
connect_to_new_network(ssid, password)
|
|
253
|
+
return True
|
|
254
|
+
|
|
255
|
+
except Exception as e:
|
|
256
|
+
console.print(f"[red]❌ Error reading configuration: {e}[/red]")
|
|
257
|
+
return False
|
|
51
258
|
|
|
52
|
-
|
|
53
|
-
|
|
259
|
+
def manual_network_selection() -> bool:
|
|
260
|
+
"""Manual network selection and connection"""
|
|
261
|
+
network = display_and_select_network()
|
|
262
|
+
|
|
263
|
+
if not network:
|
|
264
|
+
return False
|
|
265
|
+
|
|
266
|
+
ssid = network['ssid']
|
|
267
|
+
console.print(f"\n[blue]Selected network: {ssid}[/blue]")
|
|
268
|
+
|
|
269
|
+
# Get password from user
|
|
270
|
+
password = getpass.getpass(f"Enter password for '{ssid}': ")
|
|
271
|
+
|
|
272
|
+
if not password:
|
|
273
|
+
console.print("[red]❌ Password cannot be empty[/red]")
|
|
274
|
+
return False
|
|
275
|
+
|
|
276
|
+
try:
|
|
277
|
+
connect_to_new_network(ssid, password)
|
|
278
|
+
return True
|
|
279
|
+
except Exception:
|
|
280
|
+
return False
|
|
281
|
+
|
|
282
|
+
def main():
|
|
283
|
+
"""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
|
+
))
|
|
54
289
|
|
|
55
290
|
parser = argparse.ArgumentParser(description='WiFi Connector')
|
|
56
|
-
parser.add_argument('-n', "--ssid", help="🔗 SSID of WiFi", default='MyPhoneHotSpot')
|
|
291
|
+
parser.add_argument('-n', "--ssid", help="🔗 SSID of WiFi (from config)", default='MyPhoneHotSpot')
|
|
292
|
+
parser.add_argument('-m', "--manual", action='store_true', help="🔍 Manual network selection mode")
|
|
293
|
+
parser.add_argument('-l', "--list", action='store_true', help="📡 List available networks only")
|
|
57
294
|
|
|
58
295
|
args = parser.parse_args()
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
296
|
+
|
|
297
|
+
# If user just wants to list networks
|
|
298
|
+
if args.list:
|
|
299
|
+
display_available_networks()
|
|
300
|
+
return
|
|
301
|
+
|
|
302
|
+
# If user wants manual mode, skip config and go straight to selection
|
|
303
|
+
if args.manual:
|
|
304
|
+
console.print("[blue]🔍 Manual network selection mode[/blue]")
|
|
305
|
+
if manual_network_selection():
|
|
306
|
+
console.print("[green]🎉 Successfully connected![/green]")
|
|
307
|
+
else:
|
|
308
|
+
console.print("[red]❌ Failed to connect[/red]")
|
|
309
|
+
return
|
|
310
|
+
|
|
311
|
+
# Try to connect using configuration first
|
|
312
|
+
console.print(f"[blue]🔍 Attempting to connect to configured network: {args.ssid}[/blue]")
|
|
313
|
+
|
|
314
|
+
if try_config_connection(args.ssid):
|
|
315
|
+
console.print("[green]🎉 Successfully connected using configuration![/green]")
|
|
316
|
+
return
|
|
317
|
+
|
|
318
|
+
# Configuration failed, offer fallback options
|
|
319
|
+
console.print("\n[yellow]⚠️ Configuration connection failed or not available[/yellow]")
|
|
320
|
+
|
|
321
|
+
if Confirm.ask("[blue]Would you like to manually select a network?[/blue]", default=True):
|
|
322
|
+
if manual_network_selection():
|
|
323
|
+
console.print("[green]🎉 Successfully connected![/green]")
|
|
324
|
+
else:
|
|
325
|
+
console.print("[red]❌ Failed to connect[/red]")
|
|
326
|
+
else:
|
|
327
|
+
console.print("[blue]👋 Goodbye![/blue]")
|
|
64
328
|
|
|
65
329
|
def get_current_wifi_name() -> str:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
330
|
+
"""Get the name of the currently connected WiFi network"""
|
|
331
|
+
console.print("\n[blue]🔍 Checking current WiFi connection...[/blue]")
|
|
332
|
+
|
|
333
|
+
try:
|
|
334
|
+
if platform.system() == "Windows":
|
|
335
|
+
result = subprocess.run(
|
|
336
|
+
["netsh", "wlan", "show", "interface"],
|
|
337
|
+
capture_output=True, text=True, check=True
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
for line in result.stdout.split("\n"):
|
|
341
|
+
if "SSID" in line and "BSSID" not in line:
|
|
342
|
+
wifi_name = line.split(":")[1].strip()
|
|
343
|
+
if wifi_name:
|
|
344
|
+
console.print(f"[green]✅ Connected to: {wifi_name}[/green]\n")
|
|
345
|
+
return wifi_name
|
|
346
|
+
|
|
347
|
+
console.print("[yellow]⚠️ Not connected to WiFi[/yellow]\n")
|
|
76
348
|
return "Not connected to WiFi"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
349
|
+
|
|
350
|
+
elif platform.system() == "Linux":
|
|
351
|
+
result = subprocess.run(
|
|
352
|
+
["iwgetid", "-r"],
|
|
353
|
+
capture_output=True, text=True, check=True
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
wifi_name = result.stdout.strip()
|
|
357
|
+
if wifi_name:
|
|
358
|
+
console.print(f"[green]✅ Connected to: {wifi_name}[/green]\n")
|
|
359
|
+
return wifi_name
|
|
360
|
+
else:
|
|
361
|
+
console.print("[yellow]⚠️ Not connected to WiFi[/yellow]\n")
|
|
362
|
+
return "Not connected to WiFi"
|
|
363
|
+
|
|
364
|
+
except subprocess.CalledProcessError:
|
|
365
|
+
console.print("[yellow]⚠️ Not connected to WiFi or unable to detect[/yellow]\n")
|
|
366
|
+
return "Not connected to WiFi"
|
|
367
|
+
except Exception as e:
|
|
368
|
+
console.print(f"[red]❌ Error: {e}[/red]\n")
|
|
369
|
+
return "Error detecting WiFi"
|
|
370
|
+
|
|
371
|
+
console.print("[yellow]⚠️ System not supported[/yellow]\n")
|
|
372
|
+
return "System not supported"
|
|
373
|
+
|
|
374
|
+
def create_new_connection(name: str, ssid: str, password: str):
|
|
375
|
+
"""Create a new WiFi connection profile"""
|
|
376
|
+
console.print(f"\n[blue]🔧 Creating new connection: {name} (SSID: {ssid})[/blue]")
|
|
377
|
+
|
|
378
|
+
try:
|
|
379
|
+
if platform.system() == "Windows":
|
|
380
|
+
# Create proper Windows WiFi profile XML
|
|
381
|
+
xml_config = f"""<?xml version="1.0"?>
|
|
382
|
+
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
|
|
383
|
+
<name>{name}</name>
|
|
384
|
+
<SSIDConfig>
|
|
385
|
+
<SSID>
|
|
386
|
+
<name>{ssid}</name>
|
|
387
|
+
</SSID>
|
|
388
|
+
</SSIDConfig>
|
|
389
|
+
<connectionType>ESS</connectionType>
|
|
390
|
+
<connectionMode>auto</connectionMode>
|
|
391
|
+
<MSM>
|
|
392
|
+
<security>
|
|
393
|
+
<authEncryption>
|
|
394
|
+
<authentication>WPA2PSK</authentication>
|
|
395
|
+
<encryption>AES</encryption>
|
|
396
|
+
<useOneX>false</useOneX>
|
|
397
|
+
</authEncryption>
|
|
398
|
+
<sharedKey>
|
|
399
|
+
<keyType>passPhrase</keyType>
|
|
400
|
+
<protected>false</protected>
|
|
401
|
+
<keyMaterial>{password}</keyMaterial>
|
|
402
|
+
</sharedKey>
|
|
403
|
+
</security>
|
|
404
|
+
</MSM>
|
|
405
|
+
</WLANProfile>"""
|
|
406
|
+
|
|
407
|
+
profile_path = f"{name}.xml"
|
|
408
|
+
with open(profile_path, 'w', encoding='utf-8') as file:
|
|
409
|
+
file.write(xml_config)
|
|
410
|
+
|
|
411
|
+
subprocess.run(
|
|
412
|
+
["netsh", "wlan", "add", "profile", f"filename={profile_path}", "interface=Wi-Fi"],
|
|
413
|
+
capture_output=True, text=True, check=True
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
# Clean up the XML file
|
|
417
|
+
try:
|
|
418
|
+
os.remove(profile_path)
|
|
419
|
+
except OSError:
|
|
420
|
+
pass
|
|
421
|
+
|
|
422
|
+
elif platform.system() == "Linux":
|
|
423
|
+
# Check if connection already exists
|
|
424
|
+
check_cmd = f"nmcli connection show '{name}'"
|
|
425
|
+
check_result = subprocess.run(check_cmd, shell=True, capture_output=True)
|
|
426
|
+
|
|
427
|
+
if check_result.returncode == 0:
|
|
428
|
+
console.print(f"[yellow]⚠️ Connection '{name}' already exists, deleting old one...[/yellow]")
|
|
429
|
+
subprocess.run(f"nmcli connection delete '{name}'", shell=True, check=True)
|
|
430
|
+
|
|
431
|
+
command = f"nmcli connection add type wifi con-name '{name}' ssid '{ssid}' wifi-sec.key-mgmt wpa-psk wifi-sec.psk '{password}'"
|
|
432
|
+
subprocess.run(command, shell=True, check=True)
|
|
433
|
+
|
|
434
|
+
console.print("[green]✅ Connection created successfully![/green]\n")
|
|
435
|
+
|
|
436
|
+
except subprocess.CalledProcessError as e:
|
|
437
|
+
console.print(f"[red]❌ Error creating connection: {e}[/red]")
|
|
438
|
+
raise
|
|
439
|
+
except Exception as e:
|
|
440
|
+
console.print(f"[red]❌ Unexpected error: {e}[/red]")
|
|
441
|
+
raise
|
|
88
442
|
|
|
89
443
|
if __name__ == '__main__':
|
|
90
444
|
main()
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
"""TWSL
|
|
2
2
|
"""
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
from crocodile.environment import WIN_FROM_WSL, system, WSL_FROM_WIN, UserName
|
|
4
|
+
from machineconfig.utils.path_reduced import P as PathExtended
|
|
6
5
|
import argparse
|
|
6
|
+
import platform
|
|
7
|
+
import getpass
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
system = platform.system() # e.g. "Windows", "Linux", "Darwin" (macOS)
|
|
11
|
+
# HostName = platform.node() # e.g. "MY-SURFACE", os.env["COMPUTERNAME") only works for windows.
|
|
12
|
+
UserName = getpass.getuser() # e.g: username, os.env["USERNAME") only works for windows.
|
|
13
|
+
# UserDomain = os.environ["USERDOMAIN"] # e.g. HAD OR MY-SURFACE
|
|
14
|
+
# UserDomainRoaming = PathExtended(os.environ["USERDOMAIN_ROAMINGPROFILE"]) # e.g. SURFACE
|
|
15
|
+
# LogonServer = os.environ["LOGONSERVER"] # e.g. "\\MY-SURFACE"
|
|
16
|
+
# UserProfile = PathExtended(os.env["USERPROFILE")) # e.g C:\Users\username
|
|
17
|
+
# HomePath = PathExtended(os.env["HOMEPATH")) # e.g. C:\Users\username
|
|
18
|
+
# Public = PathExtended(os.environ["PUBLIC"]) # C:\Users\Public
|
|
19
|
+
|
|
20
|
+
WSL_FROM_WIN = Path(r"\\wsl.localhost\Ubuntu-22.04\home") # PathExtended(rf"\\wsl$\Ubuntu\home") # see localappdata/canonical
|
|
21
|
+
WIN_FROM_WSL = Path(r"/mnt/c/Users")
|
|
7
22
|
|
|
8
23
|
|
|
9
24
|
def main():
|
|
@@ -28,7 +43,7 @@ Otherwise, a flag must be raised to indicate the direction.""")
|
|
|
28
43
|
parser.add_argument("--zip_first", "-z", help="📦 Zip before transferring.", action="store_true") # default is False
|
|
29
44
|
|
|
30
45
|
args = parser.parse_args()
|
|
31
|
-
path =
|
|
46
|
+
path = PathExtended(args.path).expanduser().absolute()
|
|
32
47
|
|
|
33
48
|
if args.same_file_system:
|
|
34
49
|
print("⚠️ Using a not recommended transfer method! Copying files across the same file system.")
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
# param(
|
|
3
|
+
# [switch]$IgnoreKeyboardInterrupt
|
|
4
|
+
# )
|
|
5
|
+
|
|
6
|
+
# Generate a random string of 10 characters
|
|
7
|
+
$random_str = -join ((65..90) + (97..122) + (48..57) | Get-Random -Count 10 | ForEach-Object {[char]$_})
|
|
8
|
+
$op_script = "$HOME\tmp_results\shells\$random_str\python_return_command.ps1"
|
|
9
|
+
# Export the op_script variable to environment so python can access it
|
|
10
|
+
$env:op_script = $op_script
|
|
11
|
+
|
|
12
|
+
# Create directory if it doesn't exist
|
|
13
|
+
$script_dir = Split-Path -Path $op_script -Parent
|
|
14
|
+
if (-not (Test-Path $script_dir)) {
|
|
15
|
+
New-Item -ItemType Directory -Path $script_dir -Force | Out-Null
|
|
5
16
|
}
|
|
6
17
|
|
|
18
|
+
# if (Test-Path $op_script ) {
|
|
19
|
+
# Remove-Item $op_script
|
|
20
|
+
# }
|
|
7
21
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
|
|
23
|
+
# try {
|
|
24
|
+
# # $null = & chafa --version
|
|
25
|
+
# # & chafa "$HOME\code\machineconfig\assets\aafire.webp" --speed 2 --duration 1
|
|
26
|
+
# # Chafa.exe "$HOME\code\machineconfig\assets\aafire.webp" --speed 2 --duration 1 --symbols ascii
|
|
27
|
+
# Write-Host "🔥"
|
|
28
|
+
# } catch {
|
|
29
|
+
# Write-Host "Chafa not found, skipping."
|
|
30
|
+
# }
|
|
16
31
|
|
|
17
32
|
|
|
18
33
|
. "$HOME\scripts\activate_ve.ps1" ve
|
|
@@ -21,13 +36,10 @@ python -m machineconfig.scripts.python.fire_jobs $args
|
|
|
21
36
|
|
|
22
37
|
if (Test-Path $op_script ) {
|
|
23
38
|
. $op_script
|
|
24
|
-
# content of $op_script
|
|
25
|
-
# $content = Get-Content $op_script
|
|
26
|
-
# Invoke-Expression $content | Add-History # this way, $content will go to hisyory of powershell. You don't neet Add-history
|
|
27
39
|
}
|
|
28
40
|
else
|
|
29
41
|
{
|
|
30
|
-
Write-Host "No output script to be executed
|
|
42
|
+
Write-Host "No output script to be executed at $op_script."
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
deactivate -ErrorAction SilentlyContinue
|
|
@@ -38,24 +38,20 @@ confidence=
|
|
|
38
38
|
|
|
39
39
|
# Disable specific messages, codes, or categories.
|
|
40
40
|
disable=C0301, # line-too-long: Enforces a maximum line length
|
|
41
|
+
C0411, # wrong-import-order: Enforces correct import order
|
|
42
|
+
C0303, # trailing-whitespace: Enforces no trailing whitespace
|
|
41
43
|
C0114, # missing-module-docstring: Requires docstrings in modules
|
|
42
|
-
C0303, # trailing-whitespace: Reports trailing whitespace
|
|
43
44
|
C0321, # multiple-statements: Disallows multiple statements on one line
|
|
44
|
-
C1802, # use-list-literal: Suggests using [] instead of list()
|
|
45
45
|
C0116, # missing-function-docstring: Requires docstrings in functions
|
|
46
46
|
C0103, # invalid-name: Enforces naming conventions
|
|
47
|
-
W1309, # f-string-without-interpolation: Flags f-strings with no formatting
|
|
48
47
|
C0415, # import-outside-toplevel: Requires imports to be at the top level
|
|
49
48
|
C0115, # missing-class-docstring: Requires docstrings in classes
|
|
50
49
|
C2801, # unnecessary-dunder-call: Redundant __method() call
|
|
51
|
-
C0123, # unidiomatic-typecheck: Warns about using type() instead of isinstance()
|
|
52
|
-
C0411, # wrong-import-order: Enforces a specific import order
|
|
53
50
|
W0640, # cell-var-from-loop: Warns about loop variables used in closures
|
|
54
51
|
W0718, # broad-exception-caught: Warns when catching too broad exceptions
|
|
55
52
|
W1203, # logging-fstring-interpolation: Warns about f-strings in logging
|
|
56
53
|
W1201, # logging-not-lazy: Warns about non-lazy % logging
|
|
57
54
|
W0105, # pointless-string-statement: String statements with no effect
|
|
58
|
-
W0107, # unnecessary-pass: Unnecessary pass statements
|
|
59
55
|
W0511, # fixme: Warns about TODO, FIXME comments
|
|
60
56
|
W0221, # arguments-differ: Method arguments differ from overridden method
|
|
61
57
|
R0903, # Too few public methods (1/2) (too-few-public-methods)
|
|
@@ -64,7 +60,10 @@ disable=C0301, # line-too-long: Enforces a maximum line length
|
|
|
64
60
|
R0917, # Too many positional arguments (8/5) (too-many-positional-arguments)
|
|
65
61
|
R0902, # Too many instance attributes
|
|
66
62
|
C0410, # Multiple imports in one line.
|
|
67
|
-
|
|
63
|
+
R0912, # Too many branches (16/12) (too-many-branches)
|
|
64
|
+
R0915, # Too many statements (20/15) (too-many-stat
|
|
65
|
+
R0911, # Too many return statements (6/5) (too-many-return-statements)
|
|
66
|
+
R1702, # Too many nested blocks (5/3) (too-many-nested-blocks)
|
|
68
67
|
[REPORTS]
|
|
69
68
|
|
|
70
69
|
# Set the output format.
|
|
File without changes
|
|
@@ -64,3 +64,9 @@ eval "$(starship init bash)"
|
|
|
64
64
|
# LEVE THIS IN THE END TO AVOID EXECUTION FAILURE OF THE REST OF THE SCRIPT
|
|
65
65
|
# from https://github.com/cantino/mcfly
|
|
66
66
|
eval "$(mcfly init bash)"
|
|
67
|
+
|
|
68
|
+
# check if file in ~/dotfiles/machineconfig/init_linux.sh exists and source it
|
|
69
|
+
if [ -f "$HOME/dotfiles/machineconfig/init_linux.sh" ]; then
|
|
70
|
+
# echo "Sourcing $HOME/dotfiles/machineconfig/init_linux.sh"
|
|
71
|
+
source "$HOME/dotfiles/machineconfig/init_linux.sh"
|
|
72
|
+
fi
|