You are not logged in.

#1 2025-02-03 20:29:12

drneba
Member
Registered: 2025-02-03
Posts: 3

[SOLVED] I got error for gufw on Hyprland

I'm a beginner in the Linux world. I'm learning slowly and I've encountered my first problem. I'm using ArchLinux with Hyprland. I've installed

ufw gufw

. When I try to run gufw, I get the following error. I've tried everything I've found and it's not worth it.

Authorization required, but no authorization protocol specified
Authorization required, but no authorization protocol specified

(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.868: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.868: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.869: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.869: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gdk-CRITICAL **: 21:05:57.869: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.869: _gtk_replace_virtual_modifiers: assertion 'GDK_IS_KEYMAP (keymap)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.870: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.870: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(gufw.py:16855): Gtk-CRITICAL **: 21:05:57.870: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
/usr/bin/gufw-pkexec: line 2: 16855 Segmentation fault      (core dumped) python3 /usr/lib/python3.13/site-packages/gufw/gufw.py "$@"

Last edited by drneba (2025-02-05 10:31:23)

Offline

#2 2025-02-03 21:13:49

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,824
Website

Re: [SOLVED] I got error for gufw on Hyprland

The package ships a polkit authorisation file so try

pkexec gufw

Jin, Jîyan, Azadî

Offline

#3 2025-02-03 21:57:32

drneba
Member
Registered: 2025-02-03
Posts: 3

Re: [SOLVED] I got error for gufw on Hyprland

I'm getting the same error

Offline

#4 2025-02-03 22:44:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,119

Re: [SOLVED] I got error for gufw on Hyprland

you need to launch a polkit agent: https://wiki.archlinux.org/title/Polkit … ion_agents -- doesn't really matter which one but pick one and start it as part of your startup programs

Offline

#5 2025-02-04 07:34:52

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,824
Website

Re: [SOLVED] I got error for gufw on Hyprland

I think pkttyagent would have asked for a password if the OP ran my command from a terminal.

@OP: is the plain polkit package installed?


Jin, Jîyan, Azadî

Offline

#6 2025-02-04 11:14:54

eriefisher
Member
Registered: 2025-02-01
Posts: 22

Re: [SOLVED] I got error for gufw on Hyprland

I don't know if the same is true with Hyprland but with Labwc/Xfce4 the user could not get privileges  to apps like gufw. Wayland doesn't allow it by default. For it to work I had to add a couple lines to the labwc autostart file. I assume hyprland has something similar. You will still have to call it from a terminal but it works.

 #### allow root/graphical use ####
xhost +SI:localuser:$(id -un) &
xhost +SI:localuser:root &

I Am Canadian!

Offline

#7 2025-02-04 14:06:21

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,824
Website

Re: [SOLVED] I got error for gufw on Hyprland

eriefisher wrote:

Wayland doesn't allow it by default

Good catch!

Probably best to use a wrapper with gufw though to reset the permissions after running it, something like this at /usr/local/bin/gufw should work:

#!/bin/sh
xhost +SI:localuser:root
pkexec /usr/bin/gufw "$@"
xhost -SI:localuser:root

Last edited by Head_on_a_Stick (2025-02-04 14:06:43)


Jin, Jîyan, Azadî

Offline

#8 2025-02-04 15:28:47

eriefisher
Member
Registered: 2025-02-01
Posts: 22

Re: [SOLVED] I got error for gufw on Hyprland

Yes that would/should work just fine except that it's specific to gufw. You would need to do the same if there is any other graphical application requiring elevated privileges.


I Am Canadian!

Offline

#9 2025-02-04 16:01:00

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,824
Website

Re: [SOLVED] I got error for gufw on Hyprland

I suppose you could use pkexec itself and drop /usr/bin/gufw to make it universal.


Jin, Jîyan, Azadî

Offline

#10 2025-02-04 16:02:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,119

Re: [SOLVED] I got error for gufw on Hyprland

Applications that want to do this should properly implement polkit auth so they can run their GUI code separate from the actual auth needing operation, which is adjusting ip/nftables...

Offline

#11 2025-02-04 17:12:08

drneba
Member
Registered: 2025-02-03
Posts: 3

Re: [SOLVED] I got error for gufw on Hyprland

eriefisher wrote:

I don't know if the same is true with Hyprland but with Labwc/Xfce4 the user could not get privileges  to apps like gufw. Wayland doesn't allow it by default. For it to work I had to add a couple lines to the labwc autostart file. I assume hyprland has something similar. You will still have to call it from a terminal but it works.

 #### allow root/graphical use ####
xhost +SI:localuser:$(id -un) &
xhost +SI:localuser:root &

It works for me with this.


V1del wrote:

Applications that want to do this should properly implement polkit auth so they can run their GUI code separate from the actual auth needing operation, which is adjusting ip/nftables...

If you can give me a simpler explanation.

Offline

#12 2025-02-04 17:25:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,119

Re: [SOLVED] I got error for gufw on Hyprland

There's nothing you can do about it as a user, so use the xhost method. The developers of gufw should implement proper privilege separation so that the GUI code doesn't need to be ran as root, but just the parts that require actual adjustment.

Offline

Board footer

Powered by FluxBB