Skip to content

Commit 685dd2c

Browse files
author
MochiOS Team
committed
fix: repo.yml symlink replacement (was missing), polkit rule, discover nuke, mochi beat flatpak, steam CUSTOM_EXTRAS
1 parent f5574b3 commit 685dd2c

10 files changed

Lines changed: 79 additions & 19 deletions

File tree

‎.github/workflows/build-iso.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ jobs:
191191
env:
192192
GH_TOKEN: ${{ github.token }}
193193
GH_REPO: ${{ github.repository }}
194-
RELEASE_TAG: stable
195-
RELEASE_TITLE: MochiOS
194+
RELEASE_TAG: ${{ github.ref_name }}
195+
RELEASE_TITLE: MochiOS ${{ github.ref_name }}
196196
run: |
197197
cd /tmp/iso
198198
iso=$(ls *.iso 2>/dev/null | head -1)

‎.github/workflows/repo.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
- "mochi_ascii.py"
1414
- "build.sh"
1515
- "scripts/**"
16+
- ".github/workflows/repo.yml"
17+
- ".github/workflows/build-iso.yml"
1618
branches: [main]
1719
workflow_dispatch:
1820

@@ -92,6 +94,18 @@ jobs:
9294
done
9395
repo-add --sign mochi.db.tar.zst *.pkg.tar.zst
9496
97+
- name: Replace symlinks with real files
98+
run: |
99+
cd /repo/os/x86_64
100+
for f in mochi.db mochi.files; do
101+
if [ -L "$f" ]; then
102+
real="${f}.tar.zst"
103+
rm -f "$f" "${f}.sig"
104+
cp "$real" "$f"
105+
[ -f "${real}.sig" ] && cp "${real}.sig" "${f}.sig"
106+
fi
107+
done
108+
95109
- name: Static binary
96110
run: |
97111
mkdir -p /repo/static /tmp/mochi-extract
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
polkit.addRule(function(action, subject) {
2+
if (action.id == "org.freedesktop.policykit.exec" &&
3+
action.lookup("program") == "/usr/local/bin/mochiinstall") {
4+
return polkit.Result.YES;
5+
}
6+
});

‎archiso-mochios/airootfs/etc/xdg/autostart/mochiinstall.desktop‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Type=Application
33
Name=MochiOS Installer
44
Comment=Install MochiOS to your system
5-
Exec=mochiinstall
5+
Exec=sudo -E /usr/local/bin/mochiinstall
66
Icon=system-software-install
77
Terminal=false
88
Categories=System;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=Nuke Discover
4+
Comment=Remove discover from the taskbar after plasma loads
5+
Exec=/usr/lib/mochiinstall/nuke-discover.sh
6+
Terminal=false
7+
X-KDE-Authorize=true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
# run before plasma starts — nuke discover
3+
sudo pacman -Rdd discover --noconfirm 2>/dev/null || true

‎archiso-mochios/airootfs/home/mochi/.zshrc‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ if [ -z "$MOCHI_LIVE_INIT" ]; then
88
reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist &>/dev/null &
99
fi
1010

11-
# early cleanup of discover
12-
rm -f "$HOME/Desktop/org.kde.discover.desktop" \
13-
"$HOME/Desktop/discover.desktop" \
14-
"/usr/share/applications/org.kde.discover.desktop" 2>/dev/null
15-
# autostart script nuke-discover handles the taskbar after plasma loads
11+
# ensure discover is gone
12+
pkill -x discover 2>/dev/null || true
13+
sudo pacman -Rdd discover --noconfirm 2>/dev/null || true
14+
15+
# disable kde launch confirmation globally
16+
mkdir -p "$HOME/.config"
17+
cat > "$HOME/.config/klaunchrc" << 'EOF'
18+
[General]
19+
ConfirmLaunch=false
20+
EOF
1621

1722
echo "the installer should open shortly..."
1823

19-
# if we're in a tty (no kde), launch installer directly
24+
# always launch installer (kde autostart is a fallback)
2025
if [ -z "$XDG_CURRENT_DESKTOP" ] && [ -z "$KDE_FULL_SESSION" ]; then
2126
sleep 2
22-
mochiinstall
27+
sudo -E mochiinstall
2328
fi
2429
fi
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env bash
2-
# wait for plasma config, then strip discover from the taskbar
2+
33
PBC="$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc"
4-
for i in $(seq 1 30); do
4+
for i in $(seq 1 15); do
55
if [ -f "$PBC" ]; then
6-
sed -i '/[Dd]iscover/d' "$PBC" 2>/dev/null
6+
sed -i '/discover/Id' "$PBC" 2>/dev/null
77
sed -i 's/,[[:space:]]*org\.kde\.discover[^,]*//g; s/org\.kde\.discover[^,]*,[[:space:]]*//g; s/org\.kde\.discover[^,]*//g' "$PBC" 2>/dev/null
8-
for cfg in "$HOME"/.config/plasma* "$HOME"/.config/kde*; do
9-
[ -f "$cfg" ] && sed -i '/[Dd]iscover/d' "$cfg" 2>/dev/null
10-
done
118
break
129
fi
1310
sleep 1
1411
done
12+
for cfg in "$HOME/.config/plasma"* "$HOME/.config/kde"*; do
13+
[ -f "$cfg" ] && sed -i '/discover/Id' "$cfg" 2>/dev/null
14+
done
15+
pkill -x discover 2>/dev/null || true

‎installer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import time
88
from pathlib import Path
99

10-
CUSTOM_EXTRAS = set()
10+
CUSTOM_EXTRAS = {"steam"}
1111

1212
_TOTAL_STEPS = 60
1313
_STEP_COUNT = [0]

‎mochi/cmd/beat.go‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,22 @@ func beat(args []string) error {
5353
return nil
5454
}
5555

56+
pacmanPkgs := []string{}
5657
for _, pkg := range args {
57-
fmt.Printf("beating %s...\n", pkg)
58+
if id, ok := knownPackages[strings.ToLower(pkg)]; ok {
59+
fmt.Printf("beating %s via flatpak...\n", pkg)
60+
err := runFlatpak(id)
61+
if err != nil {
62+
return err
63+
}
64+
} else {
65+
pacmanPkgs = append(pacmanPkgs, pkg)
66+
}
67+
}
68+
if len(pacmanPkgs) > 0 {
69+
return runPacman(append([]string{"-S", "--needed"}, pacmanPkgs...)...)
5870
}
59-
return runPacman(append([]string{"-S", "--needed"}, args...)...)
71+
return nil
6072
}
6173

6274
func beatWinget(pkg string) error {
@@ -75,6 +87,18 @@ func beatWinget(pkg string) error {
7587
return runWinget("install", "--id", "--exact", "--disable-interactivity", "--accept-package-agreements", "--accept-source-agreements", id)
7688
}
7789

90+
func runFlatpak(id string) error {
91+
// ensure flathub remote exists
92+
exec.Command("flatpak", "remote-add", "--if-not-exists", "flathub", "https://flathub.org/repo/flathub.flatpakrepo").Run()
93+
c := exec.Command("flatpak", "install", "-y", "flathub", id)
94+
out, err := c.CombinedOutput()
95+
if err != nil {
96+
return fmt.Errorf("flatpak install %s failed: %w\n%s", id, err, string(out))
97+
}
98+
fmt.Print(string(out))
99+
return nil
100+
}
101+
78102
func resolvePackage(query string) (string, error) {
79103
c := exec.Command("winget", "search", "--accept-source-agreements", query)
80104
var outBuf bytes.Buffer

0 commit comments

Comments
 (0)