forked from antoniovazquezblanco/ArchSetup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Software Window (untested) see antoniovazquezblanco#13
I added a window, definition files for various categories which can easily be installed right now there are just 2 very basic categories, more to come... also I need to test... Signed-off-by: Marius Messerschmidt <[email protected]>
- Loading branch information
Showing
8 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of ArchSetup. | ||
# | ||
# ArchSetup is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ArchSetup is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with ArchSetup. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from SetupTools.Software import Software | ||
from Interface.Windows.SetupWindow import SetupWindow | ||
from Interface.Widgets.SpacerWidget import SpacerWidget | ||
from Interface.Widgets.TextWidget import TextWidget | ||
from Interface.Widgets.ScrollWidget import ScrollWidget | ||
from Interface.Widgets.CheckWidget import CheckWidget | ||
|
||
import gettext | ||
|
||
class SoftwareWindow(SetupWindow): | ||
def __init__(self, callback, setupconfig): | ||
super().__init__() | ||
self.callback = callback | ||
|
||
# Init Translation | ||
trans = gettext.translation("archsetup", "locale", fallback=True) | ||
trans.install() | ||
|
||
self.setupconfig = setupconfig | ||
self.addwidget(TextWidget(1, 1, _('Please choose some additional software:'), 40)) | ||
software = Software() | ||
items = software.listPackages() | ||
self.addwidget(ScrollWidget(3, 1, 40, 20, CheckWidget(0, 0, 40, items, self.event), self.event)) | ||
self.addwidget(SpacerWidget(23, 1, 1)) | ||
self.setnextcallback(self.callback, 'next') | ||
self.setprevcallback(callback, 'prev') | ||
|
||
def event(self, event, opt=''): | ||
if event == 'refresh': | ||
self.refresh() | ||
elif event == 'selection': | ||
self.setupconfig.setsoftware(opt) | ||
else: | ||
super().event(event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of ArchSetup. | ||
# | ||
# ArchSetup is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ArchSetup is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with ArchSetup. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from glob import glob | ||
import subprocess | ||
|
||
class Software: | ||
def __init__(self): | ||
pass | ||
|
||
def listPackages(self): | ||
return glob("software/*") | ||
|
||
def installPackages(self, pkglist): | ||
for pkg in pkglist: | ||
with open(pkg) as f: | ||
applications = " ".join(f.readlines()).replace('\n', '') | ||
p = subprocess.Popen(["arch-chroot", "/mnt", "pacman", "--noconfirm", "-S"] + applications.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
for line in p.stdout: | ||
yield line.decode("utf-8") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
xorg-server | ||
xorg-xinit | ||
xorg-utils | ||
xorg-server-utils | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
libreoffice-fresh | ||
evolution | ||
chromium |