vladimir-csp / uwsm Goto Github PK
View Code? Open in Web Editor NEWUniversal Wayland Session Manager
License: MIT License
Universal Wayland Session Manager
License: MIT License
XDG_CURRENT_DESKTOP ends up set to either GNOME if I was last using a GNOME session on my desktop before rebooting, or nothing at all. WAYFIRE_LOCAL_CONFIG remains unset by the tweaks function, so the unit that starts Wayfire starts it with a -c
switch, but no config path.
Potentially DE can use wayland-session
in its desktop entry for launching via a login manager/greeter.
Detect such entry seamlessly if launching it ourselves (drop argv[0] if equals self)
Entry ID is not always just a basename of desktop entry file.
Below is a diff of env variables list obtained by printenv | sort
on TTY and uwsm launched graphical session
> ALACRITTY_WINDOW_ID=0
> COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEBUGINFOD_URLS=https://debuginfod.archlinux.org | EDITOR=nano
HG=/usr/bin/hg <
HOME=/home/piroro HOME=/home/piroro
INVOCATION_ID=d256f43581ed4f6988aa33872383b931 | HYPRLAND_CMD=hyprland
> HYPRLAND_INSTANCE_SIGNATURE=03ebbe18ed8517ee22591eac82cd54322
> INVOCATION_ID=50932c37959a4d5a8ad2b8627879b261
> JOURNAL_STREAM=8:9879
LANG=ja_JP.UTF-8 LANG=ja_JP.UTF-8
LC_COLLATE=C.UTF-8 LC_COLLATE=C.UTF-8
LC_MESSAGES=C.UTF-8 LC_MESSAGES=C.UTF-8
LOGNAME=piroro LOGNAME=piroro
MAIL=/var/spool/mail/piroro MAIL=/var/spool/mail/piroro
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/system.slice/lemurs.serv | MANAGERPID=620
> MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.sli
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA= MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
MOTD_SHOWN=pam | MOZ_ENABLE_WAYLAND=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/def | NOTIFY_SOCKET=/run/user/1000/systemd/notify
> PATH=/usr/local/bin:/usr/bin
PWD=/home/piroro PWD=/home/piroro
> QT_IM_MODULE=fcitx
SHELL=/bin/bash SHELL=/bin/bash
SHLVL=1 | SHLVL=2
SYSTEMD_EXEC_PID=556 | SYSTEMD_EXEC_PID=714
TERM=linux | TERM=xterm-256color
USER=piroro USER=piroro
XDG_CACHE_HOME=/home/piroro/.cache | WAYLAND_DISPLAY=wayland-1
XDG_CONFIG_DIRS=/etc/xdg | WGPU_POWER_PREF=low
XDG_CONFIG_HOME=/home/piroro/.config | WINDOWID=0
XDG_DATA_DIRS=/usr/local/share:/usr/share | XCURSOR_SIZE=24
XDG_DATA_HOME=/home/piroro/.local/share | XDG_BACKEND=wayland
> XDG_CURRENT_DESKTOP=Hyprland
XDG_RUNTIME_DIR=/run/user/1000 XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0 | XDG_SESSION_TYPE=wayland
XDG_SESSION_CLASS=user <
XDG_SESSION_ID=c1 <
XDG_SESSION_TYPE=tty <
XDG_STATE_HOME=/home/piroro/.local/state <
XDG_VTNR=2 <
_=/usr/bin/printenv _=/usr/bin/printenv
> _JAVA_AWT_WM_NONREPARENTING=1
Env variables set by login manager (XDG_SESSION_ID
, XDG_SEAT
, etc.) and shell profile (PATH
modification) is gone. Does it needed to list every variables after uwsm finalize
?
OS: Arch
Login manager: lemurs (lemurs-git from AUR, coastalwhite/lemurs@09003a8)
Session manager: uwsm (uwsm from AUR, 0.14.0)
Compositor: Hyprland (Xwayland disabled custom build, 0.34.0)
Terminal: cosmic-term (Aracritty-based)
Option to launch apps as transient services, not scopes
The plan so far:
Build basic structure around argparse subparsers.
Use shell insert for environment preparation, keep this section of plugin support.
Scope of potential python code plugins is undecided as of yet, maybe hold off until a working prototype is released.
Cover #3 out of the box.
app
subcommand (namely proper handling of various %*
fields)
As the issue name suggests, the script automates the copy against $BIN_PREFIX instead of using the correct $EXEC_PREFIX variable.
Whenever I run uwsm -h
, I find that it floods my terminal with a lot of information. I have to fullscreen the terminal or reduce the font size in order to see all of the text.
I think it would be a good idea to move the more verbose information to manpages to make it easier to read (and reduce the cognitive load).
A couple examples on how to set this up with meson (requires #17):
I was thinking about adding doctest for a few of these functions. it's part of the standard library so won't incur an extra dependency.
Some of these functions would be hard to make sense of without some examples of input, and some testing is probably necessary as right now the only way to confirm it works is to well run it. given that some of the capabilities likely require sudo that is probably an undesirable way to discover bugs
A quick fix, but where best to put it? Environment handler or finalizer... Leaning towards the former at the moment.
From Desktop Entries: Name, GenericName, DesktopNames. How to pass them and where to put.
custom.conf
drop-ins or split into a_desktop_entry.conf
, b_custom.conf
drop-ins or something like thatAdd implementation of https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/3
The script is starting to get a bit too long for a single file. Splitting the source into multiple files would help make the code easier to understand and navigate.
The .validate()
method of xdg.DesktopEntry.DesktopEntry
performs (very) strict validation of XDG desktop files.
Because of this, many stock KDE applications, such as Dolphin, cannot be started, because they contain localized keys using an invalid locale identifier x-test
.
$ uwsm app org.kde.dolphin.desktop
Entry /usr/share/applications/org.kde.dolphin.desktop failed validation:
err: Invalid key: Keywords[x-test]
err: Invalid key: Name[x-test]
err: Invalid key: GenericName[x-test]
$ grep x-test /usr/share/applications/org.kde.dolphin.desktop
Name[x-test]=xxDolphinxx
GenericName[x-test]=xxFile Managerxx
Keywords[x-test]=xxfilesxx;xxfile managementxx;xxfile browsingxx;xxsambaxx;xxnetwork sharesxx;xxExplorerxx;xxFinderxx;
cycle through $XDG_CURRENT_DESKTOP
and load matching wayland-session-env-*
I don't know what's up with uwsm, but it started doing this error on startup checks now. How do I reach graphical target if I'm starting this from a TTY?
Arch Linux, updated as of this post.
Edit: The graphical.target service appears to require a display-manager.service to operate. What display manager am I supposed to be using with uwsm?
Restore some features of shell variant, like customization of env varnames lists via environment variables. Maybe control other things via env, like desktop names for XDG_CURRENT_DESKTOP.
I have this in my hyprland config file:
$cursor-theme = capitaine-cursors
$cursor-size = 48
env = XCURSOR_SIZE,$cursor-size
env = XCURSOR_THEME,$cursor-theme
exec = hyprctl setcursor $cursor-theme $cursor-size
exec = gsettings set org.gnome.desktop.interface cursor-theme $cursor-theme
exec = gsettings set org.gnome.desktop.interface cursor-size $cursor-size
exec = uwsm finalize XCURSOR_THEME XCURSOR_SIZE
I have corectrl set up as an autostart service, which ends up using the wrong cursor. Could it be because autostart services are started before the compositor signals readiness?
I checked the environment variables like this: cat /proc/$(pidof corectrl)/environ | tr '\0' '\n'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.