#9 some changes

Open
MasayLighto wants to merge 1 commits from MasayLighto/master into alimiracle/master
6 changed files with 836 additions and 142 deletions
  1. 100 0
      cleaner.css
  2. 382 0
      cleaner.glade
  3. 3 4
      dbus.ucleaner
  4. 45 0
      messagebox.css
  5. 189 0
      messagebox.glade
  6. 117 138
      uruk-cleaner

+ 100 - 0
cleaner.css

@@ -0,0 +1,100 @@
+.bg-white
+{
+background-color: white;
+
+}
+.bg-transparent{
+
+    background-color: transparent;
+}
+
+.text-blue{
+    color: #78cdf6;
+}
+.bg-blue{
+    background-color: #78cdf6;
+}
+.bg-orange{
+    background-color: #f4ba8c;
+}
+.text-orange{
+    color: #f4ba8c;
+}
+.text-white{
+    color: white;
+}
+.no-border{
+    border: none;
+}
+.no-shadow{
+    box-shadow: none;
+}
+.rounded{
+    border-radius:10px ;
+}
+.full-rounded{
+    border-radius:100px;
+}
+.rounded-top{
+
+    border-top-left-radius:10px ;
+    border-top-right-radius:10px ;
+}
+.rounded-bottom{
+
+    border-bottom-left-radius:10px ;
+    border-bottom-right-radius:10px ;
+}
+.CheckBtn >check{
+    background-color: transparent;
+    border-radius: 100%;
+    padding: 6px;
+    border: 7px solid ;
+    
+    min-width: 1px;
+    min-height: 1px;
+}
+.CheckBtn :checked{
+    background-color: rgb(156, 205, 255);
+    border: 0px solid ;
+    padding: 13px;
+}
+.CheckBtn-Orange >check{
+    border-color: #f4ba8c;
+}
+.CheckBtn-Purple >check{
+    border-color: #eabaf0;
+}
+.CheckBtn-Pink >check{
+    border-color: #f18fa5;
+}
+.CheckBtn-Blue >check{
+    border-color: #75d0f1;
+}
+.CheckBtn-Green >check{
+    border-color: #9bffee;
+}
+
+
+.sm-font{
+    font-size: 8px;
+
+}
+
+.close{
+    background-color: #fe653b;
+    min-width: 1px;
+    min-height: 3px;
+
+}
+.minimize{
+    background-color: #88e1ff;
+    min-width: 1px;
+    min-height: 3px;
+
+}
+.maximize{
+    background-color: #eabaf0;
+    min-width: 1px;
+    min-height: 3px;
+}

+ 382 - 0
cleaner.glade

