Skip to content

Commit

Permalink
Adds support for Windows Subsystem (by @si13n) (#16)
Browse files Browse the repository at this point in the history
* Adds support for Windows Subsystem

* Optimizes 'Microsoft' detection

* Reworks Windows logo with inverted colors on mouse selection
  • Loading branch information
HorlogeSkynet authored Jan 30, 2018
1 parent c941dd8 commit d8bcf0d
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions archey
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Distributions(Enum):
OPENSUSE = 'openSUSE'
RED_HAT = 'Red Hat'
UBUNTU = 'Ubuntu'
WINDOWS = 'Windows'


# -------------- Dictionaries -------------- #
Expand All @@ -67,6 +68,7 @@ colorDict = {
Distributions.OPENSUSE: ['\x1b[1;37m', '\x1b[1;32m'],
Distributions.RED_HAT: ['\x1b[1;37m', '\x1b[1;31m', '\x1b[0;31m'],
Distributions.UBUNTU: ['\x1b[0;31m', '\x1b[1;31m', '\x1b[0;33m'],
Distributions.WINDOWS: ['\x1b[1;31m', '\x1b[1;34m', '\x1b[1;32m', '\x1b[0;33m'],
'sensors': ['\x1b[0;32m', '\x1b[0;33m', '\x1b[0;31m'],
'clear': '\x1b[0m'
}
Expand Down Expand Up @@ -370,7 +372,26 @@ logosDict = {
{c[1]} {c[0]}/hhhhhhhhh{c[2]}-.-:::;{c[1]} {r[14]}
{c[1]} {c[0]}`.:://::- {c[2]}-:::::;{c[1]} {r[15]}
{c[1]} {c[2]}`.-:-'{c[1]} {r[16]}
{c[1]} {r[17]}\n"""
{c[1]} {r[17]}\n""",
Distributions.WINDOWS: """
{c[1]} {r[0]}
{c[1]} {c[0]},.=:^!^!t3Z3z.,{c[1]} {r[1]}
{c[1]} {c[0]}:tt:::tt333EE3{c[1]} {r[2]}
{c[1]} {c[0]}Et:::ztt33EEE{c[1]} {c[2]}@Ee.,{c[1]} {c[2]}..,{c[1]} {r[3]}
{c[1]} {c[0]};tt:::tt333EE7{c[1]} {c[2]};EEEEEEttttt33#{c[1]} {r[4]}
{c[1]} {c[0]}:Et:::zt333EEQ.{c[1]} {c[2]}SEEEEEttttt33QL{c[1]} {r[5]}
{c[1]} {c[0]}it::::tt333EEF{c[1]} {c[2]}@EEEEEEttttt33F{c[1]} {r[6]}
{c[1]} {c[0]};3=*^```'*4EEV{c[1]} {c[2]}:EEEEEEttttt33@.{c[1]} {r[7]}
{c[1]} ,.=::::it=.,{c[0]} `{c[1]} {c[2]}@EEEEEEtttz33QF{c[1]} {r[8]}
{c[1]} ;::::::::zt33){c[1]} {c[2]}'4EEEtttji3P*{c[1]} {r[9]}
{c[1]} :t::::::::tt33.{c[3]}:Z3z..{c[2]} `` {c[3]},..g.{c[1]} {r[10]}
{c[1]} i::::::::zt33F{c[1]} {c[3]}AEEEtttt::::ztF{c[1]} {r[11]}
{c[1]} ;:::::::::t33V{c[1]} {c[3]};EEEttttt::::t3{c[1]} {r[12]}
{c[1]} E::::::::zt33L{c[1]} {c[3]}@EEEtttt::::z3F{c[1]} {r[13]}
{c[1]} {{3=*^```'*4E3){c[1]} {c[3]};EEEtttt:::::tZ`{c[1]} {r[14]}
{c[1]} `{c[1]} {c[3]}:EEEEtttt::::z7{c[1]} {r[15]}
{c[1]} {c[3]}'VEzjt:;;z>*`{c[1]} {r[16]}
{c[1]} {r[17]}\n"""
}


Expand Down Expand Up @@ -478,13 +499,18 @@ class Output:
print('Please, install first `lsb-release` on your distribution.')
exit()

for distribution in Distributions:
if re.fullmatch(distribution.value, lsbOutput):
self.distribution = distribution
break
if re.search('Microsoft',
check_output(['uname', '-r']).decode().rstrip()):
self.distribution = Distributions.WINDOWS

else:
self.distribution = Distributions.LINUX
for distribution in Distributions:
if re.fullmatch(distribution.value, lsbOutput):
self.distribution = distribution
break

else:
self.distribution = Distributions.LINUX

def append(self, key, value):
self.results.append('{0}{1}:{2} {3}'.format(
Expand Down

0 comments on commit d8bcf0d

Please sign in to comment.