Skip to content

fails to acquire lock if WAYLAND_DISPLAY contains a / #188

@uninsane

Description

@uninsane
$ slurp
failed to open lock file
$ XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR/$(dirname $WAYLAND_DISPLAY) WAYLAND_DISPLAY=$(basename $WAYLAND_DISPLAY) slurp
# (works)

relevant environment:

$ env | egrep 'WAY|XDG_'
SWAYSOCK=/run/user/colin/sway/sway-ipc.sock
WAYLAND_DISPLAY=wl/wayland-1
XDG_CURRENT_DESKTOP=sway
XDG_DATA_DIRS=/etc/profiles/per-user/colin/share:/run/current-system/sw/share
XDG_RUNTIME_DIR=/run/user/colin
XDG_SESSION_TYPE=wayland
XDG_CONFIG_DIRS=/etc/xdg:/etc/profiles/per-user/colin/etc/xdg:/run/current-system/sw/etc/xdg
XDG_CACHE_DIR=/home/colin/.cache
XDG_DESKTOP_DIR=/home/colin/.xdg/Desktop
XDG_DOCUMENTS_DIR=/home/colin/dev
XDG_DOWNLOAD_DIR=/home/colin/tmp
XDG_MUSIC_DIR=/home/colin/Music
XDG_PHOTOS_DIR=/home/colin/Pictures/Photos
XDG_PICTURES_DIR=/home/colin/Pictures
XDG_PUBLICSHARE_DIR=/home/colin/.xdg/Public
XDG_SCREENSHOTS_DIR=/home/colin/Pictures/Screenshots
XDG_TEMPLATES_DIR=/home/colin/.xdg/Templates
XDG_VIDEOS_DIR=/home/colin/Videos

particularly:

$ echo WAYLAND_DISPLAY
wl/wayland-1
$ tree $XDG_RUNTIME_DIR
/run/user/colin
├── chg
├── dbus
│   └── bus
├── keyring
│   └── control
├── pipewire
│   ├── pipewire-0
│   ├── pipewire-0.lock
│   ├── pipewire-0-manager
│   └── pipewire-0-manager.lock
├── pulse
│   ├── native
│   └── pid
├── ssh-agent
│   └── agent
├── sway
│   └── sway-ipc.sock
└── wl
    ├── slurp-wayland-1.lock
    ├── wayland-1
    └── wayland-1.lock

(that $XDG_RUNTIME_DIR/wl/slurp-wayland-1.lock file was created only as part of the 2nd slurp invocation, with XDG_RUNTIME_DIR and WAYLAND_DISPLAY modified as appropriate -- not by the bare slurp call which failed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions