Change menu and rc to use rofi for logout

This commit is contained in:
natemaia 2017-12-22 14:00:35 -08:00
parent 108410fd01
commit 34019d115d
3 changed files with 23 additions and 19 deletions

View File

@ -198,7 +198,7 @@
</item> </item>
<item label="Exit Openbox"> <item label="Exit Openbox">
<action name="Execute"> <action name="Execute">
<command>oblogout</command> <command>rofi-logout</command>
</action> </action>
</item> </item>
</menu> </menu>

View File

@ -372,12 +372,12 @@
<!-- Logout & Reload --> <!-- Logout & Reload -->
<keybind key="W-x"> <keybind key="W-x">
<action name="Execute"> <action name="Execute">
<command>oblogout</command> <command>rofi-logout</command>
</action> </action>
</keybind> </keybind>
<keybind key="C-A-Delete"> <keybind key="C-A-Delete">
<action name="Execute"> <action name="Execute">
<command>oblogout</command> <command>rofi-logout</command>
</action> </action>
</keybind> </keybind>
<keybind key="W-S-Escape"> <keybind key="W-S-Escape">

View File

@ -23,6 +23,8 @@ class Selection(Gtk.EventBox):
self.background = background self.background = background
self.selected_colour = selected self.selected_colour = selected
if not working:
name = 'x ' + name
text = Gtk.Label(name) text = Gtk.Label(name)
hbox = Gtk.HBox() hbox = Gtk.HBox()
hbox.set_size_request(0, 30) hbox.set_size_request(0, 30)
@ -43,36 +45,38 @@ class Selection(Gtk.EventBox):
hbox.pack_end(colour_widgets, False, True, 20) hbox.pack_end(colour_widgets, False, True, 20)
self.hbox = hbox self.hbox = hbox
#self.connect('enter-notify-event', self.selected) self.connect('enter-notify-event', self.selected)
#self.connect('leave-notify-event', self.unselected) self.connect('leave-notify-event', self.unselected)
self.connect('button-press-event', self.clicked) self.connect('button-press-event', self.clicked)
self.add(self.hbox) self.add(self.hbox)
def clicked(self, button): def clicked(self, widget, button):
_, index = button.get_button() _, index = button.get_button()
if index == 1: if index == 1:
subprocess.run([PATH, 'load', self.name]) proc = subprocess.run([PATH, 'load', self.name])
Gtk.main_quit() Gtk.main_quit()
return None return None
#def selected(self, *args): def selected(self, *args):
# return None # self.hbox.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(*self.selected))
return None
#def unselected(self, *args): def unselected(self, *args):
# return None # self.hbox.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(*self.selected))
return None
def load_configs(): def load_configs():
broken = subprocess.check_output([PATH, 'check', GROUP]) broken = subprocess.check_output([PATH, 'check', GROUP])
broken = broken.decode('utf-8').split('\n') broken = broken.decode('utf-8').split('\n')
path = '{}/.gorice/output.yaml'.format(os.environ['HOME'])
output = [] output = []
path = '{}/.gorice/output.yaml'.format(os.environ['HOME'])
with open(path, 'r') as f: with open(path, 'r') as f:
data = yaml.load(f.read()) data = yaml.load(f.read())
names = sorted(data['configs']) names = sorted(data['configs'])
for config in names: for config in names:
info = data['configs'][config] info = data['configs'][config]
config, ext = os.path.splitext(config) config, ext = os.path.splitext(config)
@ -107,18 +111,18 @@ def main():
configs = load_configs() configs = load_configs()
window = Gtk.Window() 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_property('type-hint', Gdk.WindowTypeHint.SPLASHSCREEN)
window.set_decorated(False) window.set_decorated(False)
window.set_resizable(False) window.set_resizable(False)
window.connect('leave-notify-event', Gtk.main_quit) window.connect('leave-notify-event', Gtk.main_quit)
window.connect('delete-event', Gtk.main_quit) window.set_property('skip-taskbar-hint', False)
#window.set_property('skip-taskbar-hint', False) # window.set_title('bar-dropdown')
#window.set_title('bar-dropdown') # window.set_border_width(0)
#window.set_border_width(0) # window.stick()
#window.stick()
window.connect('delete-event', Gtk.main_quit)
scrolled = Gtk.ScrolledWindow() scrolled = Gtk.ScrolledWindow()
scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)