forked from paperwm/PaperWM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.sh
executable file
·47 lines (33 loc) · 998 Bytes
/
shell.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# Simple helper script to start nested wayland/x11 gnome sessions
# The new dbus address is copied into the clipboard so you're able to run
# `M-x # gnome-shell-set-dbus-address` and paste the address.
old_display=$DISPLAY
d=0
while [ -e /tmp/.X11-unix/X${d} ]; do
d=$((d + 1))
done
NEW_DISPLAY=:$d
export XDG_CONFIG_HOME=$HOME/paperwm/.config
args=()
DISPLAY=$NEW_DISPLAY
eval $(dbus-launch --exit-with-session --sh-syntax)
echo $DBUS_SESSION_BUS_ADDRESS
echo -n $DBUS_SESSION_BUS_ADDRESS \
| DISPLAY=$old_display xclip -i -selection clipboard
DISPLAY=$old_display
case $1 in
w*|-w*|--w*)
echo "Running Wayland Gnome Shell"
args=(--nested --wayland)
;;
*)
echo "Running X11 Gnome Shell"
Xephyr $NEW_DISPLAY &
DISPLAY=$NEW_DISPLAY
args=--x11
;;
esac
dconf reset -f / # Reset settings
dconf write /org/gnome/shell/enabled-extensions "['[email protected]']"
gnome-shell $args