Advertisement
ratamahata

[Issue] xfce4-settings-manager under hyprland

Nov 14th, 2024
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.01 KB | None | 0 0
  1. Hi again, I found a solution that works for me. So I post here to help any other user facing the same issue. The problem I encountered happened because xfce4-settings-manager is trying to run under Wayland, but it is built to work with X11. The error suggests a compatibility issue between GTK, X11, and Wayland. I use hyprland.
  2. So the solution that works for me was to run xfce4-settings-manager using XWayland, which is a compatibility layer for running X11 apps in Wayland, with:
  3.  
  4. GDK_BACKEND=x11 xfce4-settings-manager
  5. This command forces xfce4-settings-manager to use Xwayland (terminal).
  6.  
  7. -To run xfce4-settings-manager under XWayland without needing to use the terminal each time,
  8.  
  9. 1.Create a wrapper script:
  10. sudo nano /usr/local/bin/xfce4-settings-manager-wrapper (global)
  11. (or local to: ~/.local/bin)
  12. (make sure the directory is in your $PATH).
  13.  
  14. -Add the following lines to the script:
  15. #!/bin/bash
  16. GDK_BACKEND=x11 xfce4-settings-manager
  17.  
  18. -Make the script executable:
  19. sudo chmod +x /usr/local/bin/xfce4-settings-manager-wrapper
  20.  
  21. 2.Modify the .desktop File to Use the Wrapper Script
  22. sudo nano /usr/share/applications/xfce4-settings-manager.desktop
  23.  
  24. -Change the Exec line to point to your wrapper script:
  25. Exec=/usr/local/bin/xfce4-settings-manager-wrapper
  26.  
  27. 3.run the xfce4-settings-manager-wrapper from hyprland menu
  28.  
  29. ---------------------------------------------
  30.  
  31. Then, another problem I had, was that I couldn’t run the firewall configuration (Gufw) from inside xfce4-settings-manager-wrapper. With the errors:
  32.  
  33. (gufw.py:6742): Gdk-CRITICAL **: 12:11:52.759: gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed .
  34. (gufw.py:6742): Gdk-CRITICAL **: 12:11:52.759: gdk_keymap_get_modifier_mask: assertion 'GDK_IS_KEYMAP (keymap)' failed .
  35. (gufw.py:6742): Gtk-CRITICAL **: 12:11:52.760: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed /usr/bin/gufw-pkexec: line 2: 6742 Segmentation fault (core dumped) python3 /usr/lib/python3.12/site-packages/gufw/gufw.py "$@"
  36.  
  37. So, what I found is that, gufw crashing due to Gdk and Gtk errors, is likely due to incompatibility with Wayland. Gufw has stability issues under Wayland and generally functions better under X11.
  38. The solution I found, is to run gufw with xhost to grant temporary display access.
  39.  
  40. 1.Create a Wrapper Script:
  41. sudo nano /usr/local/bin/gufw-wrapper
  42.  
  43. 2.Add the following lines to the script:
  44. #!/bin/bash
  45. # Grant root access to display
  46. xhost +SI:localuser:root
  47. # Run Gufw with X11 backend using sudo
  48. GDK_BACKEND=x11 sudo gufw
  49. # Revoke display access for root after closing Gufw
  50. xhost -SI:localuser:root
  51.  
  52. 3.Make the script executable:
  53. sudo chmod +x /usr/local/bin/gufw-wrapper
  54.  
  55. -if you want to run it from menu edit:
  56. sudo nano /usr/share/applications/gufw.desktop
  57. with:
  58. Exec=/usr/local/bin/gufw-wrapper
  59.  
  60. -I prefer to run ti from the terminal, so I can see messages. The output I take is:
  61. localuser:root being added to access control list
  62. localuser:root being removed from access control list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement