You are not logged in.

#1 2014-04-16 17:37:25

MXIIA
Member
Registered: 2012-01-22
Posts: 15

gnome-tweak-tool 3.12 not launching

output of journalctl is

[mxiia@snsvtop gtweak]$ journalctl -b _PID=1227
-- Logs begin at Tue 2013-11-05 22:30:07 EST, end at Wed 2014-04-16 13:35:29 EDT. --
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: Traceback (most recent call last):
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/app.py", line 39, in do_activate
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: self.win = Window(self, model)
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 45, in __init__
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: titlebar = self.titlebar()
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 77, in titlebar
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: right_header.props.decoration_layout = ":" + tokens[1]
Apr 16 12:29:05 snsvtop gnome-tweak-tool.desktop[1227]: IndexError: list index out of range
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: Traceback (most recent call last):
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/app.py", line 39, in do_activate
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: self.win = Window(self, model)
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 45, in __init__
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: titlebar = self.titlebar()
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 77, in titlebar
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: right_header.props.decoration_layout = ":" + tokens[1]
Apr 16 12:39:29 snsvtop gnome-tweak-tool.desktop[1227]: IndexError: list index out of range
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: Traceback (most recent call last):
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/app.py", line 39, in do_activate
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: self.win = Window(self, model)
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 45, in __init__
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: titlebar = self.titlebar()
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 77, in titlebar
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: right_header.props.decoration_layout = ":" + tokens[1]
Apr 16 12:40:40 snsvtop gnome-tweak-tool.desktop[1227]: IndexError: list index out of range
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: Traceback (most recent call last):
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/app.py", line 39, in do_activate
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: self.win = Window(self, model)
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 45, in __init__
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: titlebar = self.titlebar()
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: File "/usr/lib/python2.7/site-packages/gtweak/tweakview.py", line 77, in titlebar
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: right_header.props.decoration_layout = ":" + tokens[1]
Apr 16 12:44:50 snsvtop gnome-tweak-tool.desktop[1227]: IndexError: list index out of range

tweakview.py looks like this

# This file is part of gnome-tweak-tool.
#
# Copyright (c) 2011 John Stowers
#
# gnome-tweak-tool 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.
#
# gnome-tweak-tool 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 gnome-tweak-tool.  If not, see <http://www.gnu.org/licenses/>.

import os.path
import logging
import datetime

from gi.repository import Gtk, Gdk, GObject

import gtweak.tweakmodel
from gtweak.tweakmodel import TweakModel
from gtweak.widgets import Title

