add hypr / sway startup script
This commit is contained in:
parent
c6ce0dd503
commit
f69fcdf744
28
root/usr/local/bin/hypr.sh
Executable file
28
root/usr/local/bin/hypr.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
export XDG_CURRENT_DESKTOP=Hyprland # xdg-desktop-portal
|
||||
export XDG_SESSION_DESKTOP=Hyprland # systemd
|
||||
export XDG_SESSION_TYPE=wayland # xdg/systemd
|
||||
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
# without this, systemd starts xdg-desktop-portal without these environment variables,
|
||||
# and the xdg-desktop-portal does not start xdg-desktop-portal-wrl as expected
|
||||
# https://github.com/emersion/xdg-desktop-portal-wlr/issues/39#issuecomment-638752975
|
||||
systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
|
||||
# use systemd-run here, because systemd units inherit variables from ~/.config/environment.d
|
||||
# shellcheck disable=SC2068
|
||||
systemd-run --quiet --unit=hypr --user --wait Hyprland $@
|
||||
systemctl --user stop hypr-session.target
|
||||
|
||||
# this teardown makes it easier to switch between compositors
|
||||
unset DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
systemctl --user unset-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
|
28
root/usr/local/bin/sway.sh
Executable file
28
root/usr/local/bin/sway.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
export XDG_CURRENT_DESKTOP=sway # xdg-desktop-portal
|
||||
export XDG_SESSION_DESKTOP=sway # systemd
|
||||
export XDG_SESSION_TYPE=wayland # xdg/systemd
|
||||
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
# without this, systemd starts xdg-desktop-portal without these environment variables,
|
||||
# and the xdg-desktop-portal does not start xdg-desktop-portal-wrl as expected
|
||||
# https://github.com/emersion/xdg-desktop-portal-wlr/issues/39#issuecomment-638752975
|
||||
systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
|
||||
# use systemd-run here, because systemd units inherit variables from ~/.config/environment.d
|
||||
# shellcheck disable=SC2068
|
||||
systemd-run --quiet --unit=sway --user --wait sway $@
|
||||
systemctl --user stop sway-session.target
|
||||
|
||||
# this teardown makes it easier to switch between compositors
|
||||
unset DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
systemctl --user unset-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user