mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-05 18:38:26 +02:00
- Added stop to gui & sys tray
This commit is contained in:
@@ -164,6 +164,9 @@ class MyWindow(Gtk.Window):
|
|||||||
menuitem_restart = Gtk.MenuItem(label="Restart")
|
menuitem_restart = Gtk.MenuItem(label="Restart")
|
||||||
menuitem_restart.connect('activate',self.runRestart)
|
menuitem_restart.connect('activate',self.runRestart)
|
||||||
submenu_file.append(menuitem_restart)
|
submenu_file.append(menuitem_restart)
|
||||||
|
menuitem_stop = Gtk.MenuItem(label="Stop")
|
||||||
|
menuitem_stop.connect('activate',self.runStop)
|
||||||
|
submenu_file.append(menuitem_stop)
|
||||||
|
|
||||||
menuitem_quit = Gtk.MenuItem(label="Quit")
|
menuitem_quit = Gtk.MenuItem(label="Quit")
|
||||||
submenu_file.append(menuitem_quit)
|
submenu_file.append(menuitem_quit)
|
||||||
@@ -877,6 +880,21 @@ class MyWindow(Gtk.Window):
|
|||||||
except:
|
except:
|
||||||
Popen(['notify-send','Kinto: Errror restarting Kinto!','-i','budgie-desktop-symbolic'])
|
Popen(['notify-send','Kinto: Errror restarting Kinto!','-i','budgie-desktop-symbolic'])
|
||||||
|
|
||||||
|
def runStop(self,button):
|
||||||
|
try:
|
||||||
|
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
|
||||||
|
stop.wait()
|
||||||
|
time.sleep(1)
|
||||||
|
res = Popen(['pgrep','xkeysnail'])
|
||||||
|
res.wait()
|
||||||
|
|
||||||
|
if res.returncode == 0:
|
||||||
|
# Popen(['notify-send','Kinto: Ending Debug','-i','budgie-desktop-symbolic'])
|
||||||
|
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
|
||||||
|
pkillxkey.wait()
|
||||||
|
except:
|
||||||
|
Popen(['notify-send','Kinto: Error stopping Kinto!','-i','budgie-desktop-symbolic'])
|
||||||
|
|
||||||
def setEnable(self,button,enableKinto):
|
def setEnable(self,button,enableKinto):
|
||||||
try:
|
try:
|
||||||
if enableKinto:
|
if enableKinto:
|
||||||
|
@@ -45,6 +45,7 @@ class Indicator():
|
|||||||
checkbox_autostart = Gtk.CheckMenuItem('Autostart')
|
checkbox_autostart = Gtk.CheckMenuItem('Autostart')
|
||||||
checkbox_enable = Gtk.CheckMenuItem('Kinto Enabled')
|
checkbox_enable = Gtk.CheckMenuItem('Kinto Enabled')
|
||||||
restart = Gtk.MenuItem('Restart')
|
restart = Gtk.MenuItem('Restart')
|
||||||
|
stop = Gtk.MenuItem('Stop')
|
||||||
keyboards = Gtk.MenuItem('Keyboard Types')
|
keyboards = Gtk.MenuItem('Keyboard Types')
|
||||||
keyboards.set_submenu(menukb)
|
keyboards.set_submenu(menukb)
|
||||||
winkb = Gtk.RadioMenuItem(label='Windows')
|
winkb = Gtk.RadioMenuItem(label='Windows')
|
||||||
@@ -134,6 +135,8 @@ class Indicator():
|
|||||||
|
|
||||||
self.restart.connect('activate',self.runRestart)
|
self.restart.connect('activate',self.runRestart)
|
||||||
self.menu.append(self.restart)
|
self.menu.append(self.restart)
|
||||||
|
self.stop.connect('activate',self.runStop)
|
||||||
|
self.menu.append(self.stop)
|
||||||
|
|
||||||
self.refreshKB()
|
self.refreshKB()
|
||||||
|
|
||||||
@@ -600,10 +603,21 @@ class Indicator():
|
|||||||
Popen(['sudo', 'systemctl','start','xkeysnail'])
|
Popen(['sudo', 'systemctl','start','xkeysnail'])
|
||||||
except:
|
except:
|
||||||
Popen(['notify-send','Kinto: Error restarting Kinto!','-i','budgie-desktop-symbolic'])
|
Popen(['notify-send','Kinto: Error restarting Kinto!','-i','budgie-desktop-symbolic'])
|
||||||
# self.checkbox_enable.set_active(False)
|
|
||||||
# self.checkbox_enable.disconnect(self.enable_id)
|
def runStop(self,button):
|
||||||
# self.enable_id = self.checkbox_enable.connect('activate',self.setEnable,True)
|
try:
|
||||||
# self.indicator.set_icon(os.environ['HOME']+'/.config/kinto/kinto-color.svg')
|
stop = Popen(['sudo', 'systemctl','stop','xkeysnail'])
|
||||||
|
stop.wait()
|
||||||
|
time.sleep(1)
|
||||||
|
res = Popen(['pgrep','xkeysnail'])
|
||||||
|
res.wait()
|
||||||
|
|
||||||
|
if res.returncode == 0:
|
||||||
|
# Popen(['notify-send','Kinto: Ending Debug','-i','budgie-desktop-symbolic'])
|
||||||
|
pkillxkey = Popen(['sudo', 'pkill','-f','bin/xkeysnail'])
|
||||||
|
pkillxkey.wait()
|
||||||
|
except:
|
||||||
|
Popen(['notify-send','Kinto: Error stopping Kinto!','-i','budgie-desktop-symbolic'])
|
||||||
|
|
||||||
def runDebug(self,button,opendebug):
|
def runDebug(self,button,opendebug):
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user