当我尝试运行时出现这个特殊错误sudo wifi-radar
。
No protocol specified
/usr/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
warnings.warn(str(e), _gtk.Warning)
/usr/bin/wifi-radar:794: Warning: invalid (NULL) pointer instance
self.window = gtk.Dialog('WiFi Radar', None, gtk.DIALOG_MODAL )
/usr/bin/wifi-radar:794: Warning: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
self.window = gtk.Dialog('WiFi Radar', None, gtk.DIALOG_MODAL )
/usr/bin/wifi-radar:806: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.close_button = gtk.Button( "Close", gtk.STOCK_CLOSE )
/usr/bin/wifi-radar:806: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.close_button = gtk.Button( "Close", gtk.STOCK_CLOSE )
/usr/bin/wifi-radar:806: Warning: value "TRUE" of type 'gboolean' is invalid or out of range for property 'visible' of type 'gboolean'
self.close_button = gtk.Button( "Close", gtk.STOCK_CLOSE )
/usr/bin/wifi-radar:809: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.about_button = gtk.Button( "About", gtk.STOCK_ABOUT )
/usr/bin/wifi-radar:809: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.about_button = gtk.Button( "About", gtk.STOCK_ABOUT )
/usr/bin/wifi-radar:809: Warning: value "TRUE" of type 'gboolean' is invalid or out of range for property 'visible' of type 'gboolean'
self.about_button = gtk.Button( "About", gtk.STOCK_ABOUT )
/usr/bin/wifi-radar:812: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.preferences_button = gtk.Button( "Preferences", gtk.STOCK_PREFERENCES )
/usr/bin/wifi-radar:812: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.preferences_button = gtk.Button( "Preferences", gtk.STOCK_PREFERENCES )
/usr/bin/wifi-radar:812: Warning: value "TRUE" of type 'gboolean' is invalid or out of range for property 'visible' of type 'gboolean'
self.preferences_button = gtk.Button( "Preferences", gtk.STOCK_PREFERENCES )
/usr/bin/wifi-radar:827: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.plist.append_column( self.icons_col )
/usr/bin/wifi-radar:827: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.plist.append_column( self.icons_col )
/usr/bin/wifi-radar:833: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.plist.append_column( self.ap_col )
/usr/bin/wifi-radar:833: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.plist.append_column( self.ap_col )
/usr/bin/wifi-radar:839: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.plist.append_column( self.signal_col )
/usr/bin/wifi-radar:839: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.plist.append_column( self.signal_col )
/usr/bin/wifi-radar:845: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.plist.append_column( self.mode_col )
/usr/bin/wifi-radar:845: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.plist.append_column( self.mode_col )
/usr/bin/wifi-radar:851: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.plist.append_column( self.protocol_col )
/usr/bin/wifi-radar:851: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.plist.append_column( self.protocol_col )
/usr/bin/wifi-radar:857: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.plist.append_column( self.channel_col )
/usr/bin/wifi-radar:857: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.plist.append_column( self.channel_col )
/usr/bin/wifi-radar:866: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
sb = gtk.ScrolledWindow()
/usr/bin/wifi-radar:870: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.new_button = gtk.Button( "_New" )
/usr/bin/wifi-radar:870: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.new_button = gtk.Button( "_New" )
/usr/bin/wifi-radar:874: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.edit_button = gtk.Button( "C_onfigure" )
/usr/bin/wifi-radar:874: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.edit_button = gtk.Button( "C_onfigure" )
/usr/bin/wifi-radar:879: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.delete_button = gtk.Button( "_Delete" )
/usr/bin/wifi-radar:879: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.delete_button = gtk.Button( "_Delete" )
/usr/bin/wifi-radar:884: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.connect_button = gtk.Button( "Co_nnect" )
/usr/bin/wifi-radar:884: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.connect_button = gtk.Button( "Co_nnect" )
/usr/bin/wifi-radar:887: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.disconnect_button = gtk.Button( "D_isconnect" )
/usr/bin/wifi-radar:887: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
self.disconnect_button = gtk.Button( "D_isconnect" )
/usr/bin/wifi-radar:920: GtkWarning: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
self.window.show_all()
/usr/bin/wifi-radar:920: GtkWarning: IA__gdk_pango_context_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_context_set_font_description: assertion 'context != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_context_set_base_dir: assertion 'context != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_context_set_language: assertion 'context != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_new: assertion 'context != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_set_text: assertion 'layout != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_set_attributes: assertion 'layout != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_set_alignment: assertion 'layout != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_set_ellipsize: assertion 'PANGO_IS_LAYOUT (layout)' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_set_single_paragraph_mode: assertion 'PANGO_IS_LAYOUT (layout)' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_set_width: assertion 'layout != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: PangoWarning: pango_layout_get_extents: assertion 'layout != NULL' failed
self.window.show_all()
/usr/bin/wifi-radar:920: GtkWarning: IA__gdk_screen_get_default_colormap: assertion 'GDK_IS_SCREEN (screen)' failed
self.window.show_all()
/usr/bin/wifi-radar:920: GtkWarning: IA__gdk_colormap_get_visual: assertion 'GDK_IS_COLORMAP (colormap)' failed
self.window.show_all()
/usr/bin/wifi-radar:920: GtkWarning: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed
self.window.show_all()
/usr/bin/wifi-radar:920: GtkWarning: IA__gdk_window_new: assertion 'GDK_IS_WINDOW (parent)' failed
self.window.show_all()
[1] 8059 segmentation fault sudo wifi-radar
答案1
你应该尝试使用xhost
xhost 程序用于将主机名或用户名添加到允许连接到 X 服务器的列表中,或从中删除。对于主机,这提供了一种基本的隐私控制和安全形式。它只适用于工作站(单用户)环境,尽管它确实限制了最严重的滥用。需要更复杂措施的环境应实施基于用户的机制或使用协议中的钩子将其他身份验证数据传递给服务器
xhost
将打印允许的名称列表
$ xhost
access control enabled, only authorized clients can connect
SI:localuser:yourusername
xhost +si:localuser:root
应该对你的情况有帮助。
然后你会看到
$ xhost
access control enabled, only authorized clients can connect
SI:localuser:root
SI:localuser:yourusername
并将sudo wifi-radar
按预期工作。
这大概就是您看到此错误消息的原因之一。