Skip to content

Commit 5acc116

Browse files
Update main.py
1 parent 5724e0d commit 5acc116

1 file changed

Lines changed: 21 additions & 13 deletions

File tree

main.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
PYFETCH_VERSION = "1.1.1-2" # Changing the version in this line is highly not recommended.
3+
PYFETCH_VERSION = "1.1.2" # Changing the version in this line is highly not recommended.
44
import os
55

66
# Load ~/.config/pyfetch/pyfetch.conf
@@ -96,13 +96,13 @@ def get_distro_name():
9696
try:
9797
with open("/etc/os-release") as f:
9898
for line in f:
99-
if line.startswith("PRETTY_NAME="):
99+
if line.startswith("NAME="):
100100
return line.strip().split("=")[1].strip('"')
101101
except FileNotFoundError:
102102
return None
103103

104-
if get_distro_name() == "Manjaro":
105-
distro_name = "Trashjaro"
104+
if get_distro_name() == "Manjaro Linux":
105+
distro_name = "Trashjaro Linux"
106106
else:
107107
distro_name = get_distro_name()
108108

@@ -124,7 +124,7 @@ def get_distro_name():
124124
banner_text = distro_name
125125

126126
ascii_banner = pyfiglet.figlet_format(banner_text)
127-
trashjaro_backup = pyfiglet.figlet_format("Trashjaro")
127+
trashjaro_backup = pyfiglet.figlet_format("Trashjaro Linux")
128128

129129
# Find amount of packages
130130
def get_package_count():
@@ -154,7 +154,7 @@ def get_desktop_environment():
154154
de = os.environ.get("XDG_CURRENT_DESKTOP") or os.environ.get("DESKTOP_SESSION") or "Unknown"
155155
if "KDE" in de.upper() or "PLASMA" in de.upper():
156156
return f"KDE Plasma (You have great taste!)"
157-
if "Zorin" in de.upper():
157+
if "zorin:GNOME" in de.upper():
158158
return f"GNOME"
159159
return de
160160

@@ -170,11 +170,14 @@ def get_desktop_environment():
170170
"Windows does not support PyFetch.",
171171
"Did you know Gentoo users compiled their entire soul?",
172172
"Be aware of penguinitis!",
173+
"Your IP Address is 62.57.128.236",
173174
"Did you know Arch users never touch grass?",
174175
"Does people even read these?",
175176
"Did you know Windows users think that Linux users are like hackers?",
176177
"PyFetch was inspired by Neofetch.",
177178
"Candice? Who's candice?",
179+
"The Linux kernel was created by Linus Torvalds",
180+
"Did you know KDE Plasma was created in October 14, 1996 and was originally named KDE for K Desktop Environment?",
178181
"Did you know PyFetch has the MIT License?",
179182
"The PyFetch github is https://github.com/linuxaddict124/pyfetch",
180183
"Python is great for AI!",
@@ -185,7 +188,7 @@ def get_desktop_environment():
185188
# Turn entire base of PyFetch to 1 command
186189
def pyfetchbase():
187190
if cfg.get('ascii_art', 'true') == 'true':
188-
if banner_text == "Manjaro":
191+
if banner_text == "Manjaro" or banner_text == "Manjaro Linux":
189192
print("Autocorrecting to Trashjaro.")
190193
print(trashjaro_backup)
191194
else:
@@ -217,8 +220,8 @@ def pyfetchbase():
217220
run_plugins(plugins, cfg, PYFETCH_VERSION)
218221

219222
def pyfetchbasenonconfig():
220-
if banner_text == "Manjaro":
221-
print("Autocorrecting to Trashjaro.")
223+
if banner_text == "Manjaro" or banner_text == "Manjaro Linux":
224+
print("Autocorrecting to Trashjaro Linux.")
222225
print(trashjaro_backup)
223226
else:
224227
print(ascii_banner)
@@ -241,8 +244,8 @@ def pyfetchbasenonconfig():
241244

242245
def nopluginsbase():
243246
if cfg.get('ascii_art', 'true') == 'true':
244-
if banner_text == "Manjaro":
245-
print("Autocorrecting to Trashjaro.")
247+
if banner_text == "Manjaro" or banner_text == "Manjaro Linux":
248+
print("Autocorrecting to Trashjaro Linux.")
246249
print(trashjaro_backup)
247250
else:
248251
print(ascii_banner)
@@ -283,6 +286,7 @@ def nopluginsbase():
283286
parser.add_argument("--list-plugins", action="store_true", help="List all available plugins")
284287
parser.add_argument("--fun-fact", action="store_true", help="Show some fun facts")
285288
parser.add_argument("--edit-config", action="store_true", help="A easier way to edit pyfetch.conf")
289+
parser.add_argument("--desktop", action="store_true", help="Show your desktop environment")
286290
args = parser.parse_args()
287291

288292
if args.minimal:
@@ -293,8 +297,8 @@ def nopluginsbase():
293297
exit()
294298

295299
if args.banner:
296-
if banner_text == "Manjaro":
297-
print("Autocorrecting to Trashjaro.")
300+
if banner_text == "Manjaro" or banner_text == "Manjaro Linux":
301+
print("Autocorrecting to Trashjaro Linux.")
298302
print(trashjaro_backup)
299303
else:
300304
print(ascii_banner)
@@ -331,6 +335,10 @@ def nopluginsbase():
331335
os.system('nano ~/.config/pyfetch/pyfetch.conf')
332336
exit()
333337

338+
if args.desktop:
339+
print(f"Desktop Environment: {de}")
340+
exit()
341+
334342
# If no flags are running
335343
pyfetchbase()
336344
else:

0 commit comments

Comments
 (0)