@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.2 -->
+<interface>
+  <requires lib="gtk+" version="3.24"/>
+  <!-- interface-css-provider-path cleaner.css -->
+  <object class="GtkWindow" id="TopWindow">
+    <property name="can_focus">False</property>
+    <child type="titlebar">
+      <object class="GtkBox" id="header">
+        <property name="height_request">20</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="valign">start</property>
+        <property name="vexpand">True</property>
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="valign">start</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <style>
+              <class name="bg-transparent"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">end</property>
+            <property name="valign">start</property>
+            <property name="margin_end">5</property>
+            <property name="margin_top">5</property>
+            <property name="vexpand">True</property>
+            <property name="spacing">1</property>
+            <property name="homogeneous">True</property>
+            <child>
+              <object class="GtkButton" id="minimizebtn">
+                <property name="width_request">16</property>
+                <property name="height_request">16</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="vexpand">True</property>
+                <property name="resize_mode">immediate</property>
+                <signal name="clicked" handler="minimize" swapped="no"/>
+                <style>
+                  <class name="no-shadow"/>
+                  <class name="no-border"/>
+                  <class name="full-rounded"/>
+                  <class name="close"/>
+                  <class name="minimize"/>
+                  <class name="sm-font"/>
+                </style>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="maximizebtn">
+                <property name="width_request">16</property>
+                <property name="height_request">16</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="resize_mode">immediate</property>
+                <signal name="clicked" handler="maximize" swapped="no"/>
+                <style>
+                  <class name="no-shadow"/>
+                  <class name="no-border"/>
+                  <class name="full-rounded"/>
+                  <class name="maximize"/>
+                  <class name="sm-font"/>
+                </style>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="closebtn">
+                <property name="width_request">16</property>
+                <property name="height_request">16</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="resize_mode">immediate</property>
+                <signal name="clicked" handler="close" swapped="no"/>
+                <style>
+                  <class name="no-shadow"/>
+                  <class name="no-border"/>
+                  <class name="full-rounded"/>
+                  <class name="close"/>
+                  <class name="sm-font"/>
+                </style>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <style>
+              <class name="bg-transparent"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <style>
+          <class name="bg-white"/>
+          <class name="no-border"/>
+          <class name="rounded-top"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <property name="width_request">500</property>
+        <property name="height_request">300</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="halign">center</property>
+        <property name="valign">center</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel">
+            <property name="height_request">60</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_top">15</property>
+            <property name="label" translatable="yes">Uruk Cleaner</property>
+            <property name="justify">center</property>
+            <attributes>
+              <attribute name="size" value="20000"/>
+            </attributes>
+            <style>
+              <class name="text-blue"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_top">30</property>
+            <property name="margin_bottom">30</property>
+            <property name="label" translatable="yes">Chose what to clean</property>
+            <attributes>
+              <attribute name="size" value="12000"/>
+            </attributes>
+            <style>
+              <class name="text-orange"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="Chechgrid">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">center</property>
+            <property name="margin_start">20</property>
+            <property name="margin_end">20</property>
+            <property name="margin_top">20</property>
+            <property name="margin_bottom">20</property>
+            <property name="hexpand">True</property>
+            <property name="row_spacing">20</property>
+            <property name="column_spacing">40</property>
+            <property name="row_homogeneous">True</property>
+            <property name="column_homogeneous">True</property>
+            <child>
+              <object class="GtkCheckButton" id="AptCacheChk">
+                <property name="label" translatable="yes">Apt Cache</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
+                <style>
+                  <class name="CheckBtn"/>
+                  <class name="CheckBtn-Blue"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="ThumbnailsChk">
+                <property name="label" translatable="yes">Thumbnails</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
+                <style>
+                  <class name="CheckBtn"/>
+                  <class name="CheckBtn-Pink"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="LogsChk">
+                <property name="label" translatable="yes">System Logs</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
+                <style>
+                  <class name="CheckBtn"/>
+                  <class name="CheckBtn-Orange"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="UnUsedPkgsChk">
+                <property name="label" translatable="yes">Unused Packages</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
+                <style>
+                  <class name="CheckBtn"/>
+                  <class name="CheckBtn-Purple"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="FireFoxChk">
+                <property name="label" translatable="yes">FireFox Cache</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
+                <style>
+                  <class name="CheckBtn"/>
+                  <class name="CheckBtn-Green"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparator">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="bg-transparent"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">center</property>
+            <property name="valign">end</property>
+            <property name="margin_top">40</property>
+            <property name="margin_bottom">20</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="spacing">17</property>
+            <property name="homogeneous">True</property>
+            <child>
+              <object class="GtkButton" id="AboutBtn">
+                <property name="label" translatable="yes">About</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <style>
+                  <class name="text-white"/>
+                  <class name="bg-orange"/>
+                  <class name="no-border"/>
+                  <class name="no-shadow"/>
+                  <class name="rounded"/>
+                </style>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="CleanBtn">
+                <property name="label" translatable="yes">Clean</property>
+                <property name="width_request">100</property>
+                <property name="height_request">40</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="Clean" swapped="no"/>
+                <style>
+                  <class name="text-white"/>
+                  <class name="bg-blue"/>
+                  <class name="no-border"/>
+                  <class name="no-shadow"/>
+                  <class name="rounded"/>
+                </style>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <style>
+          <class name="bg-transparent"/>
+        </style>
+      </object>
+    </child>
+    <style>
+      <class name="bg-white"/>
+      <class name="rounded-bottom"/>
+    </style>
+  </object>
+</interface>

+ 3 - 4
dbus.ucleaner

@@ -21,22 +21,21 @@ class Ucleaner(dbus.service.Object):
 
     @dbus.service.method(IFACE, out_signature='s')
 
-    def Clene_cach(self):
+    def clean_apt_cache(self):
         dir_name = "/var/cache/apt/archives"
         test_dir = os.listdir(dir_name)
 
         for item in test_dir:
