From 34019d115d6c3592cb657d200d55fb435534b208 Mon Sep 17 00:00:00 2001 From: natemaia Date: Fri, 22 Dec 2017 14:00:35 -0800 Subject: [PATCH] Change menu and rc to use rofi for logout --- home/.config/openbox/menu.xml | 2 +- home/.config/openbox/rc.xml | 4 ++-- home/bin/config_ui | 36 +++++++++++++++++++---------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/home/.config/openbox/menu.xml b/home/.config/openbox/menu.xml index af40fbbb..6921c8ae 100644 --- a/home/.config/openbox/menu.xml +++ b/home/.config/openbox/menu.xml @@ -198,7 +198,7 @@ - oblogout + rofi-logout diff --git a/home/.config/openbox/rc.xml b/home/.config/openbox/rc.xml index 6f477081..0e76e143 100644 --- a/home/.config/openbox/rc.xml +++ b/home/.config/openbox/rc.xml @@ -372,12 +372,12 @@ - oblogout + rofi-logout - oblogout + rofi-logout diff --git a/home/bin/config_ui b/home/bin/config_ui index a403578d..e9beb4aa 100755 --- a/home/bin/config_ui +++ b/home/bin/config_ui @@ -23,6 +23,8 @@ class Selection(Gtk.EventBox): self.background = background self.selected_colour = selected + if not working: + name = 'x ' + name text = Gtk.Label(name) hbox = Gtk.HBox() hbox.set_size_request(0, 30) @@ -43,36 +45,38 @@ class Selection(Gtk.EventBox): hbox.pack_end(colour_widgets, False, True, 20) self.hbox = hbox - #self.connect('enter-notify-event', self.selected) - #self.connect('leave-notify-event', self.unselected) + self.connect('enter-notify-event', self.selected) + self.connect('leave-notify-event', self.unselected) self.connect('button-press-event', self.clicked) self.add(self.hbox) - def clicked(self, button): + def clicked(self, widget, button): _, index = button.get_button() if index == 1: - subprocess.run([PATH, 'load', self.name]) + proc = subprocess.run([PATH, 'load', self.name]) Gtk.main_quit() return None - #def selected(self, *args): - # return None + def selected(self, *args): + # self.hbox.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(*self.selected)) + return None - #def unselected(self, *args): - # return None + def unselected(self, *args): + # self.hbox.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(*self.selected)) + return None def load_configs(): broken = subprocess.check_output([PATH, 'check', GROUP]) broken = broken.decode('utf-8').split('\n') - path = '{}/.gorice/output.yaml'.format(os.environ['HOME']) + output = [] + path = '{}/.gorice/output.yaml'.format(os.environ['HOME']) with open(path, 'r') as f: data = yaml.load(f.read()) names = sorted(data['configs']) - for config in names: info = data['configs'][config] config, ext = os.path.splitext(config) @@ -107,18 +111,18 @@ def main(): configs = load_configs() window = Gtk.Window() - window.modify_font(Pango.FontDescription('Ubuntu 10')) + window.modify_font(Pango.FontDescription('xos4 Terminus 9')) window.set_property('type-hint', Gdk.WindowTypeHint.SPLASHSCREEN) window.set_decorated(False) window.set_resizable(False) window.connect('leave-notify-event', Gtk.main_quit) - window.connect('delete-event', Gtk.main_quit) - #window.set_property('skip-taskbar-hint', False) - #window.set_title('bar-dropdown') - #window.set_border_width(0) - #window.stick() + window.set_property('skip-taskbar-hint', False) + # window.set_title('bar-dropdown') + # window.set_border_width(0) + # window.stick() + window.connect('delete-event', Gtk.main_quit) scrolled = Gtk.ScrolledWindow() scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)