sysetup 1.3.6__tar.gz → 1.4.0__tar.gz
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.
- {sysetup-1.3.6/src/sysetup.egg-info → sysetup-1.4.0}/PKG-INFO +3 -4
- {sysetup-1.3.6 → sysetup-1.4.0}/README.md +1 -2
- {sysetup-1.3.6 → sysetup-1.4.0}/pyproject.toml +2 -2
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/context/context.py +2 -1
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/files/assets.py +4 -3
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/files/settings.py +4 -7
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/installations.py +14 -9
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/main.py +2 -4
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/packages.py +42 -16
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/models/action.py +0 -1
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/models/options.py +2 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/models/path.py +0 -6
- sysetup-1.4.0/src/sysetup/utils/__init__.py +4 -0
- sysetup-1.4.0/src/sysetup/utils/bitwarden.py +52 -0
- sysetup-1.4.0/src/sysetup/utils/download.py +28 -0
- {sysetup-1.3.6 → sysetup-1.4.0/src/sysetup.egg-info}/PKG-INFO +3 -4
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup.egg-info/SOURCES.txt +2 -2
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup.egg-info/requires.txt +1 -1
- {sysetup-1.3.6 → sysetup-1.4.0}/tests/test_background.py +1 -9
- sysetup-1.3.6/src/sysetup/main/environment.py +0 -13
- sysetup-1.3.6/src/sysetup/utils/__init__.py +0 -2
- sysetup-1.3.6/src/sysetup/utils/download.py +0 -12
- {sysetup-1.3.6 → sysetup-1.4.0}/LICENSE +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/bin/pw +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/bin/pw-askpass +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/setup.cfg +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/__init__.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/cli/__init__.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/cli/entry_point.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/context/__init__.py +0 -0
- {sysetup-1.3.6/src/sysetup/utils → sysetup-1.4.0/src/sysetup/context}/installations.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/__init__.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/files/__init__.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/files/permissions.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/main/files/setup.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/models/__init__.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup/py.typed +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup.egg-info/dependency_links.txt +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup.egg-info/entry_points.txt +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/src/sysetup.egg-info/top_level.txt +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/tests/test_cli_entry_point.py +0 -0
- {sysetup-1.3.6 → sysetup-1.4.0}/tests/test_main.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: sysetup
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Personal system setup
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -12,10 +12,10 @@ Requires-Dist: backupmaster<2,>=1.2.21
|
|
|
12
12
|
Requires-Dist: dbus-next<1,>=0.2.3
|
|
13
13
|
Requires-Dist: package-utils[context]<1,>=0.6.1
|
|
14
14
|
Requires-Dist: powercli<1,>=0.3.1
|
|
15
|
-
Requires-Dist: python-dotenv<2,>=1.0.1
|
|
16
15
|
Requires-Dist: requests<3,>=2.32.3
|
|
17
16
|
Requires-Dist: superpathlib<3,>=2.0.4
|
|
18
17
|
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: types-requests<3,>=2.32.0.20250306; extra == "dev"
|
|
19
19
|
Requires-Dist: package-dev-tools<1,>=0.5.11; extra == "dev"
|
|
20
20
|
Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
|
|
|
34
34
|
```shell
|
|
35
35
|
wget -O - sysetup.quintenroets.com | bash
|
|
36
36
|
```
|
|
37
|
-
give
|
|
37
|
+
give Bitwarden password when prompted
|
|
38
38
|
2) Appearance
|
|
39
39
|
* Set wallpaper
|
|
40
40
|
* Select We10OSX Cursors
|
|
@@ -46,7 +46,6 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
|
|
|
46
46
|
* Click experimental: enable tab groups save and sync
|
|
47
47
|
5) Login to
|
|
48
48
|
* Pycharm professional
|
|
49
|
-
* VNC Server
|
|
50
49
|
6) For new device: set touchpad scroll direction and click on touch
|
|
51
50
|
|
|
52
51
|
## Installation
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
```shell
|
|
14
14
|
wget -O - sysetup.quintenroets.com | bash
|
|
15
15
|
```
|
|
16
|
-
give
|
|
16
|
+
give Bitwarden password when prompted
|
|
17
17
|
2) Appearance
|
|
18
18
|
* Set wallpaper
|
|
19
19
|
* Select We10OSX Cursors
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
* Click experimental: enable tab groups save and sync
|
|
26
26
|
5) Login to
|
|
27
27
|
* Pycharm professional
|
|
28
|
-
* VNC Server
|
|
29
28
|
6) For new device: set touchpad scroll direction and click on touch
|
|
30
29
|
|
|
31
30
|
## Installation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sysetup"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.4.0"
|
|
4
4
|
description = "Personal system setup"
|
|
5
5
|
authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
|
|
6
6
|
license = {text = "MIT"}
|
|
@@ -11,13 +11,13 @@ dependencies = [
|
|
|
11
11
|
"dbus-next >=0.2.3, <1",
|
|
12
12
|
"package-utils[context] >=0.6.1, <1",
|
|
13
13
|
"powercli >=0.3.1, <1",
|
|
14
|
-
"python-dotenv >=1.0.1, <2",
|
|
15
14
|
"requests >=2.32.3, <3",
|
|
16
15
|
"superpathlib >=2.0.4, <3",
|
|
17
16
|
]
|
|
18
17
|
|
|
19
18
|
[project.optional-dependencies]
|
|
20
19
|
dev = [
|
|
20
|
+
"types-requests >=2.32.0.20250306, <3",
|
|
21
21
|
"package-dev-tools >=0.5.11, <1",
|
|
22
22
|
"package-dev-utils >=0.1.6, <1",
|
|
23
23
|
]
|
|
@@ -4,7 +4,8 @@ from functools import cached_property
|
|
|
4
4
|
from package_utils.context import Context as Context_
|
|
5
5
|
|
|
6
6
|
from sysetup.models import Options
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
from .installations import is_installed
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class Context(Context_[Options, None, None]):
|
|
@@ -33,11 +33,12 @@ def move_setup_files() -> None:
|
|
|
33
33
|
else:
|
|
34
34
|
archived_setup_files.append(path)
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if setup_files:
|
|
37
|
+
cache.Backup(paths=setup_files).pull()
|
|
38
38
|
|
|
39
|
+
source = cache.Backup().source
|
|
39
40
|
for path in archived_setup_files:
|
|
40
|
-
dest = (
|
|
41
|
+
dest = (source / path.relative_to(setup_files_root)).parent
|
|
41
42
|
if dest.is_root and not dest.exists():
|
|
42
43
|
cli.run("mkdir -p", dest, root=True)
|
|
43
44
|
else:
|
|
@@ -2,7 +2,7 @@ import cli
|
|
|
2
2
|
|
|
3
3
|
from sysetup.context import context
|
|
4
4
|
from sysetup.models import Path
|
|
5
|
-
from sysetup.utils import download_directory
|
|
5
|
+
from sysetup.utils import download_directory, is_installed
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def remove_clutter() -> None:
|
|
@@ -29,11 +29,8 @@ def set_background() -> None: # pragma: nocover
|
|
|
29
29
|
Path.HOME / ".local" / "share" / "wallpapers" / "Qwallpapers" / "background.jpg"
|
|
30
30
|
)
|
|
31
31
|
download_directory(wallpaper_path.parent)
|
|
32
|
-
|
|
33
|
-
script =
|
|
34
|
-
"__wallpaper_uri__",
|
|
35
|
-
wallpaper_uri,
|
|
36
|
-
)
|
|
32
|
+
script = Path.update_wallpaper_script.text
|
|
33
|
+
script = script.replace("__wallpaper_uri__", wallpaper_path.as_uri())
|
|
37
34
|
run_kde_script(script)
|
|
38
35
|
|
|
39
36
|
|
|
@@ -41,5 +38,5 @@ def run_kde_script(script: str) -> None: # pragma: nocover
|
|
|
41
38
|
command = (
|
|
42
39
|
"qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript"
|
|
43
40
|
)
|
|
44
|
-
if not context.is_running_in_test and
|
|
41
|
+
if not context.is_running_in_test and is_installed("qdbus"):
|
|
45
42
|
cli.run(command, script)
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
1
|
import cli
|
|
4
2
|
|
|
5
3
|
from sysetup.context import context
|
|
6
4
|
from sysetup.models import Path
|
|
7
|
-
from sysetup.utils import
|
|
5
|
+
from sysetup.utils import bitwarden, is_installed
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
def setup() -> None:
|
|
11
9
|
install_chromium()
|
|
12
10
|
install_keyd()
|
|
13
|
-
|
|
14
|
-
enable_service("ydotoold")
|
|
11
|
+
install_ydotool()
|
|
15
12
|
enable_service("ssh")
|
|
16
13
|
install_language_support()
|
|
17
14
|
install_personal_git_repositories()
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
def install_personal_git_repositories() -> None:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if token is not None:
|
|
24
|
-
base_url = base_url.replace("github.com", f"{token}@github.com")
|
|
18
|
+
github_token = bitwarden.client.fetch_secret("GitHub")
|
|
19
|
+
base_url = f"https://{github_token}@github.com/quintenroets"
|
|
25
20
|
if not Path.extensions.exists():
|
|
26
21
|
command = f"git clone {base_url}/extensions.git"
|
|
27
22
|
cli.run(command, Path.extensions)
|
|
@@ -72,4 +67,14 @@ def install_repository(name: str, repository: str) -> None:
|
|
|
72
67
|
url = f"https://github.com/{repository}"
|
|
73
68
|
with Path.tempdir() as directory:
|
|
74
69
|
cli.run("git clone", url, directory)
|
|
70
|
+
if (directory / "CMakeLists.txt").exists():
|
|
71
|
+
cli.run("apt-get install -y cmake", root=True)
|
|
72
|
+
cli.run("cmake .", cwd=directory)
|
|
75
73
|
cli.run_commands("make", "sudo make install", cwd=directory)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def install_ydotool() -> None:
|
|
77
|
+
if not is_installed("ydotool"):
|
|
78
|
+
cli.run("apt-get install scdoc", root=True)
|
|
79
|
+
install_repository("ydotool", "ReimuNotMoe/ydotool")
|
|
80
|
+
enable_service("ydotoold")
|
|
@@ -3,7 +3,7 @@ import cli
|
|
|
3
3
|
from sysetup.context import context
|
|
4
4
|
from sysetup.models import Action
|
|
5
5
|
|
|
6
|
-
from . import
|
|
6
|
+
from . import files, installations, packages
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def main() -> None:
|
|
@@ -12,17 +12,15 @@ def main() -> None:
|
|
|
12
12
|
"""
|
|
13
13
|
action_mapper = {
|
|
14
14
|
Action.all.value: setup,
|
|
15
|
-
Action.
|
|
15
|
+
Action.packages.value: packages.setup,
|
|
16
16
|
Action.files.value: files.setup,
|
|
17
17
|
Action.install.value: installations.setup,
|
|
18
|
-
Action.packages.value: packages.setup,
|
|
19
18
|
}
|
|
20
19
|
action = action_mapper[context.options.action.value]
|
|
21
20
|
action()
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
def setup() -> None:
|
|
25
|
-
environment.setup()
|
|
26
24
|
packages.setup()
|
|
27
25
|
files.setup()
|
|
28
26
|
installations.setup()
|
|
@@ -1,29 +1,58 @@
|
|
|
1
|
+
import platform
|
|
2
|
+
import shlex
|
|
3
|
+
import warnings
|
|
4
|
+
from collections.abc import Iterable
|
|
5
|
+
|
|
1
6
|
import cli
|
|
2
7
|
|
|
3
8
|
from sysetup.context import context
|
|
4
9
|
from sysetup.models import Path
|
|
5
|
-
from sysetup.utils import download_directory, is_installed
|
|
10
|
+
from sysetup.utils import bitwarden, download_directory, is_installed
|
|
6
11
|
|
|
7
12
|
|
|
8
13
|
def setup() -> None:
|
|
14
|
+
enable_sudo()
|
|
9
15
|
update_package_manager()
|
|
10
16
|
install_packages()
|
|
11
17
|
cleanup_after_install()
|
|
12
18
|
|
|
13
19
|
|
|
20
|
+
def enable_sudo() -> None:
|
|
21
|
+
password = bitwarden.client.fetch_secret("Laptop")
|
|
22
|
+
cli.run("sudo -S true", input=password) # activate sudo without askpass
|
|
23
|
+
|
|
24
|
+
|
|
14
25
|
def install_packages() -> None:
|
|
15
26
|
download_directory(Path.packages)
|
|
16
|
-
|
|
27
|
+
packages_install_command = (
|
|
28
|
+
"apt-get install -y" if context.apt_is_installed else "pacman -S --noconfirm"
|
|
29
|
+
)
|
|
30
|
+
installations = {"packages": packages_install_command, "snap": "snap install"}
|
|
17
31
|
for name, command in installations.items():
|
|
18
32
|
path = (Path.packages / name).with_suffix(".yaml")
|
|
19
33
|
packages: list[str] = path.yaml
|
|
20
|
-
|
|
34
|
+
install(packages, install_command=command)
|
|
21
35
|
|
|
22
36
|
if not context.apt_is_installed:
|
|
23
37
|
commands = "sudo pacman -S --noconfirm base-devel", "uv pip install wheel"
|
|
24
38
|
cli.run_commands(*commands)
|
|
25
39
|
|
|
26
40
|
|
|
41
|
+
def cleanup_after_install() -> None:
|
|
42
|
+
if context.apt_is_installed:
|
|
43
|
+
cli.run("sudo apt-get autoremove -y")
|
|
44
|
+
cli.run("tlp start", root=True)
|
|
45
|
+
if is_installed("qdbus"):
|
|
46
|
+
commands = "rm /usr/bin/qdbus", "ln -s /usr/lib/qt6/bin/qdbus /usr/bin/qdbus"
|
|
47
|
+
cli.run_commands(*commands, root=True)
|
|
48
|
+
delete = "apt purge -y" if context.apt_is_installed else "pacman -R --noconfirm"
|
|
49
|
+
commands = (
|
|
50
|
+
"auto-cpufreq --install", # Fails on VM
|
|
51
|
+
f"{delete} firefox", # fails if firefox not installed
|
|
52
|
+
)
|
|
53
|
+
cli.run_commands(*commands, check=False, root=True)
|
|
54
|
+
|
|
55
|
+
|
|
27
56
|
def update_package_manager() -> None:
|
|
28
57
|
if context.apt_is_installed:
|
|
29
58
|
update_apt()
|
|
@@ -42,16 +71,13 @@ def update_apt() -> None:
|
|
|
42
71
|
cli.run("ln -s /var/lib/snapd/snap /snap", root=True)
|
|
43
72
|
|
|
44
73
|
|
|
45
|
-
def
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
f"{delete} firefox", # fails if firefox not installed
|
|
56
|
-
)
|
|
57
|
-
cli.run_commands(*commands, check=False, root=True)
|
|
74
|
+
def install(packages: Iterable[str], install_command: str) -> None:
|
|
75
|
+
is_linux = platform.system() == "Linux"
|
|
76
|
+
if not is_linux:
|
|
77
|
+
message = "Required packages can only be installed on Linux"
|
|
78
|
+
warnings.warn(message, stacklevel=2)
|
|
79
|
+
return
|
|
80
|
+
|
|
81
|
+
for package in packages:
|
|
82
|
+
args = shlex.split(package)
|
|
83
|
+
cli.run(install_command, *args, root=True, check=False)
|
|
@@ -8,4 +8,6 @@ from .action import Action
|
|
|
8
8
|
|
|
9
9
|
@dataclass
|
|
10
10
|
class Options:
|
|
11
|
+
bitwarden_password: Annotated[str, typer.Option()] = ""
|
|
12
|
+
bitwarden_email: Annotated[str, typer.Option()] = "quinten.roets@gmail.com"
|
|
11
13
|
action: Annotated[Action, typer.Argument(help="The part to setup")] = Action.all
|
|
@@ -41,9 +41,3 @@ class Path(superpathlib.Path):
|
|
|
41
41
|
def update_wallpaper_script(cls: type[T]) -> T:
|
|
42
42
|
path = cls.source_root / "assets" / "scripts" / "update_wallpaper.js"
|
|
43
43
|
return cast(T, path)
|
|
44
|
-
|
|
45
|
-
@classmethod
|
|
46
|
-
@classproperty
|
|
47
|
-
def profile(cls: type[T]) -> T:
|
|
48
|
-
path = cls.HOME / ".bash_profile"
|
|
49
|
-
return cast(T, path)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import io
|
|
2
|
+
import json
|
|
3
|
+
import zipfile
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from functools import cached_property
|
|
6
|
+
from typing import cast
|
|
7
|
+
|
|
8
|
+
import cli
|
|
9
|
+
import requests
|
|
10
|
+
from rich.prompt import Prompt
|
|
11
|
+
|
|
12
|
+
from sysetup.context import context
|
|
13
|
+
from sysetup.models import Path
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class Client:
|
|
18
|
+
password: str
|
|
19
|
+
email: str
|
|
20
|
+
download_url: str = "https://bitwarden.com/download/?app=cli&platform=linux"
|
|
21
|
+
|
|
22
|
+
def fetch_secret(self, name: str) -> str:
|
|
23
|
+
command = "./bw list items --session", self.session_token, "--search", name
|
|
24
|
+
response = cli.capture_output(*command)
|
|
25
|
+
secret = json.loads(response)[0]["notes"]
|
|
26
|
+
return cast(str, secret)
|
|
27
|
+
|
|
28
|
+
@cached_property
|
|
29
|
+
def session_token(self) -> str:
|
|
30
|
+
if not Path("bw").exists():
|
|
31
|
+
self.download_cli()
|
|
32
|
+
output = cli.capture_output(f"./bw login {self.email} {self.password}")
|
|
33
|
+
return output.split("--session ")[-1]
|
|
34
|
+
|
|
35
|
+
def download_cli(self) -> None:
|
|
36
|
+
response = requests.get(self.download_url, timeout=10).content
|
|
37
|
+
zip_bytes = io.BytesIO(response)
|
|
38
|
+
with zipfile.ZipFile(zip_bytes, "r") as zip_file:
|
|
39
|
+
zip_file.extractall()
|
|
40
|
+
Path("bw").chmod(0o755)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass
|
|
44
|
+
class Bitwarden:
|
|
45
|
+
@cached_property
|
|
46
|
+
def client(self) -> Client:
|
|
47
|
+
password = context.options.bitwarden_password
|
|
48
|
+
password = password or Prompt.ask("Bitwarden password", password=True)
|
|
49
|
+
return Client(password=password, email=context.options.bitwarden_email)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
bitwarden = Bitwarden()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import cli
|
|
4
|
+
from backup.backups import Backup
|
|
5
|
+
from backup.context import context as backup_context
|
|
6
|
+
from backup.models import Path as BackupPath
|
|
7
|
+
|
|
8
|
+
from sysetup.models import Path
|
|
9
|
+
|
|
10
|
+
from .bitwarden import bitwarden
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def download_directory(path: Path) -> None:
|
|
14
|
+
check_authenticated()
|
|
15
|
+
Backup(sub_check_path=BackupPath(path), confirm=False).pull()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def download_file(path: Path) -> None:
|
|
19
|
+
check_authenticated()
|
|
20
|
+
Backup(path=BackupPath(path), confirm=False).pull()
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def check_authenticated() -> None:
|
|
24
|
+
try:
|
|
25
|
+
assert backup_context.secrets.rclone
|
|
26
|
+
except cli.models.CalledProcessError:
|
|
27
|
+
os.environ["RCLONE"] = "dummy"
|
|
28
|
+
backup_context.secrets.rclone = bitwarden.client.fetch_secret("Rclone")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: sysetup
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Personal system setup
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -12,10 +12,10 @@ Requires-Dist: backupmaster<2,>=1.2.21
|
|
|
12
12
|
Requires-Dist: dbus-next<1,>=0.2.3
|
|
13
13
|
Requires-Dist: package-utils[context]<1,>=0.6.1
|
|
14
14
|
Requires-Dist: powercli<1,>=0.3.1
|
|
15
|
-
Requires-Dist: python-dotenv<2,>=1.0.1
|
|
16
15
|
Requires-Dist: requests<3,>=2.32.3
|
|
17
16
|
Requires-Dist: superpathlib<3,>=2.0.4
|
|
18
17
|
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: types-requests<3,>=2.32.0.20250306; extra == "dev"
|
|
19
19
|
Requires-Dist: package-dev-tools<1,>=0.5.11; extra == "dev"
|
|
20
20
|
Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
|
|
|
34
34
|
```shell
|
|
35
35
|
wget -O - sysetup.quintenroets.com | bash
|
|
36
36
|
```
|
|
37
|
-
give
|
|
37
|
+
give Bitwarden password when prompted
|
|
38
38
|
2) Appearance
|
|
39
39
|
* Set wallpaper
|
|
40
40
|
* Select We10OSX Cursors
|
|
@@ -46,7 +46,6 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
|
|
|
46
46
|
* Click experimental: enable tab groups save and sync
|
|
47
47
|
5) Login to
|
|
48
48
|
* Pycharm professional
|
|
49
|
-
* VNC Server
|
|
50
49
|
6) For new device: set touchpad scroll direction and click on touch
|
|
51
50
|
|
|
52
51
|
## Installation
|
|
@@ -15,8 +15,8 @@ src/sysetup/cli/__init__.py
|
|
|
15
15
|
src/sysetup/cli/entry_point.py
|
|
16
16
|
src/sysetup/context/__init__.py
|
|
17
17
|
src/sysetup/context/context.py
|
|
18
|
+
src/sysetup/context/installations.py
|
|
18
19
|
src/sysetup/main/__init__.py
|
|
19
|
-
src/sysetup/main/environment.py
|
|
20
20
|
src/sysetup/main/installations.py
|
|
21
21
|
src/sysetup/main/main.py
|
|
22
22
|
src/sysetup/main/packages.py
|
|
@@ -30,8 +30,8 @@ src/sysetup/models/action.py
|
|
|
30
30
|
src/sysetup/models/options.py
|
|
31
31
|
src/sysetup/models/path.py
|
|
32
32
|
src/sysetup/utils/__init__.py
|
|
33
|
+
src/sysetup/utils/bitwarden.py
|
|
33
34
|
src/sysetup/utils/download.py
|
|
34
|
-
src/sysetup/utils/installations.py
|
|
35
35
|
tests/test_background.py
|
|
36
36
|
tests/test_cli_entry_point.py
|
|
37
37
|
tests/test_main.py
|
|
@@ -2,10 +2,10 @@ backupmaster<2,>=1.2.21
|
|
|
2
2
|
dbus-next<1,>=0.2.3
|
|
3
3
|
package-utils[context]<1,>=0.6.1
|
|
4
4
|
powercli<1,>=0.3.1
|
|
5
|
-
python-dotenv<2,>=1.0.1
|
|
6
5
|
requests<3,>=2.32.3
|
|
7
6
|
superpathlib<3,>=2.0.4
|
|
8
7
|
|
|
9
8
|
[dev]
|
|
9
|
+
types-requests<3,>=2.32.0.20250306
|
|
10
10
|
package-dev-tools<1,>=0.5.11
|
|
11
11
|
package-dev-utils<1,>=0.1.6
|
|
@@ -3,7 +3,6 @@ from collections.abc import Callable, Iterator
|
|
|
3
3
|
|
|
4
4
|
import cli
|
|
5
5
|
import pytest
|
|
6
|
-
from backup.context import context
|
|
7
6
|
from backup.utils import setup
|
|
8
7
|
|
|
9
8
|
from sysetup.main.files.settings import set_background
|
|
@@ -30,17 +29,10 @@ def restore_and_check(
|
|
|
30
29
|
restore: Callable[[Path], Iterator[None]],
|
|
31
30
|
) -> Callable[[Path], Iterator[None]]:
|
|
32
31
|
setup.check_setup()
|
|
33
|
-
env = os.environ | {"RCLONE_CONFIG_PASS": context.secrets.rclone}
|
|
34
|
-
env.pop("RCLONE_PASSWORD_COMMAND", None)
|
|
35
32
|
|
|
36
33
|
def _restore_and_check(restored_path: Path) -> Iterator[None]:
|
|
37
34
|
def extract_content_hash() -> str:
|
|
38
|
-
return cli.capture_output(
|
|
39
|
-
"rclone hashsum MD5",
|
|
40
|
-
restored_path,
|
|
41
|
-
env=env,
|
|
42
|
-
check=False,
|
|
43
|
-
)
|
|
35
|
+
return cli.capture_output("rclone hashsum MD5", restored_path, check=False)
|
|
44
36
|
|
|
45
37
|
content_hash = extract_content_hash()
|
|
46
38
|
yield from restore(restored_path)
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
from dotenv import load_dotenv
|
|
4
|
-
|
|
5
|
-
from sysetup.models import Path
|
|
6
|
-
from sysetup.utils import download_file
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def setup() -> None:
|
|
10
|
-
download_file(Path("etc") / "environment")
|
|
11
|
-
if "SUDO_ASKPASS" not in os.environ:
|
|
12
|
-
download_file(Path.profile)
|
|
13
|
-
load_dotenv(dotenv_path=Path.profile)
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
from backup.backups import Backup
|
|
2
|
-
from backup.models import Path as BackupPath
|
|
3
|
-
|
|
4
|
-
from sysetup.models import Path
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def download_directory(path: Path) -> None:
|
|
8
|
-
Backup(sub_check_path=BackupPath(path), confirm=False).pull()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def download_file(path: Path) -> None:
|
|
12
|
-
Backup(path=BackupPath(path), confirm=False).pull()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|