class Window(Gtk.ApplicationWindow):

    def __init__(self, app, model):
        Gtk.ApplicationWindow.__init__(self,
                                       application=app)
        
        self.set_size_request(950, 680)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.set_icon_name("gnome-tweak-tool")
        
        self.hsize_group = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL)

        main_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        left_box = self.sidebar()
        right_box = self.main_content()
        separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)
        
        titlebar = self.titlebar()
        self.set_titlebar(titlebar)

        main_box.pack_start(left_box, False, False, 0)
        main_box.pack_start(separator, False, False, 0)
        main_box.pack_start(right_box, True, True, 0)
        
        self.load_css()      
        self._model = model
        self._model.load_tweaks(self)
        self.load_model_data()

        self.connect("key-press-event", self._on_key_press)
        self.add(main_box)
    
    def titlebar(self):

        header = Gtk.Box()

        left_header = Gtk.HeaderBar()
        left_header.props.show_close_button = True
        right_header = Gtk.HeaderBar()
        right_header.props.show_close_button = True

        left_header.get_style_context().add_class("titlebar")
        left_header.get_style_context().add_class("tweak-titlebar-left")
        right_header.get_style_context().add_class("titlebar")
        right_header.get_style_context().add_class("tweak-titlebar-right")

        layout_desc = Gtk.Settings.get_default().props.gtk_decoration_layout;
        tokens = layout_desc.split(":", 2)
        if tokens != None:
                right_header.props.decoration_layout = ":" + tokens[1]
                left_header.props.decoration_layout = tokens[0]

        self.title = Gtk.Label("")
        self.title.get_style_context().add_class("title")
        right_header.set_custom_title(self.title)

        icon = Gtk.Image()
        icon.set_from_icon_name("edit-find-symbolic",Gtk.IconSize.MENU)
        self.button = Gtk.ToggleButton()
        self.button.add(icon)
        self.button.connect("toggled", self._on_find_toggled)
        self.button.props.valign = Gtk.Align.CENTER
        self.button.get_style_context().add_class("image-button")
        left_header.pack_start(self.button)

        lbl = Gtk.Label(_("Tweaks"))
        lbl.get_style_context().add_class("title")
        left_header.set_custom_title(lbl)

        header.pack_start(left_header, False, False, 0)
        header.pack_start(Gtk.Separator(orientation=Gtk.Orientation.VERTICAL), False, False, 0)
        header.pack_start(right_header, True, True, 0)
        
        self.hsize_group.add_widget(left_header)

        return header
        
        
    def sidebar(self):
        left_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        
        self.entry = Gtk.SearchEntry(placeholder_text=_("Search Tweaks..."))
        self.entry.connect("search-changed", self._on_search)
        
        self.searchbar = Gtk.SearchBar()
        self.searchbar.add(self.entry)
        self.searchbar.props.hexpand = False
        
        self.listbox = Gtk.ListBox()
        self.listbox.get_style_context().add_class("tweak-categories")
        self.listbox.set_size_request(200,-1)
        self.listbox.connect("row-selected", self._on_select_row)
        self.listbox.set_header_func(self._list_header_func, None)
        scroll = Gtk.ScrolledWindow()
        scroll.set_policy(Gtk.PolicyType.NEVER,
                          Gtk.PolicyType.AUTOMATIC)
        scroll.add(self.listbox)
        
        left_box.pack_start(self.searchbar, False, False, 0)
        left_box.pack_start(scroll, True, True, 0)
        
        self.hsize_group.add_widget(left_box)

        return left_box
        
    def main_content(self):        
        right_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        
        #GRR why can I not put margin in the CSS of a GtkStack
        self.stack = Gtk.Stack()
        self.stack.get_style_context().add_class("main-container")
        self.stack.props.margin = 20
    
        right_box.pack_start(self.stack, True, True, 0)
        
        return right_box

    def load_css(self):
        css_provider = Gtk.CssProvider()
        css_provider.load_from_path(
                        os.path.join(gtweak.PKG_DATA_DIR, 'shell.css'))
        screen = Gdk.Screen.get_default()
        context = Gtk.StyleContext()
        context.add_provider_for_screen(screen, css_provider,
                                Gtk.STYLE_PROVIDER_PRIORITY_USER)

    def load_model_data(self):

        def _make_items_listbox(text):
            lbl = Gtk.Label(text, xalign=0.0)
            lbl.set_name('row')
            row = Gtk.ListBoxRow()
            row.get_style_context().add_class("tweak-category")
            row.add(lbl)
            return row

        groups = self._model._tweak_group_names.keys()
        groups = sorted(groups)

        for g in groups:
            row = _make_items_listbox(g)
            self.listbox.add(row)
            tweakgroup = self._model.get_value(
                                self._model.get_tweakgroup_iter(g), 
                                self._model.COLUMN_TWEAK)
            scroll = Gtk.ScrolledWindow()
            scroll.add(tweakgroup)
            self.stack.add_named(scroll, g)

        widget = self.listbox.get_row_at_index(0)
        self.listbox.select_row (widget)

    def _list_filter_func(self, row, user_data):
        lbl = row.get_child()
        if lbl.get_text() in user_data:
            return row
    
    def _list_header_func(self, row, before, user_data):
        if before and not row.get_header():
            row.set_header (Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL))

    def _on_key_press(self, widget, event):
        keyname = Gdk.keyval_name(event.keyval)
        if keyname == 'Escape':
            self.button.set_active(False)
        if event.state and Gdk.ModifierType.CONTROL_MASK:
            if keyname == 'f':
                self.button.set_active(True)

    def _on_list_changed(self, group):
        self.listbox.set_filter_func(self._list_filter_func, group)
        selected = self.listbox.get_selected_row().get_child().get_text()
        if group and not selected in group:
            index =  sorted(self._model._tweak_group_names.keys()).index(group[0])
            row = self.listbox.get_row_at_index(index)
            self.listbox.select_row(row)

    def _on_search(self, entry):
        txt = entry.get_text().decode("utf-8","ignore").lower()
        tweaks, group = self._model.search_matches(txt)
        self.show_only_tweaks(tweaks)        
        self._on_list_changed(group)
        
    def _on_select_row(self, listbox, row):
        if row:
            group = row.get_child().get_text()
            self.stack.set_visible_child_name(group)
            self.title.set_text(group)

    def _on_find_toggled(self, btn):
         if self.searchbar.get_search_mode():
             self.searchbar.set_search_mode(False)
             self.entry.set_text("")
         else:
            self.searchbar.set_search_mode(True)
            self.entry.grab_focus()

    def show_only_tweaks(self, tweaks):
        for t in self._model.tweaks:
            if t in tweaks:
                t.show_all()
            else:
                t.hide()

app.py

# This file is part of gnome-tweak-tool.
#
# Copyright (c) 2011 John Stowers
#
# gnome-tweak-tool 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.
#
# gnome-tweak-tool 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 gnome-tweak-tool.  If not, see <http://www.gnu.org/licenses/>.

