WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.38k stars 178 forks source link

What's the right way to start a wayland session? #1611

Closed superiums closed 12 months ago

superiums commented 1 year ago

there'are 2 ways to start a WM session for sway/wayfire/... no matter start the WM from tty manually, or let DM load the session for WM, or start a command by DM.

  1. run sway/wayfire directly.
  2. run sway/wayfire by dbus: dbus-launch wayfire

i am using greetd and tui-greeter.

Way 1, launch WM directly

all things works but except gvfs and fcitx5-rime.

(process:14320): GLib-GObject-CRITICAL **: 11:21:21.921: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

(process:14320): GLib-GIO-CRITICAL **: 11:21:21.924: g_volume_monitor_get_mounts: assertion 'G_IS_VOLUME_MONITOR (volume_monitor)' failed

(process:14320): GLib-GObject-WARNING **: 11:21:21.924: invalid (NULL) pointer instance

(process:14320): GLib-GObject-CRITICAL **: 11:21:21.924: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:14320): GLib-GObject-WARNING **: 11:21:21.924: invalid (NULL) pointer instance

(process:14320): GLib-GObject-CRITICAL **: 11:21:21.924: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

Way 2, lauch WM by dbus

if i use this command to let the DM start the WM

cmd='tuigreet -cmd dbus-launch wayfire'

or type dbus-launch wayfire in tty

error: Failed to inhibit: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: on path org.freedesktop.portal.Inhibit object not found“/org/freedesktop/portal/desktop”interface

additional

i'm using void-linux. dbus-daemon was runing in all these situation. dbus service was enabled and elogind was launched by greetd.

ammen99 commented 1 year ago

The first way is the correct way. What is your wayfire.ino file? The example config contains an autostart entry for exporting the necessary environmental variables to dbus/systemd.

marcusbritanicus commented 1 year ago

You can try starting the first way. But you should probably add dbus-launch to autostart:

[autostart]
00_dbus = dbus-launch
...
...

Alternatively, you can also try to start your wayfire session using the command: dbus-run-session wayfire. dbus-launch is meant to be used in user login scripts.

superiums commented 1 year ago

The first way is the correct way. What is your wayfire.ino file? The example config contains an autostart entry for exporting the necessary environmental variables to dbus/systemd.

i let greetd to start a script called wayfire-run : in this script, i exported some enviroment and start wayfire:


#  cat $(which wayfire-run)

#!/bin/sh

# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=Wayfire
export XDG_CURRENT_DESKTOP=Wayfire

# Wayland stuff
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1

# exec dbus-launch --exit-with-session wayfire $@
exec wayfire $@
superiums commented 1 year ago

You can try starting the first way. But you should probably add dbus-launch to autostart:

[autostart]
00_dbus = dbus-launch
...
...

Alternatively, you can also try to start your wayfire session using the command: dbus-run-session wayfire. dbus-launch is meant to be used in user login scripts.

dbus service was enabled, so am i still need to start a dbus-launch on start ?

# ls /var/service/
NetworkManager@  agetty-tty3@  bluetoothd@  polkitd@
acpid@           agetty-tty4@  cupsd@       rtkit@
agetty-tty1@     agetty-tty5@  dbus@        udevd@
agetty-tty2@     agetty-tty6@  greetd@      uuidd@

i have tried dbus-run-session wayfire, but it results the same situations as dbus-launch.

superiums commented 1 year ago

finally ,solved by add this line to the start script:

export $(dbus-launch)

the gvfs and fcitx in chrome, electron works. but still, screen capture in obs not work.

superiums commented 1 year ago

while open chromium or electron , every thing works , but report:

no such interface : org.freedesktop.portal.FileChooser

file chooser also works. and xdg-desktop-portal is running:

~> ps -aux|grep xdg
shvo      7650  0.0  0.0 400272 13104 ?        Sl   10:48   0:00 /usr/libexec/xdg-desktop-portal
shvo      7656  0.0  0.0 459168  6436 ?        Sl   10:48   0:00 /usr/libexec/xdg-document-portal
shvo      7660  0.0  0.0 235292  5684 ?        Sl   10:48   0:00 /usr/libexec/xdg-permission-store
marcusbritanicus commented 1 year ago

