Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit 9f80e30

Browse files
committed
refactor: modify the install script
- modified the install script to work with both fedoa and void linux which I intend to be my main desktop environments. - will install most of the needed tools present in the official repos, else it will list them and I can download on the tool for myself
1 parent 9372d53 commit 9f80e30

File tree

2 files changed

+43
-28
lines changed

2 files changed

+43
-28
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ To install this onto your system, run:
55
```bash
66
git clone https://github.com/mbvgua/dotfiles.git ~/.dotfiles
77
cd ~/.dotfiles
8-
chmod +x setup
9-
./setup
8+
python install.py
109

1110
# create symlinks to necessary files
1211
stow .
1312
```
1413

1514
> [!IMPORTANT]
16-
> It might be a good idea to back up existing files of the same name as they will be replaced.
17-
> A good place to customize would be the `.gitconfig` file, change existing variable names to yours
15+
> It might be a good idea to back up existing files of the same name as they will be replaced. A good place to customize would be the `.gitconfig` file, change existing variable names to yours
16+
>
17+
> Also ensure you already have `python ` installed on your system, since the script depends on it to execute.

install.py

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"node",
2727
"npm",
2828
"pnpm",
29-
"ng", # "@angular/cli"
30-
"sqlite",
29+
"sqlite3",
3130
"mysql",
3231
"sqlcmd", # "mssql server"
3332
"subl", # "sublime text"
@@ -57,6 +56,7 @@
5756
"htop",
5857
}
5958
not_installed = []
59+
package_manager = ""
6060

6161

6262
def get_environ():
@@ -72,6 +72,7 @@ def get_environ():
7272
user_system = platform.system()
7373
if user_system == "Linux":
7474
distro = platform.freedesktop_os_release()
75+
print("Aha! A man of culture... ")
7576
print(f"Running on {distro["ID"].capitalize()}")
7677
elif user_system == "Darwin":
7778
print("Running on a Mac system")
@@ -94,10 +95,10 @@ def check_installed():
9495
[f"which {lang}"], shell=True, capture_output=True
9596
)
9697
if is_installed.returncode == 0:
97-
print(f"✓ {lang.capitalize()} is installed")
98+
print(f" {lang.capitalize()} is installed")
9899
else:
99100
not_installed.append(lang)
100-
print(f"✗ {lang.capitalize()} is not installed")
101+
print(f" {lang.capitalize()} is not installed")
101102

102103
print(f"Check if needed dev_tools are installed: ")
103104
for tool in dev_tools:
@@ -106,10 +107,10 @@ def check_installed():
106107
[f"which {tool}"], shell=True, capture_output=True
107108
)
108109
if is_installed.returncode == 0:
109-
print(f"✓ {tool.capitalize()} is installed")
110+
print(f" {tool.capitalize()} is installed")
110111
else:
111112
not_installed.append(tool)
112-
print(f"✗ {tool.capitalize()} is not installed")
113+
print(f" {tool.capitalize()} is not installed")
113114

114115
print(f"Check if needed dev_tools are installed: ")
115116
for tool in cli_tools:
@@ -118,29 +119,41 @@ def check_installed():
118119
[f"which {tool}"], shell=True, capture_output=True
119120
)
120121
if is_installed.returncode == 0:
121-
print(f"✓ {tool.capitalize()} is installed")
122+
print(f" {tool.capitalize()} is installed")
122123
else:
123124
not_installed.append(tool)
124-
print(f"✗ {tool.capitalize()} is not installed")
125+
print(f" {tool.capitalize()} is not installed")
125126

126127

127-
def install_tools(install_this):
128+
def install_tools():
128129
"""
129-
install the tools not currently on the system
130+
install the tools not currently on the system but in fedora repos
131+
for those not in the repos, e.g teams-for-linux, wezterms, sublime etc
132+
they be listed as not installed, and you can download them manually
133+
- teams-for-linux - keyd
134+
- wezterm - sqlcmd
135+
- lisp - brave-browser
136+
- sublime-text - sublime-merge
130137
"""
131-
for app in not_installed:
132-
subprocess.run(
133-
[f"sudo dnf install {app}"],
134-
shell=True,
135-
)
136-
137-
138-
def install_edge_cases(install_this):
139-
"""
140-
install the packages not in the official fedora repo
141-
like wezterm
142-
"""
143-
pass
138+
distro = platform.freedesktop_os_release()
139+
140+
if distro["ID"] == "fedora":
141+
package_manager = "sudo dnf install -y --skip-unavailable"
142+
for app in not_installed:
143+
subprocess.run(
144+
[f"{package_manager} {app}"],
145+
shell=True,
146+
)
147+
elif distro["ID"] == "void":
148+
# become root first
149+
# subprocess.run(["su -"], shell=True)
150+
package_manager = "xbps-install -Sy"
151+
for app in not_installed:
152+
subprocess.run(
153+
[f"{package_manager} {app}"],
154+
shell=True,
155+
)
156+
check_installed()
144157

145158

146159
def main():
@@ -157,8 +170,10 @@ def main():
157170
"""
158171
)
159172
get_environ()
173+
print("")
160174
check_installed()
161-
install_tools(not_installed)
175+
print("")
176+
install_tools()
162177

163178

164179
if __name__ == "__main__":

0 commit comments

Comments
 (0)