-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathxfce.sh
executable file
·44 lines (38 loc) · 1.67 KB
/
xfce.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
# Remove any preconfigured monitors
if [[ -f "${HOME}/.config/monitors.xml" ]]; then
mv "${HOME}/.config/monitors.xml" "${HOME}/.config/monitors.xml.bak"
fi
# Copy over default panel if doesn't exist, otherwise it will prompt the user
PANEL_CONFIG="${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml"
if [[ ! -e "${PANEL_CONFIG}" ]]; then
mkdir -p "$(dirname "${PANEL_CONFIG}")"
cp "${EPREFIX}/etc/xdg/xfce4/panel/default.xml" "${PANEL_CONFIG}"
fi
# Disable startup services
xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false
# Disable useless services on autostart
AUTOSTART="${HOME}/.config/autostart"
rm -fr "${AUTOSTART}" # clean up previous autostarts
mkdir -p "${AUTOSTART}"
for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"; do
echo -e "[Desktop Entry]\nHidden=true" > "${AUTOSTART}/${service}.desktop"
done
# Run Xfce4 Terminal as login shell (sets proper TERM)
TERM_CONFIG="${HOME}/.config/xfce4/terminal/terminalrc"
if [[ ! -e "${TERM_CONFIG}" ]]; then
mkdir -p "$(dirname "${TERM_CONFIG}")"
sed 's/^ \{4\}//' > "${TERM_CONFIG}" << EOL
[Configuration]
CommandLoginShell=TRUE
EOL
else
sed -i \
'/^CommandLoginShell=/{h;s/=.*/=TRUE/};${x;/^$/{s//CommandLoginShell=TRUE/;H};x}' \
"${TERM_CONFIG}"
fi
# launch dbus first through eval becuase it can conflict with a conda environment
# see https://github.com/OSC/ondemand/issues/700
eval $(dbus-launch --sh-syntax)
# Start up xfce desktop (block until user logs out of desktop)
startxfce4