Ensure xdg-desktop-portal is running. If you want to start it, add it to autostart

[autostart]
01_xdp=/usr/libexec/xdg-desktop-portal
02_xdpg=/usr/libexec/xdg-desktop-portal-gtk
03_xdpw=/usr/libexec/xdg-desktop-portal-wlr
superiums commented 1 year ago

Ensure xdg-desktop-portal is running. If you want to start it, add it to autostart

/usr/libexec/xdg-desktop-portal is runing by runit.

02_xdpg=/usr/libexec/xdg-desktop-portal-gtk
03_xdpw=/usr/libexec/xdg-desktop-portal-wlr

i run these two manually, but nothing change.

ammen99 commented 1 year ago

@superiums You are not meant to run xdg-desktop-portal-gtk manually. Can you post your full wayfire.ini file?

superiums commented 1 year ago

@superiums You are not meant to run xdg-desktop-portal-gtk manually. Can you post your full wayfire.ini file?

yes, i didn't run it in wayfire this is my wayfire.ini

[alpha]
min_value = 0.100000
modifier = <alt> <super> 

[animate]
close_animation = zoom
duration = 400
enabled_for = (type equals "toplevel" | (type equals "x-or" & focusable equals true))
fade_duration = 400
fade_enabled_for = type equals "overlay"
fire_duration = 300
fire_enabled_for = none
fire_particle_size = 16.000000
fire_particles = 2000
open_animation = zoom
startup_duration = 600
zoom_duration = 500
zoom_enabled_for = none

[annotate]
clear_workspace = <alt> <super> KEY_C
draw = <alt> <super> BTN_LEFT
from_center = true
line_width = 3.000000
method = draw
stroke_color = \#FF0000FF

[autorotate-iio]
lock_rotation = false
rotate_down = <ctrl> <super> KEY_DOWN
rotate_left = <ctrl> <super> KEY_LEFT
rotate_right = <ctrl> <super> KEY_RIGHT
rotate_up = <ctrl> <super> KEY_UP

[autostart]
autostart_wf_shell = false
footserver = foot -s
idle = swayidle before-sleep 'swaylock -i /home/share/wallpaper/pexels-pixabay-460621.jpg'
inputmethod = fcitx5 -d
nm = nm-applet --indicator
notifications = mako -c ~/.config/mako/config
pipewire = pipewire
pipewire-pulse = pipewire-pulse
swaybg = swaybg -i /home/share/wallpaper/pexels-ray-bilcliff-2055389.jpg
waybar = waybar -c ~/.config/waybar/wf-waybar

[background-view]
command = mpv --loop=inf
file = /home/share/wallpaper/pexels-adrien-olichon-2387793.jpg

[bench]
average_frames = 1
frames_per_update = 3
position = top_center

[blur]
blur_by_default = type is "toplevel"
bokeh_degrade = 1
bokeh_iterations = 15
bokeh_offset = 5.000000
box_degrade = 1
box_iterations = 2
box_offset = 1.000000
gaussian_degrade = 1
gaussian_iterations = 2
gaussian_offset = 1.000000
kawase_degrade = 8
kawase_iterations = 2
kawase_offset = 2.000000
method = kawase
saturation = 1.000000
toggle = none