import os.path

from gi.repository import Gtk
from gi.repository import Gio

import gtweak 
from gtweak.tweakmodel import TweakModel
from gtweak.tweakview import Window
from gtweak.utils import SchemaList
from gtweak.gshellwrapper import GnomeShellFactory
from gtweak.utils import DisableExtension
        
class GnomeTweakTool(Gtk.Application):

    def __init__(self):
        Gtk.Application.__init__(self,application_id="org.gnome.TweakTool")
        self.win = None

    def do_activate(self):
        if not self.win:
            model = TweakModel()            
            self.win = Window(self, model)
            self.win.show_all()
        self.win.present()
        
    def do_startup(self):
        Gtk.Application.do_startup(self)
        
        self.builder = Gtk.Builder()
        assert(os.path.exists(gtweak.PKG_DATA_DIR))   
        filename = os.path.join(gtweak.PKG_DATA_DIR, 'shell.ui')
        self.builder.add_from_file(filename)
        
        appmenu = self.builder.get_object('appmenu')
        self.set_app_menu(appmenu)

        reset_action = Gio.SimpleAction.new("reset", None)
        reset_action.connect("activate", self.reset_cb)
        self.add_action(reset_action)      

        disable_extension_action = Gio.SimpleAction.new("disable_extension", None)
        disable_extension_action.connect("activate", self.disable_cb)
        self.add_action(disable_extension_action)  

        help_action = Gio.SimpleAction.new("help", None)
        help_action.connect("activate", self.help_cb)
        self.add_action(help_action)

        about_action = Gio.SimpleAction.new("about", None)
        about_action.connect("activate", self.about_cb)
        self.add_action(about_action)

        quit_action = Gio.SimpleAction.new("quit", None)
        quit_action.connect("activate", self.quit_cb)
        self.add_action(quit_action)

    def reset_cb(self, action, parameter):
        dialog = Gtk.MessageDialog(self.win,0, Gtk.MessageType.QUESTION,
                    Gtk.ButtonsType.OK_CANCEL, _("Reset to Defaults"))
        dialog.format_secondary_text(_("Reset all tweak settings to the original default state?"))
        response = dialog.run()
        if response == Gtk.ResponseType.OK:
            s = SchemaList() 
            s.reset()
        dialog.destroy()
            
    def help_cb(self, action, parameter):
        print "This does nothing. It is only a demonstration."

    def disable_cb(self, action, parameter):
        ds = DisableExtension()
        ds.disable()

    def about_cb(self, action, parameter):
        aboutdialog = Gtk.AboutDialog()
        aboutdialog.set_title(_("About GNOME Tweak Tool"))
        aboutdialog.set_program_name(_("GNOME Tweak Tool"))

        _shell = GnomeShellFactory().get_shell()
        if _shell is not None:
            aboutdialog.set_comments(_("GNOME Shell v%s (%s mode)") % (_shell.version, _shell.mode))
        else:
            aboutdialog.set_comments(_("GNOME Shell not running"))

        aboutdialog.set_copyright("Copyright \xc2\xa9 2011 - 2013 John Stowers.")
        aboutdialog.set_logo_icon_name("gnome-tweak-tool")
        aboutdialog.set_website("http://live.gnome.org/GnomeTweakTool") 
        aboutdialog.set_website_label(_("Homepage"))
        aboutdialog.set_license_type(Gtk.License.GPL_3_0)
            
        AUTHORS = [
                "John Stowers <john.stowers@gmail.com>"
                ]
 
        aboutdialog.set_authors(AUTHORS)             
        aboutdialog.connect("response", lambda w, r: aboutdialog.destroy())
        aboutdialog.show()

    def quit_cb(self, action, parameter):
        self.quit()

I've tried a pacman -Rn and reinstalling it.

Running gnome-tweak-tool from terminal shows no output.

Any suggestions?

Last edited by MXIIA (2014-04-16 17:41:20)

Offline

#2 2014-04-21 17:59:52

MXIIA
Member
Registered: 2012-01-22
Posts: 15

Re: gnome-tweak-tool 3.12 not launching

bump: still having this issue.

Offline

#3 2014-04-25 15:58:50

MXIIA
Member
Registered: 2012-01-22
Posts: 15

Re: gnome-tweak-tool 3.12 not launching

bump: still having this issue.

Offline

#4 2014-04-25 17:14:34

\hbar
Member
Registered: 2014-03-15
Posts: 165

Re: gnome-tweak-tool 3.12 not launching

Is GTK is up to date?

Have you tried commenting the offending line in tweakview.py?

Have you tried to make it print Gtk.Settings.get_default().props.gtk_decoration_layout right before the offending line, in order to check that it contains at least two elements?

Offline

Board footer

Powered by FluxBB