-
             if item.endswith(".deb"):
                 os.remove(os.path.join(dir_name, item))
         return ""
     @dbus.service.method(IFACE, out_signature='s')
 
-    def Clene_logs(self):
+    def clean_logs(self):
         os.system("/usr/bin/log-c.sh")
         return ""
     @dbus.service.method(IFACE, out_signature='s')
-    def Autoremove_pkgs(self):
+    def auto_remove_pkgs(self):
         os.system("apt-get purge autoremove -y")
         return ""
 

+ 45 - 0
messagebox.css

@@ -0,0 +1,45 @@
+.bg-white
+{
+background-color: white;
+
+}
+.bg-transparent{
+
+    background-color: transparent;
+}
+.no-border{
+    border: none;
+}
+.no-shadow{
+    box-shadow: none;
+}
+.rounded{
+    border-radius:10px ;
+}
+
+.rounded-top{
+
+    border-top-left-radius:10px ;
+    border-top-right-radius:10px ;
+}
+.rounded-bottom{
+
+    border-bottom-left-radius:10px ;
+    border-bottom-right-radius:10px ;
+}
+.full-rounded{
+    border-radius: 100px;
+}
+.sm-font{
+    font-size: 8px;
+
+}
+
+.close{
+    background-color: #f34c4c;
+    min-width: 1px;
+    min-height: 3px;
+}
+.bg-blue{
+    background-color: #78cdf6;
+}

+ 189 - 0
messagebox.glade

@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.2 -->
+<interface>
+  <requires lib="gtk+" version="3.20"/>
+  <!-- interface-css-provider-path messagebox.css -->
+  <object class="GtkDialog" id="TopWindow">
+    <property name="width_request">400</property>
+    <property name="height_request">300</property>
+    <property name="can_focus">False</property>
+    <property name="type_hint">dialog</property>
+    <child type="titlebar">
+      <object class="GtkBox" id="header">
+        <property name="height_request">20</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="valign">start</property>
+        <property name="vexpand">True</property>
+        <child>
+          <object class="GtkLabel" id="TitleLabel">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="label" translatable="yes">label</property>
+            <property name="justify">center</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">end</property>
+            <property name="valign">start</property>
+            <property name="margin_right">5</property>
+            <property name="margin_end">5</property>
+            <property name="margin_top">5</property>
+            <property name="vexpand">True</property>
+            <property name="spacing">1</property>
+            <property name="homogeneous">True</property>
+            <child>
+              <object class="GtkButton" id="closebtn">
+                <property name="width_request">17</property>
+                <property name="height_request">17</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="resize_mode">immediate</property>
+                <property name="relief">none</property>
+                <style>
+                  <class name="no-shadow"/>
+                  <class name="no-border"/>
+                  <class name="full-rounded"/>
+                  <class name="close"/>
+                  <class name="sm-font"/>
+                </style>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <style>
+              <class name="bg-transparent"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <style>
+          <class name="bg-white"/>
+          <class name="no-border"/>
+          <class name="rounded-top"/>
+        </style>
+      </object>
+    </child>
+    <child internal-child="vbox">
+      <object class="GtkBox">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton">
+                <property name="label" translatable="yes">Ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="clicked" handler="ok_btn_click" swapped="no"/>
+                <style>
+                  <class name="bg-blue"/>
+                </style>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <child>
+              <object class="GtkLabel" id="MessageLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="label" translatable="yes">message content</property>
+                <property name="justify">center</property>
+                <property name="wrap">True</property>
+                <attributes>
+                  <attribute name="size" value="15000"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <style>
+              <class name="bg-transparent"/>
+              <class name="no-shadow"/>
+              <class name="no-border"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <style>
+      <class name="bg-white"/>
+      <class name="rounded-bottom"/>
+      <class name="no-border"/>
+    </style>
+  </object>
+</interface>

+ 117 - 138
uruk-cleaner

@@ -1,141 +1,120 @@
-#!/usr/bin/env python3
 
-# uruk cleaner 
-# to clean your system 
-
-#    Copyright (c) 2016, 2022 ali abdul ghani <blade.vp2020@gmail.com>
-#    This Program 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.
-#    This Program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from tkinter import *
-import tkinter as tk
-from tkinter import messagebox
-from tkinter import ttk
-import os
+import gi
+gi.require_version("Gtk", "3.0")
+from gi.repository import Gtk
+gi.require_version('Gdk', '3.0')
+from gi.repository import Gdk
 import dbus
 from _dbus_bindings import BUS_DAEMON_IFACE, BUS_DAEMON_NAME, BUS_DAEMON_PATH
