This repository has been archived on 2024-06-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
omakub-custom/set-dock.sh
2024-06-17 20:53:07 +02:00

43 lines
1006 B
Bash

# Favorite apps for dock
apps=(
"firefox_firefox.desktop"
"net.waterfox.waterfox.desktop"
"google-chrome.desktop"
"doublecmd.desktop"
"Alacritty.desktop"
"code.desktop"
"typora.desktop"
"pinta_pinta.desktop"
"com.github.xournalpp.xournalpp.desktop"
"steam.desktop"
"org.gnome.Settings.desktop"
"org.gnome.Nautilus.desktop"
)
# Array to hold installed favorite apps
installed_apps=()
# Directory where .desktop files are typically stored
desktop_dirs=(
"/usr/share/applications"
"/usr/local/share/applications"
"$HOME/.local/share/applications"
)
# Check if a .desktop file exists for each app
for app in "${apps[@]}"; do
for dir in "${desktop_dirs[@]}"; do
if [ -f "$dir/$app" ]; then
installed_apps+=("$app")
break
fi
done
done
# Convert the array to a format suitable for gsettings
favorites_list=$(printf "'%s'," "${installed_apps[@]}")
favorites_list="[${favorites_list%,}]"
# Set the favorite apps
gsettings set org.gnome.shell favorite-apps "$favorites_list"