Skip to content
Snippets Groups Projects

Playground

Merged Vitor Lopes requested to merge (removed):playground into master
@@ -19,6 +19,8 @@ import os
from gi.repository.GdkPixbuf import Pixbuf
import platform
class MyWindow(Gtk.Window):
def __init__(self):
@@ -82,12 +84,11 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel1 = Gtk.Label("Installed")
# this is a better way of doing it, not tested
process = subprocess.Popen("pacman -Q chromium | awk '{print $1}'", stdout=subprocess.PIPE, stderr=None, shell=True)
output = process.communicate()
if "error was not found" not in output:
self.chromebox.pack_end(self.installedlabel1, False, False, 0)
self.chromebox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.chromebox.pack_end(self.chromebutton, False, False, 0)
@@ -110,10 +111,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel2 = Gtk.Label("Installed")
firefox = os.popen("pacman -Q firefox | awk '{print $1}'").read()
if firefox == 'firefox\n':
self.firebox.pack_end(self.installedlabel2, False, False, 0)
self.firebox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.firebox.pack_end(self.firebutton, False, False, 0)
@@ -135,10 +135,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel3 = Gtk.Label("Installed")
midori = os.popen("pacman -Q midori | awk '{print $1}'").read()
if midori == 'midori\n':
self.midoribox.pack_end(self.installedlabel3, False, False, 0)
self.midoribox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.midoribox.pack_end(self.midoributton, False, False, 0)
@@ -160,10 +159,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel4 = Gtk.Label("Installed")
falkon = os.popen("pacman -Q falkon | awk '{print $1}'").read()
if falkon == 'falkon\n':
self.falkbox.pack_end(self.installedlabel4, False, False, 0)
self.falkbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.falkbox.pack_end(self.falkbutton, False, False, 0)
@@ -185,10 +183,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel5 = Gtk.Label("Installed")
netsurf = os.popen("pacman -Q netsurf | awk '{print $1}'").read()
if netsurf == 'netsurf\n':
self.netbox.pack_end(self.installedlabel5, False, False, 0)
self.netbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.netbox.pack_end(self.netbutton, False, False, 0)
@@ -210,10 +207,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel6 = Gtk.Label("Installed")
filezilla = os.popen("pacman -Q filezilla | awk '{print $1}'").read()
if filezilla == 'filezilla\n':
self.filbox.pack_end(self.installedlabel6, False, False, 0)
self.filbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.filbox.pack_end(self.filbutton, False, False, 0)
@@ -235,10 +231,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel7 = Gtk.Label("Installed")
opera = os.popen("pacman -Q opera | awk '{print $1}'").read()
if opera == 'opera\n':
self.opebox.pack_end(self.installedlabel7, False, False, 0)
self.opebox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.opebox.pack_end(self.opebutton, False, False, 0)
@@ -260,10 +255,10 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel8 = Gtk.Label("Installed")
geary = os.popen("pacman -Q geary | awk '{print $1}'").read()
if geary == 'geary\n':
self.geabox.pack_end(self.installedlabel8, False, False, 0)
geary = subprocess.Popen("pacman -Q geary | awk '{print $1}'", stdout=subprocess.PIPE, stderr=None, shell=True)
geary_output = geary.communicate()
if "error was not found" not in geary_output:
self.geabox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.geabox.pack_end(self.geabutton, False, False, 0)
@@ -285,10 +280,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel9 = Gtk.Label("Installed")
evolution = os.popen("pacman -Q evolution | awk '{print $1}'").read()
if evolution == 'evolution\n':
self.evobox.pack_end(self.installedlabel9, False, False, 0)
self.evobox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.evobox.pack_end(self.evobutton, False, False, 0)
@@ -310,10 +304,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel10 = Gtk.Label("Installed")
thunderbird = os.popen("pacman -Q thunderbird | awk '{print $1}'").read()
if thunderbird == 'thunderbird\n':
self.thubox.pack_end(self.installedlabel10, False, False, 0)
self.thubox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.thubox.pack_end(self.thubutton, False, False, 0)
@@ -335,10 +328,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel11 = Gtk.Label("Installed")
transmission = os.popen("pacman -Q transmission-gtk | awk '{print $1}'").read()
if transmission == 'transmission-gtk\n':
self.trabox.pack_end(self.installedlabel11, False, False, 0)
self.trabox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.trabox.pack_end(self.trabutton, False, False, 0)
@@ -360,10 +352,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabe12 = Gtk.Label("Installed")
qbittorrent = os.popen("pacman -Q qbittorrent | awk '{print $1}'").read()
if qbittorrent == 'qbittorrent\n':
self.qbibox.pack_end(self.installedlabe12, False, False, 0)
self.qbibox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.qbibox.pack_end(self.qbibutton, False, False, 0)
@@ -385,10 +376,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel13 = Gtk.Label("Installed")
hexchat = os.popen("pacman -Q hexchat | awk '{print $1}'").read()
if hexchat == 'hexchat\n':
self.hexbox.pack_end(self.installedlabel13, False, False, 0)
self.hexbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.hexbox.pack_end(self.hexbutton, False, False, 0)
@@ -417,10 +407,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel14 = Gtk.Label("Installed")
gimp = os.popen("pacman -Q gimp | awk '{print $1}'").read()
if gimp == 'gimp\n':
self.gimpbox.pack_end(self.installedlabel14, False, False, 0)
self.gimpbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.gimpbox.pack_end(self.gimpbutton, False, False, 0)
@@ -442,10 +431,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel15 = Gtk.Label("Installed")
vlc = os.popen("pacman -Q vlc | awk '{print $1}'").read()
if vlc == 'vlc\n':
self.vlcbox.pack_end(self.installedlabel15, False, False, 0)
self.vlcbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.vlcbox.pack_end(self.vlcbutton, False, False, 0)
@@ -467,10 +455,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel16 = Gtk.Label("Installed")
totem = os.popen("pacman -Q totem | awk '{print $1}'").read()
if totem == 'totem\n':
self.totembox.pack_end(self.installedlabel16, False, False, 0)
self.totembox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.totembox.pack_end(self.totembutton, False, False, 0)
@@ -492,10 +479,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel17 = Gtk.Label("Installed")
parole = os.popen("pacman -Q parole | awk '{print $1}'").read()
if parole == 'parole\n':
self.parbox.pack_end(self.installedlabel17, False, False, 0)
self.parbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.parbox.pack_end(self.parbutton, False, False, 0)
@@ -516,10 +502,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel19 = Gtk.Label("Installed")
audacious = os.popen("pacman -Q audacious | awk '{print $1}'").read()
if audacious == 'audacious\n':
self.audbox.pack_end(self.installedlabel19, False, False, 0)
self.audbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.audbox.pack_end(self.audbutton, False, False, 0)
@@ -541,10 +526,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel20 = Gtk.Label("Installed")
clementine = os.popen("pacman -Q clementine | awk '{print $1}'").read()
if clementine == 'clementine\n':
self.clebox.pack_end(self.installedlabel20, False, False, 0)
self.clebox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.clebox.pack_end(self.clebutton, False, False, 0)
@@ -566,10 +550,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel21 = Gtk.Label("Installed")
gthumb = os.popen("pacman -Q gthumb | awk '{print $1}'").read()
if gthumb == 'gthumb\n':
self.gthbox.pack_end(self.installedlabel21, False, False, 0)
self.gthbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.gthbox.pack_end(self.gthbutton, False, False, 0)
@@ -591,10 +574,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel22 = Gtk.Label("Installed")
shotwell = os.popen("pacman -Q shotwell | awk '{print $1}'").read()
if shotwell == 'shotwell\n':
self.shobox.pack_end(self.installedlabel22, False, False, 0)
self.shobox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.shobox.pack_end(self.shobutton, False, False, 0)
@@ -616,10 +598,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel23 = Gtk.Label("Installed")
ristretto = os.popen("pacman -Q ristretto | awk '{print $1}'").read()
if ristretto == 'ristretto\n':
self.risbox.pack_end(self.installedlabel23, False, False, 0)
self.risbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.risbox.pack_end(self.risbutton, False, False, 0)
@@ -641,10 +622,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel24 = Gtk.Label("Installed")
gpicview = os.popen("pacman -Q gpicview | awk '{print $1}'").read()
if gpicview == 'gpicview\n':
self.gpibox.pack_end(self.installedlabel24, False, False, 0)
self.gpibox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.gpibox.pack_end(self.gpibutton, False, False, 0)
@@ -666,10 +646,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel25 = Gtk.Label("Installed")
audicity = os.popen("pacman -Q audacity | awk '{print $1}'").read()
if audicity == 'audacity\n':
self.adybox.pack_end(self.installedlabel25, False, False, 0)
self.adybox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.adybox.pack_end(self.adybutton, False, False, 0)
@@ -691,10 +670,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel26 = Gtk.Label("Installed")
ssr = os.popen("pacman -Q simplescreenrecorder | awk '{print $1}'").read()
if ssr == 'simplescreenrecorder\n':
self.ssrbox.pack_end(self.installedlabel26, False, False, 0)
self.ssrbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.ssrbox.pack_end(self.ssrbutton, False, False, 0)
@@ -716,10 +694,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel27 = Gtk.Label("Installed")
kdenlive = os.popen("pacman -Q kdenlive | awk '{print $1}'").read()
if kdenlive == 'kdenlive\n':
self.kdebox.pack_end(self.installedlabel27, False, False, 0)
self.kdebox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.kdebox.pack_end(self.kdebutton, False, False, 0)
@@ -741,10 +718,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel28 = Gtk.Label("Installed")
obs = os.popen("pacman -Q obs-studio | awk '{print $1}'").read()
if obs == 'obs-studio\n':
self.obsbox.pack_end(self.installedlabel28, False, False, 0)
self.obsbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.obsbox.pack_end(self.obsbutton, False, False, 0)
@@ -764,10 +740,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel40 = Gtk.Label("Installed")
kodi = os.popen("pacman -Q kodi | awk '{print $1}'").read()
if kodi == 'kodi\n':
self.kodbox.pack_end(self.installedlabel40, False, False, 0)
self.kodbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.kodbox.pack_end(self.kodbutton, False, False, 0)
@@ -796,10 +771,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel29 = Gtk.Label("Installed")
libre = os.popen("pacman -Q libreoffice-fresh | awk '{print $1}'").read()
if libre == 'libreoffice-fresh\n':
self.libpbox.pack_end(self.installedlabel29, False, False, 0)
self.libpbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.libpbox.pack_end(self.libpbutton, False, False, 0)
@@ -820,10 +794,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel29 = Gtk.Label("Installed")
libsre = os.popen("pacman -Q libreoffice-still | awk '{print $1}'").read()
if libsre == 'libreoffice-still\n':
self.libspbox.pack_end(self.installedlabel29, False, False, 0)
self.libspbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.libspbox.pack_end(self.libspbutton, False, False, 0)
@@ -845,10 +818,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel30 = Gtk.Label("Installed")
calligra = os.popen("pacman -Q calligra | awk '{print $1}'").read()
if calligra == 'calligra\n':
self.calbox.pack_end(self.installedlabel30, False, False, 0)
self.calbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.calbox.pack_end(self.calbutton, False, False, 0)
@@ -870,10 +842,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel31 = Gtk.Label("Installed")
abiword = os.popen("pacman -Q abiword | awk '{print $1}'").read()
if abiword == 'abiword\n':
self.abibox.pack_end(self.installedlabel31, False, False, 0)
self.abibox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.abibox.pack_end(self.abibutton, False, False, 0)
@@ -896,10 +867,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel32 = Gtk.Label("Installed")
gnumeric = os.popen("pacman -Q gnumeric | awk '{print $1}'").read()
if gnumeric == 'gnumeric\n':
self.gnubox.pack_end(self.installedlabel32, False, False, 0)
self.gnubox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.gnubox.pack_end(self.gnubutton, False, False, 0)
@@ -921,10 +891,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel33 = Gtk.Label("Installed")
pdfmod = os.popen("pacman -Q pdfmod | awk '{print $1}'").read()
if pdfmod == 'pdfmod\n':
self.pdfbox.pack_end(self.installedlabel33, False, False, 0)
self.pdfbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.pdfbox.pack_end(self.pdfbutton, False, False, 0)
@@ -946,10 +915,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel34 = Gtk.Label("Installed")
evince = os.popen("pacman -Q evince | awk '{print $1}'").read()
if evince == 'evince\n':
self.evibox.pack_end(self.installedlabel34, False, False, 0)
self.evibox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.evibox.pack_end(self.evibutton, False, False, 0)
@@ -971,10 +939,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel35 = Gtk.Label("Installed")
calibre = os.popen("pacman -Q calibre | awk '{print $1}'").read()
if calibre == 'calibre\n':
self.calbox.pack_end(self.installedlabel35, False, False, 0)
self.calbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.calbox.pack_end(self.calbutton, False, False, 0)
@@ -996,10 +963,9 @@ class MyWindow(Gtk.Window):
# Checking to see if the package is already installed
# and packing the appropriate button/label
self.installedlabel36 = Gtk.Label("Installed")
fbreader = os.popen("pacman -Q fbreader | awk '{print $1}'").read()
if fbreader == 'fbreader\n':
self.fbrbox.pack_end(self.installedlabel36, False, False, 0)
self.fbrbox.pack_end(Gtk.Label("Installed"), False, False, 0)
else:
self.fbrbox.pack_end(self.fbrbutton, False, False, 0)
Loading