-# dbus vars
-
-timeout = 60
-flags = 0
-bus_name = "org.dbus.ucleaner"
-opath = "/org/ucleaner"
-#get the system bus
-bus = dbus.SystemBus()
-bus.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH, BUS_DAEMON_IFACE,                      'StartServiceByName', 'su', (bus_name, flags), timeout=timeout)
-#get the object
-the_object = bus.get_object(bus_name, opath)
-#get the interface
-the_interface = dbus.Interface(the_object, "org.ucleaner")
-
-gui=tk.Tk()
-gui.configure(background='#ffffff')
-gui.title("Uruk System Cleaner")
-gui.iconphoto(False, tk.PhotoImage(file='ucleaner.png'))
-gui.tk.call('wm', 'iconphoto', gui._w, tk.PhotoImage(file='ucleaner.png'))
-style = ttk.Style(gui)
-style.theme_use('clam') 
-var1 = IntVar()
-var2 = IntVar()
-var3 = IntVar()
-var4 = IntVar()
-var5 = IntVar()
-gui.geometry("830x650")
-gui.resizable(False,False)
-
-def apply_conf():
-	values = int(var1.get()) + int(var2.get()) + int(var3.get()) + int(var4.get()) + int(var5.get())
-	if (values == 0):
-		messageBox("error")
-	else:
-		if int(var1.get()) == 1:
-			the_interface.Clene_logs()
-
-			messageBox("done")
-		if int(var2.get()) == 1:
-			the_interface.Clene_cach()
-
-			messageBox("done")     
-		if int(var3.get()) == 1:
-			the_interface.Autoremove_pkgs()
-			messageBox("done")
-		if int(var4.get()) == 1:
-			os.system("rm -rf ~/.cache/thumbnails/*")
-			messageBox("done") 
-		if int(var5.get()) == 1:
-			os.system("rm ~/.mozilla/firefox/*.default*/*.sqlite ~/.mozilla/firefox/*default*/sessionstore.js")
-			os.system("rm -r ~/.cache/mozilla/firefox/*.default*/*")
-			messageBox("done")
-def messageBox(text):
-	msgs = Toplevel(gui)
-	msgs.title("Uruk System Cleaner")
-	msgs.configure(bg='#ffffff')
-	frame = Frame(msgs,bg='#ffffff')
-	frame.grid()
-	msgbody1 = Label(frame, text="Uruk System Cleaner \n", fg = "#006680", bg='#ffffff',font=("noto", 11, "bold"))
-	msgbody1.grid(row=1, column=1,padx=10, pady=10, sticky=N)
-	if text=="error":
-		msgbody2 = Label(frame, text="You most choose one option at less", fg = "#006680", bg='#ffffff',font=("noto", 11, "bold"))
-		msgbody2.grid(row=2, column=1,padx=10, pady=10, sticky=N)
-	elif text == "about":
-		msgbody2 = Label(frame, text="Free and Open Source System Cleaner \nto clean and remove unnecessary files on\n your system \n \nby ali miracle <alimiracle@riseup.net>\n 2022", fg = "#006680", bg='#ffffff',font=("noto", 11, "bold"))
-		msgbody2.grid(row=2, column=1,padx=10, pady=10, sticky=N)
-	# elif text == "complete1":
-		# msgbody2 = Label(frame, text="All cash files was cleaning.", fg = "#006680", bg='#ffffff',font=("noto", 11, "bold"))
-		# msgbody2.grid(row=2, column=1,padx=10, pady=10, sticky=N)
-	# elif text == "complete2":
-		# msgbody2 = Label(frame, text="All unused packages was removed.", fg = "#006680", bg='#ffffff',font=("noto", 11, "bold"))
-		# msgbody2.grid(row=2, column=1,padx=10, pady=10, sticky=N)
-	# elif text == "complete3":
-		# msgbody2 = Label(frame, text="All unused packages was removed.", fg = "#006680", bg='#ffffff',font=("noto", 11, "bold"))
-		# msgbody2.grid(row=2, column=1,padx=10, pady=10, sticky=N)
-	elif text == "done":
-		msgbody2 = Label(frame, text="Cleaning Complete!", fg = "#006680", bg='#ffffff',font=("noto", 11, "bold"))
-		msgbody2.grid(row=2, column=1,padx=10, pady=10, sticky=N)  
-	okbttn = Button(frame, text="OK",height=0, width=5, fg='white', bg='#ff7675', font=('noto', 12, "bold"), borderwidth=0,  command=msgs.destroy)
-	okbttn.grid(row=4, column=1,pady=10)
-
-lableapp = Label(gui, text="Uruk System Cleaner",  fg = "#70D2F9", bg='#ffffff',font=("noto", 26, "bold")).pack(pady=60, padx=10)
-
-frame = LabelFrame(gui, text="Choose what to clean:",borderwidth=0,font=('noto', 15, "bold"), fg = "#FFB27A", bg='#ffffff', padx=20, pady=20)
-frame.pack(pady=10, padx=10)
-
-B1 = Checkbutton(frame, text="Cleanning Logss",variable = var1, onvalue=1, offvalue=0, borderwidth=0,font=('noto', 12, "bold"), fg = "#6FD3F7", bg='#ffffff', width=25,height=2, anchor="w",highlightthickness=0,bd=0).grid(row=1, column=0, padx=10, pady=15)
-
-B2 = Checkbutton(frame, text = "Cleanning apt Cash", variable = var2, onvalue=1, offvalue=0,font=('noto', 12, "bold"), fg = "#6FD3F7", bg='#ffffff', width=25,height=2, anchor="w",highlightthickness=0,bd=0).grid(row=1, column=1, padx=10, pady=15)
-
-B3 = Checkbutton(frame, text = "Remove unused packages",variable = var3, onvalue=1, offvalue=0, borderwidth=0,font=('noto', 12, "bold"), fg = "#6FD3F7", bg='#ffffff', width=25,height=2, anchor="w",highlightthickness=0,bd=0).grid(row=2, column=0, padx=10, pady=15)
-
-B4 = Checkbutton(frame, text = "Remove thumbinals",variable = var4, onvalue=1, offvalue=0, borderwidth=0,font=('noto', 12, "bold"), fg = "#6FD3F7", bg='#ffffff', width=25,height=2, anchor="w",highlightthickness=0,bd=0).grid(row=2, column=1, padx=10, pady=15)
-
-B5 = Checkbutton(frame, text = "Remove firefox cash",variable = var5, onvalue=1, offvalue=0, borderwidth=0,font=('noto', 12, "bold"), fg = "#6FD3F7", bg='#ffffff', width=25,height=2, anchor="w",highlightthickness=0,bd=0).grid(row=3, column=0, padx=10, pady=15)
-
-
-buttonDll=Button(gui, height=2, width=16, text="Clean", fg='white', bg='#5599ff', font=('noto', 13, "bold"), borderwidth=0, command=lambda: apply_conf())
-buttonDll.pack(pady=3, padx=10)
-
-buttonEx=Button(gui, height=2, width=8, text="Exit", fg='white', bg='#F1BB8F', font=('noto', 13, "bold"),  borderwidth=0,  command=gui.destroy) 
-buttonEx.pack(pady=13, padx=80, side=tk.LEFT)
-
-buttonEx=Button(gui, height=2, width=8, text="About", fg='white', bg='#ff7675', font=('noto', 12, "bold"),  borderwidth=0,  command=lambda: messageBox("about")) 
-buttonEx.pack(pady=10, padx=10, side=tk.RIGHT)
-
-# menubar = Menu(gui)
-# filemenu = Menu(menubar, tearoff=0)
-# filemenu.add_command(label="Exit", command=gui.destroy)
-# menubar.add_cascade(label="File", menu=filemenu)
-
-# helpmenu = Menu(menubar, tearoff=0)
-# helpmenu.add_command(label="About", command=lambda: messageBox("about"))
-# menubar.add_cascade(label="Help", menu=helpmenu)
-# gui.config(menu=menubar)
-
-gui.mainloop()
+import os
+class MessageBox:
+  def __init__(self,message_title,message_content):
+    self.__load_css()
+    self.__load_glade("messagebox.glade")
+    self.__extract_widget() 
+    self.set_content(message_content)
+    self.set_title(message_title)
+  def set_title(self,title):
+    self.title_label.set_text(title)
+  def set_content(self,content):
+    self.content_label.set_text(content)
+    pass
+  def __load_glade(self,glade_file):  
+    self.builder = Gtk.Builder()
+    self.builder.add_from_file(glade_file)
+    self.builder.connect_signals(self)    
+  def __extract_widget(self):
+    self.window = self.builder.get_object("TopWindow")
+    self.title_label = self.builder.get_object("TitleLabel")
+    self.content_label = self.builder.get_object("MessageLabel")
+  def show(self):
+    self.window.show()
+  def __load_css(self):
+    screen = Gdk.Screen.get_default()
+    provider = Gtk.CssProvider()
+    provider.load_from_path("messagebox.css")
+    Gtk.StyleContext.add_provider_for_screen(screen, provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
+  def ok_btn_click(self, *args):
+     self.window.close()
+class Cleaner:
+  def __init__(self):
+    timeout = 60
+    flags = 0
+    bus_name = "org.dbus.ucleaner"
+    opath = "/org/ucleaner"
+    #get the system bus
+    bus = dbus.SystemBus()
+    bus.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH, BUS_DAEMON_IFACE,'StartServiceByName', 'su', (bus_name, flags), timeout=timeout)
+    #get the object
+    dbus_object = bus.get_object(bus_name, opath)
+    #get the interface
+    self.dbus_interface = dbus.Interface(dbus_object, "org.ucleaner")
+
+  def clean_apt_cache(self):
+    self.dbus_interface.clean_apt_cache()           
+  def clean_logs(self):
+    self.dbus_interface.clean_logs()            
+  def remove_unused_pkgs(self):
+    self.dbus_interface.auto_remove_pkgs()
+  def remove_thumbnails(self):
+    os.system("rm -rf ~/.cache/thumbnails/*")             
+  def clean_firefox_cache(self):
+    os.system("rm ~/.mozilla/firefox/*.default*/*.sqlite ~/.mozilla/firefox/*default*/sessionstore.js")
+    os.system("rm -r ~/.cache/mozilla/firefox/*.default*/*")
+
+class GUI:
+  IsWindowMaximized=False
+  def __init__(self):
+    self.cleaner=Cleaner()
+    self.__load_glade("cleaner.glade")
+    self.__load_css()    
+    self.__extract_widget()
+  def __load_glade(self,glade_file):
+    self.builder = Gtk.Builder()
+    self.builder.add_from_file(glade_file)
+    self.builder.connect_signals(self)
+  def __extract_widget(self):
+    self.window = self.builder.get_object("TopWindow")
+  def show(self):
+    self.window.show()
+  def __load_css(self):
+    screen = Gdk.Screen.get_default()
+    provider = Gtk.CssProvider()
+    provider.load_from_path("cleaner.css")
+    Gtk.StyleContext.add_provider_for_screen(screen, provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
+  def maximize(self, button):
+    if IsWindowMaximized:
+        Gtk.Window.normlize(self.window)
+        IsWindowMaximized=False
+        return
+    Gtk.Window.maximize(self.window)
+  def minimize(self, button):
+    Gtk.Window.minimize(self.window)
+  def close(self, *args):
+    Gtk.main_quit()
+    exit(0)
+  def Clean(self, button):
+    status=False
+    if self.builder.get_object("AptCacheChk").get_active():
+        status=True
+        self.cleaner.clean_apt_cache()
+    if self.builder.get_object("LogsChk").get_active():
+        status=True
+        self.cleaner.clean_logs()
+    if self.builder.get_object("UnUsedPkgsChk").get_active():
+        status=True
+        self.cleaner.remove_unused_pkgs()
+    if self.builder.get_object("ThumbnailsChk").get_active():
+        status=True
+        self.cleaner.remove_thumbnails()
+    if self.builder.get_object("FireFoxChk").get_active():
+        status=True
+        self.cleaner.clean_firefox_cache()
+    if status:
+        MessageBox("Result","Cleaning Completed").show()
+        return
+    MessageBox("Error","Select At Least one Task").show()
+if __name__ == "__main__":
+  main = GUI()
+  main.show()
+  Gtk.main()