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 label="Exit Openbox">
<action name="Execute">
<command>oblogout</command>
<command>rofi-logout</command>
</action>
</item>
</menu>

View File

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

View File

@ -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_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)