feat: enable bazaar in main images (#785)
* add bazaar and krunner-bazaar to packages
* add bazaar workarounds
* add dicover-toggle recipe to ujust
* remove bazaar from beta scripts
* disable beta builds
* own install script for bazaar workarounds
* fix bazaar script
* remove beta mention from ujust recipe
* add krunner switching to ujust
* Update just/aurora-apps.just
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
* Update just/aurora-apps.just
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
* fix whitespace
* Update build_files/base/11-bazaar.sh
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
* chore: move krunner settings to proper file
* fix: add plugins sections to krunnerrc
* rename the discover-flatpak section
* chore: rename remaining discover desktop entry
02f0b2cdab
---------
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
Co-authored-by: renner <renner0@posteo.de>
This commit is contained in:
parent
6639ef477f
commit
6a9230a481
8 changed files with 144 additions and 131 deletions
6
.github/workflows/build-images.yml
vendored
6
.github/workflows/build-images.yml
vendored
|
|
@ -17,6 +17,6 @@ jobs:
|
|||
build-image-latest-hwe:
|
||||
uses: ./.github/workflows/build-image-latest-hwe.yml
|
||||
secrets: inherit
|
||||
build-image-beta:
|
||||
uses: ./.github/workflows/build-image-beta.yml
|
||||
secrets: inherit
|
||||
# build-image-beta:
|
||||
# uses: ./.github/workflows/build-image-beta.yml
|
||||
# secrets: inherit
|
||||
|
|
|
|||
|
|
@ -7,49 +7,6 @@ if ! jq -e '.["image-tag"] | test("beta")' /usr/share/ublue-os/image-info.json >
|
|||
exit 0
|
||||
fi
|
||||
|
||||
dnf5 install -y bazaar krunner-bazaar
|
||||
|
||||
# Downgrade libdex to 0.9.1 because 0.10 makes bazaar crash under VMs and PCs with low specs
|
||||
dnf5 install -y libdex-0.9.1
|
||||
|
||||
# For new users, enable Bazaar in KRunner + disable Discover results
|
||||
cat >> /usr/share/kde-settings/kde-profile/default/xdg/krunnerrc << 'EOF'
|
||||
[Plugins]
|
||||
krunner_appstreamEnabled=false
|
||||
bazaarrunnerEnabled=true
|
||||
EOF
|
||||
|
||||
if jq -e '.["image-flavor"] | test("nvidia")' /usr/share/ublue-os/image-info.json >/dev/null; then
|
||||
sed -i 's|^Exec=bazaar window --auto-service$|Exec=env GSK_RENDERER=opengl bazaar window --auto-service|' /usr/share/applications/io.github.kolunmi.Bazaar.desktop
|
||||
fi
|
||||
|
||||
# Hide Discover entries by renaming them (allows for easy re-enabling)
|
||||
discover_apps=(
|
||||
"org.kde.discover.desktop"
|
||||
"org.kde.discover-flatpak.desktop"
|
||||
"org.kde.discover.notifier.desktop"
|
||||
"org.kde.discover.urlhandler.desktop"
|
||||
)
|
||||
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "/usr/share/applications/${app}" ]; then
|
||||
mv "/usr/share/applications/${app}" "/usr/share/applications/${app}.disabled"
|
||||
fi
|
||||
done
|
||||
|
||||
# Replace discover on Panel and Kickoff with bazaar
|
||||
sed -i '/<entry name="launchers" type="StringList">/,/<\/entry>/ s/<default>[^<]*<\/default>/<default>preferred:\/\/browser,applications:org.gnome.Ptyxis.desktop,applications:io.github.kolunmi.Bazaar.desktop,preferred:\/\/filemanager<\/default>/' /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml
|
||||
sed -i '/<entry name="favorites" type="StringList">/,/<\/entry>/ s/<default>[^<]*<\/default>/<default>preferred:\/\/browser,systemsettings.desktop,org.kde.dolphin.desktop,org.kde.kate.desktop,org.gnome.Ptyxis.desktop,io.github.kolunmi.Bazaar.desktop<\/default>/' /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/config/main.xml
|
||||
|
||||
# Add beta-specific just recipes
|
||||
if [ -f "/tmp/just/aurora-beta.just" ]; then
|
||||
printf "\n\n" >> /usr/share/ublue-os/just/60-custom.just
|
||||
cat /tmp/just/aurora-beta.just >> /usr/share/ublue-os/just/60-custom.just
|
||||
fi
|
||||
|
||||
# Use Bazaar for Flatpak refs
|
||||
echo "application/vnd.flatpak.ref=io.github.kolunmi.Bazaar.desktop" >> /usr/share/applications/mimeapps.list
|
||||
|
||||
# install sudo-rs
|
||||
dnf5 -y install sudo-rs
|
||||
ln -sf /usr/bin/su-rs /usr/bin/su
|
||||
|
|
|
|||
39
build_files/base/11-bazaar.sh
Executable file
39
build_files/base/11-bazaar.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
echo "::group:: ===$(basename "$0")==="
|
||||
|
||||
set -eoux pipefail
|
||||
|
||||
### Bazaar
|
||||
echo "Installing Bazaar workarounds"
|
||||
# Downgrade libdex to 0.9.1 because 0.10 makes bazaar crash under VMs and PCs with low specs
|
||||
dnf5 install -y libdex-0.9.1
|
||||
|
||||
# Workaround for Bazaar on Nvidia systems
|
||||
if jq -e '.["image-flavor"] | test("nvidia")' /usr/share/ublue-os/image-info.json >/dev/null; then
|
||||
sed -i 's|^Exec=bazaar window --auto-service$|Exec=env GSK_RENDERER=opengl bazaar window --auto-service|' /usr/share/applications/io.github.kolunmi.Bazaar.desktop
|
||||
fi
|
||||
|
||||
# Hide Discover entries by renaming them (allows for easy re-enabling)
|
||||
discover_apps=(
|
||||
"org.kde.discover.desktop"
|
||||
"org.kde.discover.flatpak.desktop"
|
||||
"org.kde.discover.notifier.desktop"
|
||||
"org.kde.discover.urlhandler.desktop"
|
||||
)
|
||||
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "/usr/share/applications/${app}" ]; then
|
||||
mv "/usr/share/applications/${app}" "/usr/share/applications/${app}.disabled"
|
||||
fi
|
||||
done
|
||||
|
||||
# Replace discover on Panel and Kickoff with bazaar
|
||||
sed -i '/<entry name="launchers" type="StringList">/,/<\/entry>/ s/<default>[^<]*<\/default>/<default>preferred:\/\/browser,applications:org.gnome.Ptyxis.desktop,applications:io.github.kolunmi.Bazaar.desktop,preferred:\/\/filemanager<\/default>/' /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml
|
||||
sed -i '/<entry name="favorites" type="StringList">/,/<\/entry>/ s/<default>[^<]*<\/default>/<default>preferred:\/\/browser,systemsettings.desktop,org.kde.dolphin.desktop,org.kde.kate.desktop,org.gnome.Ptyxis.desktop,io.github.kolunmi.Bazaar.desktop<\/default>/' /usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/config/main.xml
|
||||
|
||||
# Symlink Discover to Bazaar
|
||||
ln -s /usr/share/applications/io.github.kolunmi.Bazaar.desktop /usr/share/applications/org.kde.discover.desktop
|
||||
|
||||
# Use Bazaar for Flatpak refs
|
||||
echo "application/vnd.flatpak.ref=io.github.kolunmi.Bazaar.desktop" >> /usr/share/applications/mimeapps.list
|
||||
|
|
@ -49,8 +49,11 @@ echo "::endgroup::"
|
|||
# Make HWE changes
|
||||
/ctx/build_files/base/09-hwe-additions.sh
|
||||
|
||||
# Bazaar workarounds
|
||||
/ctx/build_files/base/11-bazaar.sh
|
||||
|
||||
# Beta
|
||||
/ctx/build_files/base/10-beta.sh
|
||||
# /ctx/build_files/base/10-beta.sh
|
||||
|
||||
## late stage changes
|
||||
|
||||
|
|
|
|||
|
|
@ -315,3 +315,95 @@ setup-sunshine ACTION="":
|
|||
echo "Exiting without making changes."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Toggle between Bazaar and Discover software stores
|
||||
[group('Apps')]
|
||||
toggle-software-store ACTION="":
|
||||
#!/usr/bin/env bash
|
||||
source /usr/lib/ujust/ujust.sh
|
||||
|
||||
discover_apps=(
|
||||
"org.kde.discover.desktop"
|
||||
"org.kde.discover.flatpak.desktop"
|
||||
"org.kde.discover.notifier.desktop"
|
||||
"org.kde.discover.urlhandler.desktop"
|
||||
)
|
||||
|
||||
mkdir -p "$HOME/.local/share/applications"
|
||||
|
||||
discover_active=false
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "$HOME/.local/share/applications/${app}" ]; then
|
||||
discover_active=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$discover_active" = true ]; then
|
||||
CURRENT_STATE="discover"
|
||||
CURRENT_STATE_PRETTY="${blue}${b}Discover${n}"
|
||||
else
|
||||
CURRENT_STATE="bazaar"
|
||||
CURRENT_STATE_PRETTY="${green}${b}Bazaar${n}"
|
||||
fi
|
||||
|
||||
OPTION={{ ACTION }}
|
||||
if [ "$OPTION" == "help" ]; then
|
||||
echo "Usage: ujust toggle-software-store <option>"
|
||||
echo " <option>: Specify the quick option to skip the prompt"
|
||||
echo " Use 'bazaar' to enable Bazaar (hide Discover)"
|
||||
echo " Use 'discover' to enable Discover (hide Bazaar)"
|
||||
exit 0
|
||||
elif [ "$OPTION" == "" ]; then
|
||||
echo "${bold}Software Store Toggle${normal}"
|
||||
echo "Currently active: $CURRENT_STATE_PRETTY"
|
||||
if [ "$CURRENT_STATE" == "discover" ]; then
|
||||
OPTION=$(Choose "Switch to Bazaar" "Cancel")
|
||||
else
|
||||
OPTION=$(Choose "Switch to Discover" "Cancel")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${OPTION,,}" =~ ^(switch.*bazaar|bazaar) ]]; then
|
||||
echo "${green}${b}Switching to Bazaar...${n}"
|
||||
# Remove Discover files from ~/.local (hides them)
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "$HOME/.local/share/applications/${app}" ]; then
|
||||
rm "$HOME/.local/share/applications/${app}"
|
||||
fi
|
||||
done
|
||||
# Remove Bazaar override if it exists (shows Bazaar)
|
||||
if [ -f "$HOME/.local/share/applications/io.github.kolunmi.Bazaar.desktop" ]; then
|
||||
rm "$HOME/.local/share/applications/io.github.kolunmi.Bazaar.desktop"
|
||||
fi
|
||||
|
||||
# enable bazaar in krunner
|
||||
kwriteconfig6 --file krunnerrc --group Plugins --key krunner_appstreamEnabled false
|
||||
kwriteconfig6 --file krunnerrc --group Plugins --key bazaarrunnerEnabled true
|
||||
systemctl --user restart plasma-krunner.service
|
||||
|
||||
echo "${green}${b}Bazaar is now active${n}"
|
||||
|
||||
elif [[ "${OPTION,,}" =~ ^(switch.*discover|discover) ]]; then
|
||||
echo "${blue}${b}Switching to Discover...${n}"
|
||||
# Copy Discover files from /usr to ~/.local (shows them)
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "/usr/share/applications/${app}.disabled" ]; then
|
||||
cp "/usr/share/applications/${app}.disabled" "$HOME/.local/share/applications/${app}"
|
||||
fi
|
||||
done
|
||||
|
||||
# enable discover in krunner
|
||||
kwriteconfig6 --file krunnerrc --group Plugins --key krunner_appstreamEnabled true
|
||||
kwriteconfig6 --file krunnerrc --group Plugins --key bazaarrunnerEnabled false
|
||||
systemctl --user restart plasma-krunner.service
|
||||
|
||||
# Hide Bazaar by creating NoDisplay override
|
||||
cp /usr/share/applications/io.github.kolunmi.Bazaar.desktop "$HOME/.local/share/applications/io.github.kolunmi.Bazaar.desktop"
|
||||
desktop-file-edit --set-key=NoDisplay --set-value=true "$HOME/.local/share/applications/io.github.kolunmi.Bazaar.desktop"
|
||||
echo "${blue}${b}Discover is now active${n}"
|
||||
|
||||
elif [[ "${OPTION,,}" =~ ^cancel ]]; then
|
||||
echo "No changes made."
|
||||
exit 0
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
|
||||
# Toggle between Bazaar and Discover software stores (beta only)
|
||||
[group('Apps')]
|
||||
toggle-software-store ACTION="":
|
||||
#!/usr/bin/env bash
|
||||
source /usr/lib/ujust/ujust.sh
|
||||
|
||||
if ! jq -e '.["image-tag"] | test("beta")' /usr/share/ublue-os/image-info.json >/dev/null 2>&1; then
|
||||
echo "${red}${b}This feature is only available on beta images.${n}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
discover_apps=(
|
||||
"org.kde.discover.desktop"
|
||||
"org.kde.discover-flatpak.desktop"
|
||||
"org.kde.discover.notifier.desktop"
|
||||
"org.kde.discover.urlhandler.desktop"
|
||||
)
|
||||
|
||||
mkdir -p "$HOME/.local/share/applications"
|
||||
|
||||
discover_active=false
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "$HOME/.local/share/applications/${app}" ]; then
|
||||
discover_active=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$discover_active" = true ]; then
|
||||
CURRENT_STATE="discover"
|
||||
CURRENT_STATE_PRETTY="${blue}${b}Discover${n}"
|
||||
else
|
||||
CURRENT_STATE="bazaar"
|
||||
CURRENT_STATE_PRETTY="${green}${b}Bazaar${n}"
|
||||
fi
|
||||
|
||||
OPTION={{ ACTION }}
|
||||
if [ "$OPTION" == "help" ]; then
|
||||
echo "Usage: ujust toggle-software-store <option>"
|
||||
echo " <option>: Specify the quick option to skip the prompt"
|
||||
echo " Use 'bazaar' to enable Bazaar (hide Discover)"
|
||||
echo " Use 'discover' to enable Discover (hide Bazaar)"
|
||||
exit 0
|
||||
elif [ "$OPTION" == "" ]; then
|
||||
echo "${bold}Software Store Toggle${normal}"
|
||||
echo "Currently active: $CURRENT_STATE_PRETTY"
|
||||
if [ "$CURRENT_STATE" == "discover" ]; then
|
||||
OPTION=$(Choose "Switch to Bazaar" "Cancel")
|
||||
else
|
||||
OPTION=$(Choose "Switch to Discover" "Cancel")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${OPTION,,}" =~ ^(switch.*bazaar|bazaar) ]]; then
|
||||
echo "${green}${b}Switching to Bazaar...${n}"
|
||||
# Remove Discover files from ~/.local (hides them)
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "$HOME/.local/share/applications/${app}" ]; then
|
||||
rm "$HOME/.local/share/applications/${app}"
|
||||
fi
|
||||
done
|
||||
# Remove Bazaar override if it exists (shows Bazaar)
|
||||
if [ -f "$HOME/.local/share/applications/io.github.kolunmi.Bazaar.desktop" ]; then
|
||||
rm "$HOME/.local/share/applications/io.github.kolunmi.Bazaar.desktop"
|
||||
fi
|
||||
echo "${green}${b}Bazaar is now active${n}"
|
||||
|
||||
elif [[ "${OPTION,,}" =~ ^(switch.*discover|discover) ]]; then
|
||||
echo "${blue}${b}Switching to Discover...${n}"
|
||||
# Copy Discover files from /usr to ~/.local (shows them)
|
||||
for app in "${discover_apps[@]}"; do
|
||||
if [ -f "/usr/share/applications/${app}.disabled" ]; then
|
||||
cp "/usr/share/applications/${app}.disabled" "$HOME/.local/share/applications/${app}"
|
||||
fi
|
||||
done
|
||||
# Hide Bazaar by creating NoDisplay override
|
||||
echo "[Desktop Entry]\nNoDisplay=true" > "$HOME/.local/share/applications/io.github.kolunmi.Bazaar.desktop"
|
||||
echo "${blue}${b}Discover is now active${n}"
|
||||
|
||||
elif [[ "${OPTION,,}" =~ ^cancel ]]; then
|
||||
echo "No changes made."
|
||||
exit 0
|
||||
fi
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
"aurora-fastfetch",
|
||||
"aurora-schemas",
|
||||
"bash-color-prompt",
|
||||
"bazaar",
|
||||
"bcache-tools",
|
||||
"bootc",
|
||||
"borgbackup",
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
"kdeplasma-addons",
|
||||
"kdialog",
|
||||
"krb5-workstation",
|
||||
"krunner-bazaar",
|
||||
"ksystemlog",
|
||||
"libimobiledevice",
|
||||
"libsss_autofs",
|
||||
|
|
|
|||
|
|
@ -1,2 +1,6 @@
|
|||
[General]
|
||||
FreeFloating=true
|
||||
[Plugins]
|
||||
# Disable Discover, enable bazaar search results
|
||||
krunner_appstreamEnabled=false
|
||||
bazaarrunnerEnabled=true
|
||||
|
|
|
|||
Loading…
Reference in a new issue