#!/bin/bash
#
## Сonfigure gala when first enters a profile
## File: /etc/xdg/autostart/org.opensuse.pantheon.gala.settings.desktop
## Package: pantheon-session-settings
#

set -e
trap "exit 0" ERR
if [ -d "$HOME/.config/dconf" ]; then
    exit $?
else
    command -V gala 1>/dev/null
fi
appLauncher() {
command -V wingpanel 1>/dev/null || return 0
gsettings list-keys io.elementary.desktop.wingpanel.applications-menu 1>/dev/null || return 0
gsettings get org.pantheon.desktop.gala.behavior panel-main-menu-action | grep -q "''" || return 0
gsettings set org.pantheon.desktop.gala.behavior panel-main-menu-action "wingpanel --toggle-indicator=app-launcher" || return 0
}
shortcutOverlay() {
command -V io.elementary.shortcut-overlay 1>/dev/null || return 0
gsettings get org.pantheon.desktop.gala.behavior overlay-action | grep -q "''" || return 0
gsettings set org.pantheon.desktop.gala.behavior overlay-action "io.elementary.shortcut-overlay" || return 0
}
appLauncher
shortcutOverlay
