machineconfig 5.15__py3-none-any.whl → 7.66__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/__init__.py +0 -28
- machineconfig/cluster/remote/distribute.py +0 -1
- machineconfig/cluster/remote/file_manager.py +0 -2
- machineconfig/cluster/remote/script_execution.py +0 -1
- machineconfig/cluster/sessions_managers/{utils → helpers}/enhanced_command_runner.py +4 -6
- machineconfig/cluster/sessions_managers/utils/load_balancer.py +1 -1
- machineconfig/cluster/sessions_managers/utils/maker.py +69 -0
- machineconfig/cluster/sessions_managers/wt_local.py +114 -289
- machineconfig/cluster/sessions_managers/wt_local_manager.py +50 -193
- machineconfig/cluster/sessions_managers/wt_remote.py +51 -43
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +49 -197
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +6 -19
- machineconfig/cluster/sessions_managers/wt_utils/manager_persistence.py +52 -0
- machineconfig/cluster/sessions_managers/wt_utils/monitoring_helpers.py +50 -0
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +4 -2
- machineconfig/cluster/sessions_managers/wt_utils/status_reporting.py +76 -0
- machineconfig/cluster/sessions_managers/wt_utils/wt_helpers.py +199 -0
- machineconfig/cluster/sessions_managers/zellij_local.py +81 -375
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +22 -169
- machineconfig/cluster/sessions_managers/zellij_remote.py +40 -41
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +13 -10
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +4 -8
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +5 -20
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +3 -9
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +3 -1
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_helper.py +298 -0
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_helper_restart.py +77 -0
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_helper_with_panes.py +228 -0
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_manager_helper.py +165 -0
- machineconfig/jobs/{python → installer}/check_installations.py +2 -3
- machineconfig/jobs/installer/custom/boxes.py +61 -0
- machineconfig/jobs/installer/custom/hx.py +76 -19
- machineconfig/jobs/installer/custom_dev/alacritty.py +4 -4
- machineconfig/jobs/installer/custom_dev/brave.py +1 -7
- machineconfig/jobs/installer/custom_dev/cloudflare_warp_cli.py +23 -0
- machineconfig/jobs/installer/custom_dev/code.py +4 -1
- machineconfig/jobs/installer/custom_dev/dubdb_adbc.py +30 -0
- machineconfig/jobs/installer/custom_dev/nerfont_windows_helper.py +9 -18
- machineconfig/jobs/installer/custom_dev/sysabc.py +119 -0
- machineconfig/jobs/installer/custom_dev/wezterm.py +2 -19
- machineconfig/jobs/installer/installer_data.json +1101 -115
- machineconfig/jobs/installer/linux_scripts/brave.sh +4 -14
- machineconfig/jobs/installer/linux_scripts/{warp-cli.sh → cloudflare_warp_cli.sh} +5 -17
- machineconfig/jobs/installer/linux_scripts/docker.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/docker_start.sh +6 -14
- machineconfig/jobs/installer/linux_scripts/edge.sh +3 -11
- machineconfig/jobs/{linux/msc → installer/linux_scripts}/lid.sh +2 -8
- machineconfig/jobs/installer/linux_scripts/nerdfont.sh +5 -17
- machineconfig/jobs/{linux/msc → installer/linux_scripts}/network.sh +2 -8
- machineconfig/jobs/installer/linux_scripts/q.sh +1 -0
- machineconfig/jobs/installer/linux_scripts/redis.sh +6 -17
- machineconfig/jobs/installer/linux_scripts/vscode.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/wezterm.sh +4 -12
- machineconfig/jobs/installer/package_groups.py +108 -180
- machineconfig/logger.py +0 -1
- machineconfig/profile/backup.toml +49 -0
- machineconfig/profile/bash_shell_profiles.md +11 -0
- machineconfig/profile/create_helper.py +74 -0
- machineconfig/profile/create_links.py +288 -0
- machineconfig/profile/create_links_export.py +100 -0
- machineconfig/profile/create_shell_profile.py +136 -0
- machineconfig/profile/mapper.toml +258 -0
- machineconfig/scripts/Restore-ThunderbirdProfile.ps1 +92 -0
- machineconfig/scripts/__init__.py +0 -4
- machineconfig/scripts/linux/{share_cloud.sh → other/share_cloud.sh} +14 -25
- machineconfig/scripts/linux/wrap_mcfg +47 -0
- machineconfig/scripts/nu/wrap_mcfg.nu +69 -0
- machineconfig/scripts/python/agents.py +92 -103
- machineconfig/scripts/python/ai/command_runner/command_runner.sh +9 -0
- machineconfig/scripts/python/ai/command_runner/prompt.txt +9 -0
- machineconfig/scripts/python/ai/generate_files.py +307 -42
- machineconfig/scripts/python/ai/initai.py +3 -28
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +17 -18
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +17 -18
- machineconfig/scripts/python/ai/solutions/_shared.py +9 -1
- machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +1 -1
- machineconfig/scripts/python/ai/solutions/copilot/prompts/pyright_fix.md +16 -0
- machineconfig/scripts/python/ai/solutions/generic.py +27 -4
- machineconfig/scripts/python/ai/vscode_tasks.py +37 -0
- machineconfig/scripts/python/cloud.py +29 -0
- machineconfig/scripts/python/croshell.py +111 -114
- machineconfig/scripts/python/define.py +31 -0
- machineconfig/scripts/python/devops.py +44 -103
- machineconfig/scripts/python/devops_navigator.py +10 -0
- machineconfig/scripts/python/env_manager/__init__.py +1 -0
- machineconfig/scripts/python/env_manager/path_manager_backend.py +47 -0
- machineconfig/scripts/python/env_manager/path_manager_tui.py +228 -0
- machineconfig/scripts/python/explore.py +49 -0
- machineconfig/scripts/python/fire_jobs.py +115 -152
- machineconfig/scripts/python/ftpx.py +29 -24
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.json +14 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.py +37 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_cursor_agents.py +22 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_gemini.py +42 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_qwen.py +30 -0
- machineconfig/scripts/python/{fire_agents_help_launch.py → helpers_agents/fire_agents_help_launch.py} +34 -44
- machineconfig/scripts/python/helpers_agents/fire_agents_helper_types.py +34 -0
- machineconfig/scripts/python/helpers_agents/templates/prompt.txt +6 -0
- machineconfig/scripts/python/helpers_agents/templates/template.ps1 +14 -0
- machineconfig/scripts/python/helpers_agents/templates/template.sh +24 -0
- machineconfig/scripts/python/{cloud_copy.py → helpers_cloud/cloud_copy.py} +30 -23
- machineconfig/scripts/python/{cloud_mount.py → helpers_cloud/cloud_mount.py} +10 -18
- machineconfig/scripts/python/{cloud_sync.py → helpers_cloud/cloud_sync.py} +12 -18
- machineconfig/scripts/python/{helpers → helpers_cloud}/helpers2.py +1 -1
- machineconfig/scripts/python/helpers_croshell/crosh.py +39 -0
- machineconfig/scripts/python/{start_slidev.py → helpers_croshell/start_slidev.py} +2 -2
- machineconfig/scripts/python/helpers_devops/cli_config.py +95 -0
- machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +89 -0
- machineconfig/scripts/python/helpers_devops/cli_data.py +25 -0
- machineconfig/scripts/python/helpers_devops/cli_nw.py +134 -0
- machineconfig/scripts/python/helpers_devops/cli_repos.py +182 -0
- machineconfig/scripts/python/helpers_devops/cli_self.py +134 -0
- machineconfig/scripts/python/helpers_devops/cli_share_file.py +137 -0
- machineconfig/scripts/python/helpers_devops/cli_share_server.py +141 -0
- machineconfig/scripts/python/{share_terminal.py → helpers_devops/cli_terminal.py} +35 -23
- machineconfig/scripts/python/helpers_devops/cli_utils.py +96 -0
- machineconfig/scripts/python/{devops_backup_retrieve.py → helpers_devops/devops_backup_retrieve.py} +7 -10
- machineconfig/scripts/python/helpers_devops/devops_status.py +511 -0
- machineconfig/scripts/python/{devops_update_repos.py → helpers_devops/devops_update_repos.py} +68 -49
- machineconfig/scripts/python/helpers_devops/themes/choose_pwsh_theme.ps1 +81 -0
- machineconfig/scripts/python/helpers_devops/themes/choose_starship_theme.bash +3 -0
- machineconfig/scripts/python/{choose_wezterm_theme.py → helpers_devops/themes/choose_wezterm_theme.py} +2 -2
- machineconfig/scripts/python/helpers_fire_command/__init__.py +0 -0
- machineconfig/scripts/python/{helpers/helpers4.py → helpers_fire_command/file_wrangler.py} +56 -20
- machineconfig/scripts/python/{fire_jobs_args_helper.py → helpers_fire_command/fire_jobs_args_helper.py} +5 -1
- machineconfig/scripts/python/{fire_jobs_route_helper.py → helpers_fire_command/fire_jobs_route_helper.py} +47 -2
- machineconfig/scripts/python/helpers_fire_command/fire_jobs_streamlit_helper.py +0 -0
- machineconfig/scripts/python/helpers_msearch/__init__.py +5 -0
- machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfag +1 -1
- machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfg +1 -1
- machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfrga +1 -1
- machineconfig/scripts/python/helpers_navigator/__init__.py +20 -0
- machineconfig/scripts/python/helpers_navigator/command_builder.py +111 -0
- machineconfig/scripts/python/helpers_navigator/command_detail.py +44 -0
- machineconfig/scripts/python/helpers_navigator/command_tree.py +588 -0
- machineconfig/scripts/python/helpers_navigator/data_models.py +28 -0
- machineconfig/scripts/python/helpers_navigator/main_app.py +272 -0
- machineconfig/scripts/python/helpers_navigator/search_bar.py +15 -0
- machineconfig/scripts/python/helpers_repos/action.py +209 -0
- machineconfig/scripts/python/helpers_repos/action_helper.py +150 -0
- machineconfig/scripts/python/{repos_helper_clone.py → helpers_repos/clone.py} +2 -3
- machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +218 -0
- machineconfig/scripts/python/{count_lines.py → helpers_repos/count_lines.py} +10 -10
- machineconfig/scripts/python/helpers_repos/count_lines_frontend.py +17 -0
- machineconfig/scripts/python/{repos_helper.py → helpers_repos/entrypoint.py} +9 -17
- machineconfig/scripts/python/helpers_repos/grource.py +340 -0
- machineconfig/scripts/python/{repos_helper_record.py → helpers_repos/record.py} +4 -3
- machineconfig/scripts/python/helpers_repos/sync.py +66 -0
- machineconfig/scripts/python/{repos_helper_update.py → helpers_repos/update.py} +3 -3
- machineconfig/scripts/python/helpers_sessions/__init__.py +0 -0
- machineconfig/scripts/python/helpers_sessions/sessions_multiprocess.py +58 -0
- machineconfig/scripts/python/helpers_utils/download.py +152 -0
- machineconfig/scripts/python/helpers_utils/path.py +108 -0
- machineconfig/scripts/python/interactive.py +64 -84
- machineconfig/scripts/python/machineconfig.py +63 -0
- machineconfig/scripts/python/msearch.py +21 -0
- machineconfig/scripts/python/nw/__init__.py +0 -0
- machineconfig/scripts/python/{devops_add_identity.py → nw/devops_add_identity.py} +0 -2
- machineconfig/scripts/python/{devops_add_ssh_key.py → nw/devops_add_ssh_key.py} +73 -43
- machineconfig/scripts/{linux → python/nw}/mount_nfs +1 -1
- machineconfig/scripts/python/{mount_nfs.py → nw/mount_nfs.py} +3 -3
- machineconfig/scripts/{linux → python/nw}/mount_nw_drive +1 -2
- machineconfig/scripts/python/{mount_ssh.py → nw/mount_ssh.py} +3 -3
- machineconfig/scripts/python/{onetimeshare.py → nw/onetimeshare.py} +0 -1
- machineconfig/scripts/python/nw/ssh_debug_linux.py +391 -0
- machineconfig/scripts/python/nw/ssh_debug_windows.py +338 -0
- machineconfig/scripts/python/{wifi_conn.py → nw/wifi_conn.py} +1 -53
- machineconfig/scripts/python/{wsl_windows_transfer.py → nw/wsl_windows_transfer.py} +5 -4
- machineconfig/scripts/python/sessions.py +64 -44
- machineconfig/scripts/python/terminal.py +127 -0
- machineconfig/scripts/python/utils.py +66 -0
- machineconfig/scripts/windows/{mount_nfs.ps1 → mounts/mount_nfs.ps1} +1 -3
- machineconfig/scripts/windows/{mount_ssh.ps1 → mounts/mount_ssh.ps1} +1 -1
- machineconfig/scripts/windows/{share_smb.ps1 → mounts/share_smb.ps1} +0 -6
- machineconfig/scripts/windows/wrap_mcfg.ps1 +60 -0
- machineconfig/settings/broot/br.sh +0 -4
- machineconfig/settings/broot/conf.toml +1 -1
- machineconfig/settings/helix/config.toml +16 -0
- machineconfig/settings/helix/languages.toml +13 -4
- machineconfig/settings/helix/yazi-picker.sh +12 -0
- machineconfig/settings/lf/linux/exe/lfcd.sh +1 -0
- machineconfig/settings/lf/linux/exe/previewer.sh +9 -3
- machineconfig/settings/lf/linux/lfrc +10 -12
- machineconfig/settings/lf/windows/fzf_edit.ps1 +2 -2
- machineconfig/settings/lf/windows/lfrc +18 -38
- machineconfig/settings/lf/windows/mkfile.ps1 +1 -1
- machineconfig/settings/linters/.ruff.toml +1 -1
- machineconfig/settings/lvim/windows/archive/config_additional.lua +0 -6
- machineconfig/settings/marimo/marimo.toml +80 -0
- machineconfig/settings/marimo/snippets/globalize.py +34 -0
- machineconfig/settings/pistol/pistol.conf +1 -1
- machineconfig/settings/shells/bash/init.sh +55 -31
- machineconfig/settings/shells/nushell/config.nu +1 -34
- machineconfig/settings/shells/nushell/init.nu +127 -0
- machineconfig/settings/shells/pwsh/init.ps1 +60 -43
- machineconfig/settings/shells/starship/starship.toml +16 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +2 -0
- machineconfig/settings/shells/wt/settings.json +32 -17
- machineconfig/settings/shells/zsh/init.sh +89 -0
- machineconfig/settings/svim/linux/init.toml +0 -4
- machineconfig/settings/svim/windows/init.toml +0 -3
- machineconfig/settings/yazi/init.lua +57 -0
- machineconfig/settings/yazi/keymap_linux.toml +79 -0
- machineconfig/settings/yazi/keymap_windows.toml +78 -0
- machineconfig/settings/yazi/shell/yazi_cd.ps1 +33 -0
- machineconfig/settings/yazi/shell/yazi_cd.sh +8 -0
- machineconfig/settings/yazi/yazi.toml +13 -0
- machineconfig/setup_linux/__init__.py +10 -0
- machineconfig/setup_linux/apps_desktop.sh +89 -0
- machineconfig/setup_linux/apps_gui.sh +64 -0
- machineconfig/setup_linux/{nix → others}/cli_installation.sh +9 -29
- machineconfig/setup_linux/ssh/openssh_all.sh +25 -0
- machineconfig/setup_linux/ssh/openssh_wsl.sh +38 -0
- machineconfig/setup_linux/uv.sh +15 -0
- machineconfig/setup_linux/web_shortcuts/interactive.sh +26 -6
- machineconfig/setup_mac/__init__.py +16 -0
- machineconfig/setup_mac/apps_gui.sh +248 -0
- machineconfig/setup_mac/ssh/openssh_setup.sh +114 -0
- machineconfig/setup_mac/uv.sh +36 -0
- machineconfig/setup_windows/__init__.py +8 -0
- machineconfig/setup_windows/others/power_options.ps1 +7 -0
- machineconfig/setup_windows/ssh/add-sshkey.ps1 +29 -0
- machineconfig/setup_windows/ssh/add_identity.ps1 +11 -0
- machineconfig/setup_windows/ssh/openssh-server.ps1 +37 -0
- machineconfig/setup_windows/uv.ps1 +10 -0
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +27 -10
- machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +16 -0
- machineconfig/utils/accessories.py +7 -5
- machineconfig/utils/cloud/onedrive/README.md +139 -0
- machineconfig/utils/code.py +133 -106
- machineconfig/utils/files/art/fat_croco.txt +10 -0
- machineconfig/utils/files/art/halfwit_croco.txt +9 -0
- machineconfig/utils/files/art/happy_croco.txt +22 -0
- machineconfig/utils/files/art/water_croco.txt +11 -0
- machineconfig/utils/files/ascii_art.py +1 -1
- machineconfig/utils/files/dbms.py +257 -0
- machineconfig/utils/files/headers.py +11 -14
- machineconfig/utils/files/ouch/__init__.py +0 -0
- machineconfig/utils/files/ouch/decompress.py +45 -0
- machineconfig/utils/files/read.py +10 -18
- machineconfig/utils/installer_utils/installer_class.py +68 -126
- machineconfig/utils/installer_utils/{installer.py → installer_cli.py} +109 -117
- machineconfig/utils/installer_utils/{installer_abc.py → installer_locator_utils.py} +31 -81
- machineconfig/utils/{installer.py → installer_utils/installer_runner.py} +44 -74
- machineconfig/utils/io.py +77 -23
- machineconfig/utils/links.py +254 -162
- machineconfig/utils/meta.py +255 -0
- machineconfig/utils/notifications.py +1 -1
- machineconfig/utils/options.py +13 -3
- machineconfig/utils/path_extended.py +46 -100
- machineconfig/utils/path_helper.py +75 -22
- machineconfig/utils/procs.py +50 -70
- machineconfig/utils/scheduler.py +94 -97
- machineconfig/utils/scheduling.py +0 -3
- machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
- machineconfig/utils/schemas/layouts/layout_types.py +1 -1
- machineconfig/utils/source_of_truth.py +3 -6
- machineconfig/utils/ssh.py +742 -264
- machineconfig/utils/ssh_utils/utils.py +0 -0
- machineconfig/utils/terminal.py +2 -113
- machineconfig/utils/tst.py +20 -0
- machineconfig/utils/upgrade_packages.py +109 -28
- machineconfig/utils/ve.py +11 -4
- machineconfig-7.66.dist-info/METADATA +124 -0
- machineconfig-7.66.dist-info/RECORD +451 -0
- machineconfig-7.66.dist-info/entry_points.txt +15 -0
- machineconfig/cluster/sessions_managers/ffile.py +0 -4
- machineconfig/jobs/installer/linux_scripts/pgsql.sh +0 -49
- machineconfig/jobs/installer/linux_scripts/timescaledb.sh +0 -85
- machineconfig/jobs/linux/msc/cli_agents.sh +0 -16
- machineconfig/jobs/python/python_ve_symlink.py +0 -37
- machineconfig/jobs/python/vscode/api.py +0 -57
- machineconfig/jobs/python/vscode/sync_code.py +0 -73
- machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +0 -14
- machineconfig/jobs/windows/start_terminal.ps1 +0 -6
- machineconfig/jobs/windows/startup_file.cmd +0 -2
- machineconfig/profile/create.py +0 -303
- machineconfig/profile/shell.py +0 -176
- machineconfig/scripts/cloud/init.sh +0 -119
- machineconfig/scripts/linux/agents +0 -2
- machineconfig/scripts/linux/choose_wezterm_theme +0 -3
- machineconfig/scripts/linux/cloud_copy +0 -2
- machineconfig/scripts/linux/cloud_mount +0 -2
- machineconfig/scripts/linux/cloud_repo_sync +0 -2
- machineconfig/scripts/linux/cloud_sync +0 -2
- machineconfig/scripts/linux/croshell +0 -3
- machineconfig/scripts/linux/devops +0 -2
- machineconfig/scripts/linux/fire +0 -2
- machineconfig/scripts/linux/ftpx +0 -2
- machineconfig/scripts/linux/fzf2g +0 -21
- machineconfig/scripts/linux/fzffg +0 -25
- machineconfig/scripts/linux/gh_models +0 -2
- machineconfig/scripts/linux/initai +0 -2
- machineconfig/scripts/linux/kill_process +0 -2
- machineconfig/scripts/linux/scheduler +0 -2
- machineconfig/scripts/linux/sessions +0 -2
- machineconfig/scripts/linux/share_smb +0 -1
- machineconfig/scripts/linux/start_slidev +0 -2
- machineconfig/scripts/linux/start_terminals +0 -3
- machineconfig/scripts/linux/warp-cli.sh +0 -122
- machineconfig/scripts/linux/wifi_conn +0 -2
- machineconfig/scripts/linux/z_ls +0 -104
- machineconfig/scripts/python/ai/solutions/copilot/prompts/allLintersAndTypeCheckers.prompt.md +0 -5
- machineconfig/scripts/python/cloud_repo_sync.py +0 -190
- machineconfig/scripts/python/count_lines_frontend.py +0 -16
- machineconfig/scripts/python/dotfile.py +0 -78
- machineconfig/scripts/python/fire_agents_helper_types.py +0 -12
- machineconfig/scripts/python/get_zellij_cmd.py +0 -15
- machineconfig/scripts/python/gh_models.py +0 -104
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +0 -116
- machineconfig/scripts/python/repos.py +0 -132
- machineconfig/scripts/python/repos_helper_action.py +0 -378
- machineconfig/scripts/python/snapshot.py +0 -25
- machineconfig/scripts/python/start_terminals.py +0 -121
- machineconfig/scripts/python/t4.py +0 -17
- machineconfig/scripts/windows/agents.ps1 +0 -1
- machineconfig/scripts/windows/choose_wezterm_theme.ps1 +0 -1
- machineconfig/scripts/windows/cloud_copy.ps1 +0 -1
- machineconfig/scripts/windows/cloud_mount.ps1 +0 -1
- machineconfig/scripts/windows/cloud_repo_sync.ps1 +0 -1
- machineconfig/scripts/windows/cloud_sync.ps1 +0 -1
- machineconfig/scripts/windows/croshell.ps1 +0 -1
- machineconfig/scripts/windows/devops.ps1 +0 -1
- machineconfig/scripts/windows/dotfile.ps1 +0 -1
- machineconfig/scripts/windows/fire.ps1 +0 -1
- machineconfig/scripts/windows/ftpx.ps1 +0 -1
- machineconfig/scripts/windows/gpt.ps1 +0 -1
- machineconfig/scripts/windows/grep.ps1 +0 -2
- machineconfig/scripts/windows/initai.ps1 +0 -1
- machineconfig/scripts/windows/kill_process.ps1 +0 -1
- machineconfig/scripts/windows/nano.ps1 +0 -3
- machineconfig/scripts/windows/pomodoro.ps1 +0 -1
- machineconfig/scripts/windows/reload_path.ps1 +0 -3
- machineconfig/scripts/windows/scheduler.ps1 +0 -1
- machineconfig/scripts/windows/sessions.ps1 +0 -1
- machineconfig/scripts/windows/snapshot.ps1 +0 -1
- machineconfig/scripts/windows/start_slidev.ps1 +0 -1
- machineconfig/scripts/windows/start_terminals.ps1 +0 -1
- machineconfig/scripts/windows/wifi_conn.ps1 +0 -2
- machineconfig/scripts/windows/wsl_rdp_windows_port_forwarding.ps1 +0 -46
- machineconfig/scripts/windows/wsl_ssh_windows_port_forwarding.ps1 +0 -76
- machineconfig/settings/lf/linux/exe/fzf_nano.sh +0 -16
- machineconfig/setup_linux/others/openssh-server_add_pub_key.sh +0 -57
- machineconfig/setup_linux/web_shortcuts/croshell.sh +0 -11
- machineconfig/setup_linux/web_shortcuts/ssh.sh +0 -52
- machineconfig/setup_windows/web_shortcuts/all.ps1 +0 -18
- machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +0 -36
- machineconfig/setup_windows/web_shortcuts/croshell.ps1 +0 -16
- machineconfig/setup_windows/web_shortcuts/ssh.ps1 +0 -11
- machineconfig/utils/ai/generate_file_checklist.py +0 -68
- machineconfig-5.15.dist-info/METADATA +0 -188
- machineconfig-5.15.dist-info/RECORD +0 -415
- machineconfig-5.15.dist-info/entry_points.txt +0 -18
- machineconfig/cluster/sessions_managers/{utils → helpers}/load_balancer_helper.py +0 -0
- machineconfig/scripts/linux/{share_nfs → other/share_nfs} +0 -0
- machineconfig/scripts/linux/{start_docker → other/start_docker} +0 -0
- machineconfig/scripts/linux/{switch_ip → other/switch_ip} +0 -0
- machineconfig/{jobs/python → scripts/python/helpers_agents}/__init__.py +0 -0
- machineconfig/scripts/python/{helpers → helpers_agents/agentic_frameworks}/__init__.py +0 -0
- machineconfig/scripts/python/{fire_agents_help_search.py → helpers_agents/fire_agents_help_search.py} +0 -0
- machineconfig/scripts/python/{fire_agents_load_balancer.py → helpers_agents/fire_agents_load_balancer.py} +0 -0
- machineconfig/{jobs/windows/msc/cli_agents.bat → scripts/python/helpers_cloud/__init__.py} +0 -0
- machineconfig/scripts/python/{helpers → helpers_cloud}/cloud_helpers.py +1 -1
- /machineconfig/scripts/python/{helpers → helpers_cloud}/helpers5.py +0 -0
- /machineconfig/{jobs/windows/msc/cli_agents.ps1 → scripts/python/helpers_croshell/__init__.py} +0 -0
- /machineconfig/scripts/python/{pomodoro.py → helpers_croshell/pomodoro.py} +0 -0
- /machineconfig/scripts/python/{scheduler.py → helpers_croshell/scheduler.py} +0 -0
- /machineconfig/scripts/python/{viewer.py → helpers_croshell/viewer.py} +0 -0
- /machineconfig/scripts/python/{viewer_template.py → helpers_croshell/viewer_template.py} +0 -0
- /machineconfig/scripts/python/{fire_jobs_streamlit_helper.py → helpers_devops/__init__.py} +0 -0
- /machineconfig/scripts/{windows/share_nfs.ps1 → python/helpers_devops/themes/__init__.py} +0 -0
- /machineconfig/{settings/yazi/keymap.toml → scripts/python/helpers_devops/themes/choose_starship_theme.ps1} +0 -0
- /machineconfig/scripts/python/{cloud_manager.py → helpers_fire_command/cloud_manager.py} +0 -0
- /machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/skrg +0 -0
- /machineconfig/scripts/{windows → python/helpers_msearch/scripts_windows}/fzfb.ps1 +0 -0
- /machineconfig/scripts/{windows → python/helpers_msearch/scripts_windows}/fzfg.ps1 +0 -0
- /machineconfig/scripts/{windows → python/helpers_msearch/scripts_windows}/fzfrga.bat +0 -0
- /machineconfig/scripts/{linux → python/nw}/mount_drive +0 -0
- /machineconfig/scripts/python/{mount_nw_drive.py → nw/mount_nw_drive.py} +0 -0
- /machineconfig/scripts/{linux → python/nw}/mount_smb +0 -0
- /machineconfig/scripts/windows/{mount_nw.ps1 → mounts/mount_nw.ps1} +0 -0
- /machineconfig/scripts/windows/{mount_smb.ps1 → mounts/mount_smb.ps1} +0 -0
- /machineconfig/scripts/windows/{share_cloud.cmd → mounts/share_cloud.cmd} +0 -0
- /machineconfig/scripts/windows/{unlock_bitlocker.ps1 → mounts/unlock_bitlocker.ps1} +0 -0
- /machineconfig/setup_linux/{web_shortcuts → others}/android.sh +0 -0
- /machineconfig/{jobs/windows/archive → setup_windows/ssh}/openssh-server_add_key.ps1 +0 -0
- /machineconfig/{jobs/windows/archive → setup_windows/ssh}/openssh-server_copy-ssh-id.ps1 +0 -0
- {machineconfig-5.15.dist-info → machineconfig-7.66.dist-info}/WHEEL +0 -0
- {machineconfig-5.15.dist-info → machineconfig-7.66.dist-info}/top_level.txt +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#=======================================================================
|
|
3
|
-
# ⏱️ TIMESCALEDB INSTALLATION SCRIPT ⏱️
|
|
4
|
-
#=======================================================================
|
|
5
|
-
# This script installs TimescaleDB on Ubuntu/Debian-based Linux distributions
|
|
6
|
-
# Reference: https://docs.timescale.com/self-hosted/latest/install/installation-linux/
|
|
7
|
-
|
|
8
|
-
echo """#=======================================================================
|
|
9
|
-
🔍 DETECTING SYSTEM | Identifying OS distribution version
|
|
10
|
-
#=======================================================================
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
get_ubuntu_base_version() {
|
|
14
|
-
local os_codename=$(lsb_release -cs)
|
|
15
|
-
case "$os_codename" in
|
|
16
|
-
"wilma")
|
|
17
|
-
echo "noble" # Map Mint Wilma to the base image Ubuntu 24.04 LTS
|
|
18
|
-
;;
|
|
19
|
-
"virginia")
|
|
20
|
-
echo "jammy" # Map Mint Virginia to the base image Ubuntu 22.04 LTS
|
|
21
|
-
;;
|
|
22
|
-
*)
|
|
23
|
-
echo "$os_codename"
|
|
24
|
-
;;
|
|
25
|
-
esac
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
ubuntu_version=$(get_ubuntu_base_version)
|
|
29
|
-
echo "📋 Detected distribution: $ubuntu_version"
|
|
30
|
-
|
|
31
|
-
echo """#=======================================================================
|
|
32
|
-
🐘 INSTALLING POSTGRESQL | Setting up PostgreSQL dependencies
|
|
33
|
-
#=======================================================================
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
|
-
# Add PostgreSQL repository setup
|
|
37
|
-
echo "🔧 Setting up PostgreSQL repository..."
|
|
38
|
-
sudo nala install postgresql-common -y
|
|
39
|
-
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
|
|
40
|
-
|
|
41
|
-
echo """#=======================================================================
|
|
42
|
-
🔑 ADDING REPOSITORY KEYS | Setting up TimescaleDB repository
|
|
43
|
-
#=======================================================================
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
|
-
# Add TimescaleDB repository
|
|
47
|
-
echo "📝 Adding TimescaleDB repository to sources list..."
|
|
48
|
-
echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $ubuntu_version main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
|
|
49
|
-
|
|
50
|
-
echo "🔐 Adding TimescaleDB GPG key..."
|
|
51
|
-
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg
|
|
52
|
-
|
|
53
|
-
echo """#=======================================================================
|
|
54
|
-
📦 INSTALLING TIMESCALEDB | Updating and installing packages
|
|
55
|
-
#=======================================================================
|
|
56
|
-
"""
|
|
57
|
-
|
|
58
|
-
# Update package lists
|
|
59
|
-
echo "🔄 Updating package lists..."
|
|
60
|
-
sudo nala update
|
|
61
|
-
|
|
62
|
-
# Install TimescaleDB with PostgreSQL 16
|
|
63
|
-
echo "📥 Installing PostgreSQL 16 and TimescaleDB..."
|
|
64
|
-
sudo nala install -y postgresql-16 postgresql-client-16 timescaledb-2-postgresql-16
|
|
65
|
-
|
|
66
|
-
echo """#=======================================================================
|
|
67
|
-
⚙️ CONFIGURING TIMESCALEDB | Optimizing database settings
|
|
68
|
-
#=======================================================================
|
|
69
|
-
"""
|
|
70
|
-
|
|
71
|
-
# Run TimescaleDB tuning tool
|
|
72
|
-
echo "🔧 Running TimescaleDB tuning utility..."
|
|
73
|
-
sudo timescaledb-tune
|
|
74
|
-
|
|
75
|
-
# Restart PostgreSQL service
|
|
76
|
-
echo "🔄 Restarting PostgreSQL service..."
|
|
77
|
-
sudo systemctl restart postgresql
|
|
78
|
-
|
|
79
|
-
echo """#=======================================================================
|
|
80
|
-
✅ INSTALLATION COMPLETE | TimescaleDB has been installed successfully
|
|
81
|
-
#=======================================================================
|
|
82
|
-
"""
|
|
83
|
-
echo "🚀 To connect to PostgreSQL, run: sudo -u postgres psql"
|
|
84
|
-
echo "💡 To enable TimescaleDB in a database, run: CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
|
85
|
-
echo "ℹ️ For more information, visit: https://docs.timescale.com/self-hosted/latest/install/"
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"""Symlinks"""
|
|
2
|
-
|
|
3
|
-
from rich import box
|
|
4
|
-
from rich.console import Console
|
|
5
|
-
from rich.panel import Panel
|
|
6
|
-
|
|
7
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def main() -> None:
|
|
11
|
-
console = Console()
|
|
12
|
-
console.print(
|
|
13
|
-
Panel.fit(
|
|
14
|
-
"\n".join(["Create symlinks for virtual environments"]),
|
|
15
|
-
title="🔗 Symlink Creator",
|
|
16
|
-
border_style="cyan",
|
|
17
|
-
box=box.ROUNDED,
|
|
18
|
-
)
|
|
19
|
-
)
|
|
20
|
-
target = PathExtended(input("🎯 Symlink to which target? ")).expanduser().absolute()
|
|
21
|
-
source = input(f"📍 Symlink from which source? [default to: CWD/{target.name}] ") or PathExtended.cwd().joinpath(target.name)
|
|
22
|
-
if isinstance(source, str):
|
|
23
|
-
source = PathExtended(source).expanduser().absolute()
|
|
24
|
-
source.symlink_to(target, overwrite=True)
|
|
25
|
-
console.print(
|
|
26
|
-
Panel.fit(
|
|
27
|
-
"\n".join([f"📍 Source: {source}", f"🎯 Target: {target}"]),
|
|
28
|
-
title="✅ Symlink Created",
|
|
29
|
-
border_style="green",
|
|
30
|
-
box=box.ROUNDED,
|
|
31
|
-
)
|
|
32
|
-
)
|
|
33
|
-
console.print("🔗 Finished creating symlink.", style="bold cyan")
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if __name__ == "__main__":
|
|
37
|
-
pass
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
from typing import Annotated
|
|
3
|
-
|
|
4
|
-
import typer
|
|
5
|
-
from rich import box
|
|
6
|
-
from rich.console import Console
|
|
7
|
-
from rich.panel import Panel
|
|
8
|
-
from rich.syntax import Syntax
|
|
9
|
-
|
|
10
|
-
from machineconfig.utils.accessories import randstr
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def open_file_in_new_instance(file_path: str):
|
|
14
|
-
import git
|
|
15
|
-
|
|
16
|
-
repo = git.Repo(search_parent_directories=True)
|
|
17
|
-
repo_path = repo.working_tree_dir
|
|
18
|
-
# Ensure repo_path is not None before passing to Path
|
|
19
|
-
repo_name = Path(repo_path if repo_path is not None else ".").name
|
|
20
|
-
repo_copy_name = f"{repo_name}_{randstr(5)}"
|
|
21
|
-
copy_path = Path.home().joinpath(".config", "machingconfig", "vscode_api", repo_name, repo_copy_name)
|
|
22
|
-
copy_path.parent.mkdir(parents=True, exist_ok=True)
|
|
23
|
-
code = f"""
|
|
24
|
-
ln -s {repo_path} {copy_path}
|
|
25
|
-
cd {copy_path}
|
|
26
|
-
code --profile bitProfile --new-window {file_path}
|
|
27
|
-
"""
|
|
28
|
-
console = Console()
|
|
29
|
-
panel = Panel(
|
|
30
|
-
Syntax(code, lexer="bash"),
|
|
31
|
-
title="🔍 VS CODE API | Opening file in new instance",
|
|
32
|
-
subtitle=f"📂 {file_path}",
|
|
33
|
-
border_style="bright_blue",
|
|
34
|
-
box=box.DOUBLE,
|
|
35
|
-
padding=(1, 2),
|
|
36
|
-
)
|
|
37
|
-
console.print(panel)
|
|
38
|
-
|
|
39
|
-
code_path = Path.home().joinpath(".config", "machingconfig", "vscode_api", "code_temp")
|
|
40
|
-
code_path.parent.mkdir(parents=True, exist_ok=True)
|
|
41
|
-
code_path.write_text(code, encoding="utf-8")
|
|
42
|
-
code_path.chmod(0o755)
|
|
43
|
-
import subprocess
|
|
44
|
-
|
|
45
|
-
subprocess.run([str(code_path)], shell=True, check=True)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def main(file_path: Annotated[str, typer.Argument(help="Path to the file to open")]) -> None:
|
|
49
|
-
open_file_in_new_instance(file_path)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def arg_parser() -> None:
|
|
53
|
-
typer.run(main)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if __name__ == "__main__":
|
|
57
|
-
arg_parser()
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
from configparser import SectionProxy
|
|
3
|
-
from rich import box
|
|
4
|
-
from rich.console import Console
|
|
5
|
-
from rich.panel import Panel
|
|
6
|
-
from rich.syntax import Syntax
|
|
7
|
-
from machineconfig.utils.io import read_ini
|
|
8
|
-
|
|
9
|
-
config = read_ini(Path.home().joinpath(".ssh", "config"))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def sync_remote(machine_name: str) -> None:
|
|
13
|
-
console = Console()
|
|
14
|
-
console.print(
|
|
15
|
-
Panel.fit(
|
|
16
|
-
"\n".join([f"🖥️ Target machine: {machine_name}"]),
|
|
17
|
-
title="🔄 Sync Remote",
|
|
18
|
-
border_style="cyan",
|
|
19
|
-
box=box.ROUNDED,
|
|
20
|
-
)
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
machine_config: SectionProxy | None = None
|
|
24
|
-
if machine_name in config:
|
|
25
|
-
machine_config = config[machine_name]
|
|
26
|
-
|
|
27
|
-
if machine_config is None:
|
|
28
|
-
error_msg = f"Machine {machine_name} not found in SSH config."
|
|
29
|
-
console.print(
|
|
30
|
-
Panel.fit(
|
|
31
|
-
"\n".join([error_msg]),
|
|
32
|
-
title="❌ Error",
|
|
33
|
-
subtitle="⚠️ Unknown target machine",
|
|
34
|
-
border_style="red",
|
|
35
|
-
box=box.ROUNDED,
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
raise ValueError(error_msg)
|
|
39
|
-
|
|
40
|
-
code = f"""
|
|
41
|
-
ssh -o "HostName={machine_config["HostName"]}" -o "User={machine_config["User"]}" -o "ProxyCommand=cloudflared access ssh --hostname %h" -o "Port={machine_config["Port"]}" -o "RequestTTY=yes" -o "RemoteCommand=devops --which update; bash" {machine_name}
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
syntax = Syntax(code, "bash", line_numbers=False, word_wrap=True)
|
|
45
|
-
console.print(
|
|
46
|
-
Panel(
|
|
47
|
-
syntax,
|
|
48
|
-
title=f"🔄 Sync Command | {machine_name}",
|
|
49
|
-
subtitle=f"🌐 Host: {machine_config['HostName']}",
|
|
50
|
-
border_style="blue",
|
|
51
|
-
box=box.ROUNDED,
|
|
52
|
-
)
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
code_path = Path.home().joinpath(".config", "machingconfig", "vscode_api", "code_temp")
|
|
56
|
-
code_path.parent.mkdir(parents=True, exist_ok=True)
|
|
57
|
-
code_path.write_text(code, encoding="utf-8")
|
|
58
|
-
code_path.chmod(0o755)
|
|
59
|
-
|
|
60
|
-
console.print(f"🚀 Executing sync command for {machine_name}...", style="bold yellow")
|
|
61
|
-
|
|
62
|
-
import subprocess
|
|
63
|
-
|
|
64
|
-
subprocess.run([str(code_path)], shell=True, check=True)
|
|
65
|
-
|
|
66
|
-
console.print(
|
|
67
|
-
Panel.fit(
|
|
68
|
-
"\n".join([f"🖥️ Machine: {machine_name}"]),
|
|
69
|
-
title="✅ Sync Completed",
|
|
70
|
-
border_style="green",
|
|
71
|
-
box=box.ROUNDED,
|
|
72
|
-
)
|
|
73
|
-
)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# install https://visualstudio.microsoft.com/visual-cpp-build-tools/
|
|
3
|
-
# include
|
|
4
|
-
# winget install Microsoft.VisualStudio.2022.BuildTools
|
|
5
|
-
# winget install Microsoft.VC++2015-2022Redist-x86
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
. "$env:USERPROFILE\code\machineconfig\.venv\Scripts\Activate.ps1"
|
|
9
|
-
Set-Location C:
|
|
10
|
-
python -m pip install --global-option=build_ext --global-option="-IC:\Program Files\Graphviz\include" --global-option="-LC:\Program Files\Graphviz\lib" pygraphviz
|
|
11
|
-
# not including the options as above (from https://pygraphviz.github.io/documentation/stable/install.html)
|
|
12
|
-
# would result in an error like this: pygraphviz/graphviz_wrap.c(2711): fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory
|
|
13
|
-
|
|
14
|
-
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
wt --profile croshell -d . --title "MyTerminal" --tabColor "red"`; split-pane --vertical --size 0.55 pwsh machineconfig-workingdirectory ~/code/machineconfig -Command "pwd" `; split-pane -V PowerShell -NoExit -Command "cd code/machineconfig" `; split-pane -H wsl.exe cmatrix`; split-pane -V wsl.exe sl
|
|
3
|
-
# wt -p "Command Prompt" `; split-pane -p "Windows PowerShell" `; split-pane -H wsl.exe
|
|
4
|
-
|
|
5
|
-
# See more settings here: https://docs.microsoft.com/en-us/windows/terminal/
|
|
6
|
-
|
machineconfig/profile/create.py
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This script Takes away all config files from the computer, place them in one directory
|
|
3
|
-
`dotfiles`, and create symlinks to those files from thier original locations.
|
|
4
|
-
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
from rich.console import Console
|
|
8
|
-
from rich.panel import Panel
|
|
9
|
-
from rich.pretty import Pretty
|
|
10
|
-
from rich.text import Text
|
|
11
|
-
from rich.table import Table
|
|
12
|
-
|
|
13
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
14
|
-
from machineconfig.utils.links import symlink_func, symlink_copy
|
|
15
|
-
from machineconfig.utils.options import choose_from_options
|
|
16
|
-
from machineconfig.utils.source_of_truth import LIBRARY_ROOT, REPO_ROOT
|
|
17
|
-
from machineconfig.profile.shell import create_default_shell_profile
|
|
18
|
-
|
|
19
|
-
import platform
|
|
20
|
-
import os
|
|
21
|
-
import ctypes
|
|
22
|
-
import subprocess
|
|
23
|
-
import tomllib
|
|
24
|
-
from typing import Optional, Any, TypedDict, Literal
|
|
25
|
-
|
|
26
|
-
system = platform.system() # Linux or Windows
|
|
27
|
-
ERROR_LIST: list[Any] = [] # append to this after every exception captured.
|
|
28
|
-
SYSTEM = system.lower()
|
|
29
|
-
|
|
30
|
-
console = Console()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def get_other_systems(current_system: str) -> list[str]:
|
|
34
|
-
all_systems = ["linux", "windows", "darwin"]
|
|
35
|
-
return [s for s in all_systems if s != current_system.lower()]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
OTHER_SYSTEMS = get_other_systems(SYSTEM)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class SymlinkMapper(TypedDict):
|
|
42
|
-
this: str
|
|
43
|
-
to_this: str
|
|
44
|
-
contents: Optional[bool]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class OperationRecord(TypedDict):
|
|
48
|
-
program: str
|
|
49
|
-
file_key: str
|
|
50
|
-
source: str
|
|
51
|
-
target: str
|
|
52
|
-
operation: str
|
|
53
|
-
action: Literal[
|
|
54
|
-
"already_linked",
|
|
55
|
-
"relinking",
|
|
56
|
-
"fixing_broken_link",
|
|
57
|
-
"identical_files",
|
|
58
|
-
"backing_up_source",
|
|
59
|
-
"backing_up_target",
|
|
60
|
-
"relinking_to_new_target",
|
|
61
|
-
"moving_to_target",
|
|
62
|
-
"new_link",
|
|
63
|
-
"new_link_and_target",
|
|
64
|
-
"linking",
|
|
65
|
-
"copying",
|
|
66
|
-
"error"
|
|
67
|
-
]
|
|
68
|
-
details: str
|
|
69
|
-
status: str
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def apply_mapper(choice: Optional[str], prioritize_to_this: bool):
|
|
73
|
-
symlink_mapper: dict[str, dict[str, SymlinkMapper]] = tomllib.loads(LIBRARY_ROOT.joinpath("profile/mapper.toml").read_text(encoding="utf-8"))
|
|
74
|
-
exclude: list[str] = [] # "wsl_linux", "wsl_windows"
|
|
75
|
-
operation_records: list[OperationRecord] = []
|
|
76
|
-
|
|
77
|
-
program_keys_raw: list[str] = list(symlink_mapper.keys())
|
|
78
|
-
program_keys: list[str] = []
|
|
79
|
-
for program_key in program_keys_raw:
|
|
80
|
-
if program_key in exclude or any([another_system in program_key for another_system in OTHER_SYSTEMS]):
|
|
81
|
-
continue
|
|
82
|
-
else:
|
|
83
|
-
program_keys.append(program_key)
|
|
84
|
-
|
|
85
|
-
program_keys.sort()
|
|
86
|
-
if choice is None:
|
|
87
|
-
choice_selected = choose_from_options(msg="Which symlink to create?", options=program_keys + ["all", "none(EXIT)"], default="none(EXIT)", fzf=True, multi=True)
|
|
88
|
-
assert isinstance(choice_selected, list)
|
|
89
|
-
if len(choice_selected) == 1 and choice_selected[0] == "none(EXIT)":
|
|
90
|
-
return # terminate function.
|
|
91
|
-
elif len(choice_selected) == 1 and choice_selected[0] == "all":
|
|
92
|
-
choice_selected = "all" # i.e. program_keys = program_keys
|
|
93
|
-
else:
|
|
94
|
-
choice_selected = choice
|
|
95
|
-
|
|
96
|
-
if isinstance(choice_selected, str):
|
|
97
|
-
if str(choice_selected) == "all" and system == "Windows":
|
|
98
|
-
if os.name == "nt":
|
|
99
|
-
try:
|
|
100
|
-
is_admin = ctypes.windll.shell32.IsUserAnAdmin()
|
|
101
|
-
except Exception:
|
|
102
|
-
is_admin = False
|
|
103
|
-
else:
|
|
104
|
-
is_admin = False
|
|
105
|
-
if not is_admin:
|
|
106
|
-
warning_body = "\n".join([
|
|
107
|
-
"[bold yellow]Administrator privileges required[/]",
|
|
108
|
-
"Run the terminal as admin and try again to avoid repeated elevation prompts.",
|
|
109
|
-
])
|
|
110
|
-
console.print(
|
|
111
|
-
Panel.fit(
|
|
112
|
-
warning_body,
|
|
113
|
-
title="⚠️ Permission Needed",
|
|
114
|
-
border_style="yellow",
|
|
115
|
-
padding=(1, 2),
|
|
116
|
-
)
|
|
117
|
-
)
|
|
118
|
-
raise RuntimeError("Run terminal as admin and try again, otherwise, there will be too many popups for admin requests and no chance to terminate the program.")
|
|
119
|
-
elif choice_selected == "all":
|
|
120
|
-
console.print(
|
|
121
|
-
Panel(
|
|
122
|
-
Pretty(program_keys),
|
|
123
|
-
title="🔍 Processing All Program Keys",
|
|
124
|
-
border_style="cyan",
|
|
125
|
-
padding=(1, 2),
|
|
126
|
-
)
|
|
127
|
-
)
|
|
128
|
-
pass # i.e. program_keys = program_keys
|
|
129
|
-
else:
|
|
130
|
-
program_keys = [choice_selected]
|
|
131
|
-
else:
|
|
132
|
-
program_keys = choice_selected
|
|
133
|
-
|
|
134
|
-
for program_key in program_keys:
|
|
135
|
-
console.rule(f"🔄 Processing [bold]{program_key}[/] symlinks", style="cyan")
|
|
136
|
-
for file_key, file_map in symlink_mapper[program_key].items():
|
|
137
|
-
this = PathExtended(file_map["this"])
|
|
138
|
-
to_this = PathExtended(file_map["to_this"].replace("REPO_ROOT", REPO_ROOT.as_posix()).replace("LIBRARY_ROOT", LIBRARY_ROOT.as_posix()))
|
|
139
|
-
|
|
140
|
-
if "contents" in file_map:
|
|
141
|
-
try:
|
|
142
|
-
targets = list(to_this.expanduser().search("*"))
|
|
143
|
-
for a_target in targets:
|
|
144
|
-
result = symlink_func(this=this.joinpath(a_target.name), to_this=a_target, prioritize_to_this=prioritize_to_this)
|
|
145
|
-
operation_records.append({
|
|
146
|
-
"program": program_key,
|
|
147
|
-
"file_key": file_key,
|
|
148
|
-
"source": str(this.joinpath(a_target.name)),
|
|
149
|
-
"target": str(a_target),
|
|
150
|
-
"operation": "contents_symlink",
|
|
151
|
-
"action": result["action"],
|
|
152
|
-
"details": result["details"],
|
|
153
|
-
"status": "success"
|
|
154
|
-
})
|
|
155
|
-
except Exception as ex:
|
|
156
|
-
console.print(f"❌ [red]Config error[/red]: {program_key} | {file_key} | missing keys 'this ==> to_this'. {ex}")
|
|
157
|
-
operation_records.append({
|
|
158
|
-
"program": program_key,
|
|
159
|
-
"file_key": file_key,
|
|
160
|
-
"source": str(this),
|
|
161
|
-
"target": str(to_this),
|
|
162
|
-
"operation": "contents_symlink",
|
|
163
|
-
"action": "error",
|
|
164
|
-
"details": f"Failed to process contents: {str(ex)}",
|
|
165
|
-
"status": f"error: {str(ex)}"
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
elif "copy" in file_map:
|
|
169
|
-
try:
|
|
170
|
-
result = symlink_copy(this=this, to_this=to_this, prioritize_to_this=prioritize_to_this)
|
|
171
|
-
operation_records.append({
|
|
172
|
-
"program": program_key,
|
|
173
|
-
"file_key": file_key,
|
|
174
|
-
"source": str(this),
|
|
175
|
-
"target": str(to_this),
|
|
176
|
-
"operation": "copy",
|
|
177
|
-
"action": result["action"],
|
|
178
|
-
"details": result["details"],
|
|
179
|
-
"status": "success"
|
|
180
|
-
})
|
|
181
|
-
except Exception as ex:
|
|
182
|
-
console.print(f"❌ [red]Config error[/red]: {program_key} | {file_key} | {ex}")
|
|
183
|
-
operation_records.append({
|
|
184
|
-
"program": program_key,
|
|
185
|
-
"file_key": file_key,
|
|
186
|
-
"source": str(this),
|
|
187
|
-
"target": str(to_this),
|
|
188
|
-
"operation": "copy",
|
|
189
|
-
"action": "error",
|
|
190
|
-
"details": f"Failed to copy: {str(ex)}",
|
|
191
|
-
"status": f"error: {str(ex)}"
|
|
192
|
-
})
|
|
193
|
-
else:
|
|
194
|
-
try:
|
|
195
|
-
result = symlink_func(this=this, to_this=to_this, prioritize_to_this=prioritize_to_this)
|
|
196
|
-
operation_records.append({
|
|
197
|
-
"program": program_key,
|
|
198
|
-
"file_key": file_key,
|
|
199
|
-
"source": str(this),
|
|
200
|
-
"target": str(to_this),
|
|
201
|
-
"operation": "symlink",
|
|
202
|
-
"action": result["action"],
|
|
203
|
-
"details": result["details"],
|
|
204
|
-
"status": "success"
|
|
205
|
-
})
|
|
206
|
-
except Exception as ex:
|
|
207
|
-
console.print(f"❌ [red]Config error[/red]: {program_key} | {file_key} | missing keys 'this ==> to_this'. {ex}")
|
|
208
|
-
operation_records.append({
|
|
209
|
-
"program": program_key,
|
|
210
|
-
"file_key": file_key,
|
|
211
|
-
"source": str(this),
|
|
212
|
-
"target": str(to_this),
|
|
213
|
-
"operation": "symlink",
|
|
214
|
-
"action": "error",
|
|
215
|
-
"details": f"Failed to create symlink: {str(ex)}",
|
|
216
|
-
"status": f"error: {str(ex)}"
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
if program_key == "ssh" and system == "Linux": # permissions of ~/dotfiles/.ssh should be adjusted
|
|
220
|
-
try:
|
|
221
|
-
console.print("\n[bold]🔒 Setting secure permissions for SSH files...[/bold]")
|
|
222
|
-
subprocess.run("chmod 700 ~/.ssh/", check=True)
|
|
223
|
-
subprocess.run("chmod 700 ~/dotfiles/creds/.ssh/", check=True) # may require sudo
|
|
224
|
-
subprocess.run("chmod 600 ~/dotfiles/creds/.ssh/*", check=True)
|
|
225
|
-
console.print("[green]✅ SSH permissions set successfully[/green]")
|
|
226
|
-
except Exception as e:
|
|
227
|
-
ERROR_LIST.append(e)
|
|
228
|
-
console.print(f"❌ [red]Error setting SSH permissions[/red]: {e}")
|
|
229
|
-
|
|
230
|
-
if system == "Linux":
|
|
231
|
-
console.print("\n[bold]📜 Setting executable permissions for scripts...[/bold]")
|
|
232
|
-
subprocess.run(f"chmod +x {LIBRARY_ROOT.joinpath(f'scripts/{system.lower()}')} -R", shell=True, capture_output=True, text=True)
|
|
233
|
-
console.print("[green]✅ Script permissions updated[/green]")
|
|
234
|
-
|
|
235
|
-
# Display operation summary table
|
|
236
|
-
if operation_records:
|
|
237
|
-
table = Table(title="🔗 Symlink Operations Summary", show_header=True, header_style="bold magenta")
|
|
238
|
-
table.add_column("Program", style="cyan", no_wrap=True)
|
|
239
|
-
table.add_column("File Key", style="blue", no_wrap=True)
|
|
240
|
-
table.add_column("Source", style="green")
|
|
241
|
-
table.add_column("Target", style="yellow")
|
|
242
|
-
table.add_column("Operation", style="magenta", no_wrap=True)
|
|
243
|
-
table.add_column("Action", style="red", no_wrap=True)
|
|
244
|
-
table.add_column("Details", style="white")
|
|
245
|
-
table.add_column("Status", style="red", no_wrap=True)
|
|
246
|
-
|
|
247
|
-
for record in operation_records:
|
|
248
|
-
status_style = "green" if record["status"] == "success" else "red"
|
|
249
|
-
action_style = "green" if record["action"] != "error" else "red"
|
|
250
|
-
table.add_row(
|
|
251
|
-
record["program"],
|
|
252
|
-
record["file_key"],
|
|
253
|
-
record["source"],
|
|
254
|
-
record["target"],
|
|
255
|
-
record["operation"],
|
|
256
|
-
f"[{action_style}]{record['action']}[/{action_style}]",
|
|
257
|
-
record["details"],
|
|
258
|
-
f"[{status_style}]{record['status']}[/{status_style}]"
|
|
259
|
-
)
|
|
260
|
-
|
|
261
|
-
console.print("\n")
|
|
262
|
-
console.print(table)
|
|
263
|
-
|
|
264
|
-
if len(ERROR_LIST) > 0:
|
|
265
|
-
console.print(
|
|
266
|
-
Panel(
|
|
267
|
-
Pretty(ERROR_LIST),
|
|
268
|
-
title="❗ Errors Encountered During Processing",
|
|
269
|
-
border_style="red",
|
|
270
|
-
padding=(1, 2),
|
|
271
|
-
)
|
|
272
|
-
)
|
|
273
|
-
else:
|
|
274
|
-
console.print(
|
|
275
|
-
Panel.fit(
|
|
276
|
-
Text("✅ All symlinks created successfully!", justify="center"),
|
|
277
|
-
title="Symlink Creation Complete",
|
|
278
|
-
border_style="green",
|
|
279
|
-
)
|
|
280
|
-
)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
def main_symlinks():
|
|
284
|
-
console.print("")
|
|
285
|
-
console.rule("[bold blue]🔗 CREATING SYMLINKS 🔗")
|
|
286
|
-
apply_mapper(choice="all", prioritize_to_this=True)
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
def main_profile():
|
|
290
|
-
console.print("")
|
|
291
|
-
console.rule("[bold green]🐚 CREATING SHELL PROFILE 🐚")
|
|
292
|
-
create_default_shell_profile()
|
|
293
|
-
console.print(
|
|
294
|
-
Panel.fit(
|
|
295
|
-
Text("✨ Configuration setup complete! ✨", justify="center"),
|
|
296
|
-
title="Profile Setup",
|
|
297
|
-
border_style="green",
|
|
298
|
-
)
|
|
299
|
-
)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if __name__ == "__main__":
|
|
303
|
-
pass
|