diff --git a/rootfs/cloud9/configure_desktop.sh b/rootfs/cloud9/configure_desktop.sh new file mode 100644 index 0000000..42d26d5 --- /dev/null +++ b/rootfs/cloud9/configure_desktop.sh @@ -0,0 +1,65 @@ +# Check when DBUS is active and start configuring. + +echo "Wait for dbus to start." +until PID=$(pgrep xfce4-session); do + echo "Rechecking dbus" + sleep 1 +done + +echo "DBUS PID: $PID" +sleep 5 + +DBUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) +echo "DBUS Session Address: $DBUS_ADDRESS" +echo "$DBUS_ADDRESS" > /var/log/dbus.txt +export DBUS_SESSION_BUS_ADDRESS +export DISPLAY=:1.0 + +# Hide Lower Panel, Temp Removal +su $USER -c "xfconf-query -c xfce4-panel -p /panels -t int -s 1 -a" + +# Set branding +if [ -n "$MENU_NAME" ]; then + su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/button-title -t string -s '$MENU_NAME'" +fi +if [ -n "$MENU_ICON" ]; then + su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/button-icon -t string -s '$MENU_ICON'" +fi + +# Set menu icons +if [ -n "$SHOW_MENU_ICONS" ]; then + su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/show-menu-icons -t bool -s '$SHOW_MENU_ICONS'" +fi + +# Set tooltips +if [ -n "$SHOW_TOOLTIPS" ]; then + su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/show-tooltips -t bool -s '$SHOW_TOOLTIPS'" +fi + +# Set menu icons +if [ -n "$SHOW_GENERIC_NAMES" ]; then + su $USER -c "xfconf-query -c xfce4-panel -np /plugins/plugin-1/show-generic-names -t bool -s '$SHOW_GENERIC_NAMES'" +fi + +# Remove plugins +su $USER -c " + # Copy Existing Array + ARRAY=(); + for ID in \$(xfconf-query -c xfce4-panel -p /panels/panel-1/plugin-ids | tail -n +3); do ARRAY+=( \$ID ); done; + + # For loops to remove item from array + for PLUGIN_NAME in actions pager; do + PLUGIN=\$(xfconf-query -c xfce4-panel -p /plugins -lv | grep \$PLUGIN_NAME | awk '{print \$1}') + DELETE=\$(echo \$PLUGIN | sed 's/.*plugin-//g') + ARRAY=( \${ARRAY[@]/\$DELETE} ) + done; + + # Update Panel Plugin Array + UPDATE_PANEL_PLUGINS='xfconf-query -c xfce4-panel -p /panels/panel-1/plugin-ids' + for INT in \${ARRAY[@]}; do + UPDATE_PANEL_PLUGINS+=\" -t int -s \$INT\" + done + \$UPDATE_PANEL_PLUGINS +" +# Reload Panel +su $USER -c "xfce4-panel -r"