[command]
binding_a = <ctrl> <alt> KEY_A
binding_c = <ctrl> <alt> KEY_C
binding_console = <super> KEY_ENTER
binding_console2 = <ctrl><super> KEY_ENTER
binding_d = <ctrl> <alt> KEY_D
binding_f = <ctrl> <alt> KEY_F
binding_led_off = <super> KEY_F10
binding_led_on = <super> KEY_F9
binding_lock = <ctrl> <alt> KEY_L
binding_logout = <ctrl> KEY_ESC
binding_mute = KEY_MUTE | <super> KEY_F1
binding_mute_mic = KEY_MICMUTE | <super> KEY_F4
binding_n = <ctrl> <alt> KEY_N
binding_obsidian = <ctrl> <alt> KEY_O
binding_print = KEY_SYSRQ
binding_print_clipboard = <alt> KEY_SYSRQ
binding_print_edit = <ctrl> KEY_SYSRQ
binding_print_select = <shift> KEY_SYSRQ
binding_print_selectclip = <alt> <shift> KEY_SYSRQ
binding_print_selectedit = <ctrl> <shift> KEY_SYSRQ
binding_run = <super> KEY_BACKSPACE
binding_s = <ctrl> <alt> KEY_S
binding_wofi = <alt> KEY_SPACE
command_a = aria2c
command_c = firejail chromium
command_console = footclient
command_console2 = terminator
command_d = thunar /dev/shm
command_f = firefox
command_led_off = wlr-randr --output eDP-1 --off
command_led_on = wlr-randr --output eDP-1 --on
command_light_down = brightnessctl set 1%-
command_light_up = brightnessctl set +1%
command_lock = swaylock -f -c 333333 -i /opt/shared/wallpaper/pexels-pixabay-460621.jpg
command_logout = wlogout
command_mute = pamixer --source 0 -m
command_mute_mic = pamixer --source 1 -m
command_n = terminator -l pin2
command_obsidian = firejail --profile=obsidian --appimage /opt/obsidian/obsidian-1.0.0.AppImage
command_print = grim -l 9 /dev/shm/screen_$(date +"%Y%m%d%H%M%S").png
command_print_clipboard = grim -l 9 - | wl-copy
command_print_edit = grim -l 9 - | swappy -f -
command_print_select = grim -l 9 -g "$(slurp)" /dev/shm/area_$(date +"%Y%m%d%H%M%S").png
command_print_selectclip = grim -l 9 -g "$(slurp)" - | wl-copy
command_print_selectedit = grim -l 9 -g "$(slurp)" - | swappy -f -
command_run = ~/.local/bin/wayfire-run.sh
command_s = scite
command_volume_down = pamixer -ud 1
command_volume_up = pamixer -ui 1
command_wofi = wofi -S drun -l top -L 5 -W 800 -p "" -IGia --term terminator -s ~/.config/wofi.css
repeatable_binding_light_down = KEY_BRIGHTNESSDOWN | <super> KEY_F11
repeatable_binding_light_up = KEY_BRIGHTNESSUP | <super> KEY_F12
repeatable_binding_volume_down = KEY_VOLUMEDOWN | <super> KEY_F2
repeatable_binding_volume_up = KEY_VOLUMEUP | <super> KEY_F3

[core]
background_color = \#1A1A1AFF
close_top_view = <super> KEY_Q | <alt> KEY_F4
focus_button_with_modifiers = false
focus_buttons = BTN_LEFT | BTN_MIDDLE | BTN_RIGHT
focus_buttons_passthrough = true
max_render_time = -1
plugins = alpha animate autostart command cube decoration expo fast-switcher grid idle invert move oswitch resize switcher vswitch wm-actions wrot zoom scale alpha vswipe force-fullscreen wobbly place simple-tile winzoom workspace-names 
preferred_decoration_mode = client
vheight = 3
vwidth = 3
xwayland = true

[crosshair]
line_color = \#FF0000FF
line_width = 2

[cube]
activate = <alt> <ctrl> BTN_LEFT
background = \#1A1A1AFF
background_mode = simple
cubemap_image = 
deform = 0
initial_animation = 350
light = false
rotate_left = none
rotate_right = none
skydome_mirror = true
skydome_texture = 
speed_spin_horiz = 0.020000
speed_spin_vert = 0.020000
speed_zoom = 0.070000
zoom = 0.100000

[decoration]
active_color = \#222222AA
border_size = 4
button_order = minimize maximize close
font = sans-serif
ignore_views = none
inactive_color = \#333333DD
title_height = 30

[expo]
background = \#1A1A1AFF
duration = 300
offset = 10
select_workspace_1 = KEY_1
select_workspace_2 = KEY_2
select_workspace_3 = KEY_3
select_workspace_4 = KEY_4
select_workspace_5 = KEY_5
select_workspace_6 = KEY_6
select_workspace_7 = KEY_7
select_workspace_8 = KEY_8
select_workspace_9 = KEY_9
toggle = <super> 

[extra-gestures]
close_fingers = 20
move_delay = 500
move_fingers = 3

[fast-switcher]
activate = <alt> KEY_ESC
activate_backward = <alt> <shift> KEY_ESC
inactive_alpha = 0.700000

