Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap: add chvt and the session wrapper #144

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions scripts/bin/core-desktop-session-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# This script runs outside of snap confinement as a wrapper around the
# confined desktop session.
snap_cmd="$1"
snap_name="$(echo "$snap_cmd" | cut -d . -f 1)"

# Set up PATH and XDG_DATA_DIRS to allow calling snaps
if [ -f /snap/snapd/current/etc/profile.d/apps-bin-path.sh ]; then
source /snap/snapd/current/etc/profile.d/apps-bin-path.sh
fi

export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export GSETTINGS_BACKEND=keyfile
export MOZ_ENABLE_WAYLAND=1

dbus-update-activation-environment --systemd --all

# Don't set this in our own environment, since it will make
# gnome-session believe it is running in X mode
dbus-update-activation-environment --systemd WAYLAND_DISPLAY=wayland-0

# Symlink the Wayland socket from the snap's private directory
ln -sf "snap.$snap_name/wayland-0" $XDG_RUNTIME_DIR/wayland-0

exec "$@"
7 changes: 7 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ parts:
prime:
- -usr/share/fonts/truetype/dejavu

chvt:
plugin: nil
stage-packages:
- kbd
prime:
- bin/chvt

graphics-core22:
after:
- ubuntu-frame
Expand Down
Loading