[fisheye]
radius = 450.000000
toggle = <ctrl> <super> KEY_F
zoom = 7.000000

[follow-focus]
change_output = true
change_view = true
focus_delay = 50
raise_on_top = true
threshold = 10

[force-fullscreen]
constrain_pointer = false
constraint_area = view
key_toggle_fullscreen = <alt> <super> KEY_F
preserve_aspect = true
transparent_behind_views = true
x_skew = 0.000000
y_skew = 0.000000

[grid]
duration = 300
restore = <super> KEY_DOWN | <super> KEY_KP0
slot_b = <super> KEY_2
slot_bl = <super> KEY_1
slot_br = <super> KEY_3
slot_c = <super> KEY_UP | <super> KEY_KP5
slot_l = <super> KEY_LEFT | <super> KEY_KP4
slot_r = <super> KEY_RIGHT | <super> KEY_KP6
slot_t = <super> KEY_8
slot_tl = <super> KEY_7
slot_tr = <super> KEY_9
type = crossfade

[idle]
cube_max_zoom = 1.500000
cube_rotate_speed = 1.000000
cube_zoom_speed = 1000
disable_on_fullscreen = true
dpms_timeout = -1
screensaver_timeout = 3600
toggle = none

[input]
click_method = default
cursor_size = 32
cursor_theme = DarkBolt-cursor
disable_touchpad_while_mouse = false
disable_touchpad_while_typing = false
gesture_sensitivity = 1.000000
kb_capslock_default_state = false
kb_numlock_default_state = false
kb_repeat_delay = 400
kb_repeat_rate = 40
left_handed_mode = false
middle_emulation = false
modifier_binding_timeout = 400
mouse_accel_profile = default
mouse_cursor_speed = 0.000000
mouse_scroll_speed = 1.000000
natural_scroll = false
scroll_method = default
tap_to_click = true
touchpad_accel_profile = default
touchpad_cursor_speed = 0.000000
touchpad_scroll_speed = 1.000000
xkb_layout = us
xkb_model = 
xkb_options = 
xkb_rules = evdev
xkb_variant = 

[input-device]
output = 

[invert]
preserve_hue = false
toggle = <super> KEY_I

[join-views]

[keycolor]
color = \#000000FF
opacity = 0.450000
threshold = 0.300000

[mag]
default_height = 500
toggle = <alt> <super> KEY_M
zoom_level = 75

[move]
activate = <super> BTN_LEFT
enable_snap = true
enable_snap_off = true
join_views = false
quarter_snap_threshold = 50
snap_off_threshold = 10
snap_threshold = 10
workspace_switch_after = -1

[oswitch]
next_output = <super> KEY_O
next_output_with_win = <shift> <super> KEY_O

[output]
mode = auto
position = auto
scale = 1.000000
transform = normal

[place]
mode = center

[preserve-output]
last_output_focus_timeout = 10000

[resize]
activate = <super> BTN_RIGHT

[scale]
allow_zoom = false
bg_color = \#1A1A1AE6
duration = 750
inactive_alpha = 0.750000
interact = false
middle_click_close = false
spacing = 50
text_color = \#CCCCCCFF
title_font_size = 16
title_overlay = all
title_position = center
toggle = <super> KEY_P
toggle_all = 

[scale-title-filter]
bg_color = \#00000080
case_sensitive = false
font_size = 30
overlay = true
share_filter = false
text_color = \#CCCCCCCC

[showrepaint]
reduce_flicker = true
toggle = <alt> <super> KEY_S

[simple-tile]
button_move = <super> BTN_LEFT
button_resize = <super> BTN_RIGHT
inner_gap_size = 0
keep_fullscreen_on_adjacent = true
key_focus_above = <super> KEY_K
key_focus_below = <super> KEY_J
key_focus_left = <super> KEY_H
key_focus_right = <super> KEY_L
key_toggle = <super> KEY_Z
outer_horiz_gap_size = 0
outer_vert_gap_size = 0
tile_by_default = (floating is false)

[switcher]
next_view = <alt> KEY_TAB
prev_view = <alt> <shift> KEY_TAB
speed = 500
view_thumbnail_scale = 1.000000

[vswipe]
background = \#1A1A1AFF
delta_threshold = 24.000000
duration = 180
enable_free_movement = false
enable_horizontal = true
enable_smooth_transition = false
enable_vertical = true
fingers = 4
gap = 32.000000
speed_cap = 0.050000
speed_factor = 256.000000
threshold = 0.350000

[vswitch]
background = \#1A1A1AFF
binding_down = <ctrl> <super> KEY_DOWN
binding_left = <ctrl> <super> KEY_LEFT
binding_right = <ctrl> <super> KEY_RIGHT
binding_up = <ctrl> <super> KEY_UP
binding_win_down = <ctrl> <shift> <super> KEY_DOWN
binding_win_left = <ctrl> <shift> <super> KEY_LEFT
binding_win_right = <ctrl> <shift> <super> KEY_RIGHT
binding_win_up = <ctrl> <shift> <super> KEY_UP
duration = 300
gap = 20
wraparound = false

[water]
activate = <ctrl> <super> BTN_LEFT

[window-rules]

[winzoom]
dec_x_binding = <ctrl> <super> KEY_LEFT
dec_y_binding = <ctrl> <super> KEY_UP
inc_x_binding = <ctrl> <super> KEY_RIGHT
inc_y_binding = <ctrl> <super> KEY_DOWN
modifier = <ctrl> <super> 
nearest_filtering = false
preserve_aspect = true
zoom_step = 0.100000

[wm-actions]
minimize = <super> KEY_V
send_to_back = <super> KEY_B
toggle_always_on_top = <super> KEY_T
toggle_fullscreen = <super> KEY_F
toggle_maximize = <super> KEY_M
toggle_showdesktop = <super> KEY_D
toggle_sticky = <super> KEY_S

[wobbly]
friction = 3.000000
grid_resolution = 6
spring_k = 8.000000

[workarounds]
all_dialogs_modal = true
app_id_mode = stock
dynamic_repaint_delay = false

[workspace-names]
background_color = \#333333B3
display_duration = 500
font = sans-serif
position = center
show_option_names = false
text_color = \#FFFFFFFF

[wrot]
activate = <ctrl> <super> BTN_RIGHT
activate-3d = <shift> <super> BTN_RIGHT
invert = false
reset = <ctrl> <super> KEY_R
reset-one = <super> KEY_R
reset_radius = 25.000000
sensitivity = 24

[zoom]
modifier = <super> 
smoothing_duration = 300
speed = 0.010000

and this is the ps:

shvo@magicVo ~> ps -aux |grep xdg
shvo      1571  0.0  0.0 537988 12124 ?        Sl   19:38   0:00 /usr/libexec/xdg-desktop-portal
shvo      1603  0.0  0.0 235292  5512 ?        Sl   19:38   0:00 /usr/libexec/xdg-permission-store
shvo      2428  0.0  0.0 678796 13044 ?        Sl   20:00   0:00 /usr/libexec/xdg-desktop-portal
shvo      2433  0.0  0.0 532900  6268 ?        Sl   20:00   0:00 /usr/libexec/xdg-document-portal
shvo      2437  0.0  0.0 235552  5808 ?        Sl   20:00   0:00 /usr/libexec/xdg-permission-store
shvo      2902  0.0  0.0   2412   684 tty7     S+   20:18   0:00 /usr/bin/bwrap --args 42 -- /usr/bin/xdg-dbus-proxy --args=39
shvo      2903  0.0  0.0   2540  1216 tty7     S+   20:18   0:00 /usr/bin/bwrap --args 42 -- /usr/bin/xdg-dbus-proxy --args=39
shvo      2904  0.0  0.0 161928  5900 tty7     Sl+  20:18   0:00 /usr/bin/xdg-dbus-proxy --args=39
shvo      6392  0.0  0.0   9684  2464 pts/4    S+   21:54   0:00 grep --color=auto xdg
Vladimir-csp commented 1 year ago

My uwsm might be of interest dbus session stuff should be handled on systemd/logind side in general.

superiums commented 1 year ago

yeh, it's an session stuff and should be handled by logind, i've seen uwsm, but void linux has no systemd, services was loaded by runit. does it work in this situation ?

Vladimir-csp commented 1 year ago

Then no, sorry. It relies on systemd unit mechanisms heavily.

ammen99 commented 12 months ago

Closing as stale