Skip to content

Commit 85aefcf

Browse files
committed
Minor fixes from the desktop setup and a fix for the datacube update
1 parent a1ede1b commit 85aefcf

File tree

9 files changed

+149
-136
lines changed

9 files changed

+149
-136
lines changed

dot_files/nvim/Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
container_name := "nvim-dev"
55
local_image := "localhost/nvim-dev"
6-
remote_image := "ghcr.io/binarypie/nvim-dev:latest"
6+
remote_image := "ghcr.io/binarypie-dev/nvim-dev:latest"
77

88
# Default recipe - show help
99
default:

dot_files/quickshell/modules/sidebars/ApplicationView.qml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ ColumnLayout {
2222
// Track the query we're waiting for results from
2323
property string allAppsQueryId: ""
2424
property string searchQueryId: ""
25+
property int retryCount: 0
26+
property int maxRetries: 5
2527

2628
// Load all apps on startup
2729
Component.onCompleted: {
30+
loadAllApps()
31+
}
32+
33+
function loadAllApps() {
2834
allAppsQueryId = Services.Datacube.queryAll("", 500)
2935
}
3036

@@ -230,6 +236,8 @@ ColumnLayout {
230236

231237
function onQueryCompleted(queryId, results) {
232238
if (queryId === root.allAppsQueryId) {
239+
// Reset retry count on success
240+
root.retryCount = 0
233241
// Sort alphabetically by name
234242
results.sort((a, b) => {
235243
const nameA = (a.name || "").toLowerCase()
@@ -246,6 +254,22 @@ ColumnLayout {
246254

247255
function onQueryFailed(queryId, error) {
248256
console.log("Datacube query failed:", queryId, error)
257+
// If the allApps query failed, retry after a delay (service may have restarted)
258+
if (queryId === root.allAppsQueryId && root.retryCount < root.maxRetries) {
259+
root.retryCount++
260+
console.log("Datacube: retrying allApps query (attempt", root.retryCount, "of", root.maxRetries, ")")
261+
retryTimer.start()
262+
}
263+
}
264+
}
265+
266+
// Retry timer for failed queries (datacube service may have restarted)
267+
Timer {
268+
id: retryTimer
269+
interval: 1000 * root.retryCount // Exponential backoff: 1s, 2s, 3s, etc.
270+
repeat: false
271+
onTriggered: {
272+
root.loadAllApps()
249273
}
250274
}
251275

@@ -275,12 +299,16 @@ ColumnLayout {
275299

276300
// Check if terminal app - handle boolean or string "true"/"false"
277301
const isTerminal = metadata.terminal === true || metadata.terminal === "true"
302+
const source = app?.source || "native"
278303

279304
if (isTerminal) {
280305
// Terminal apps: launch with ghostty
281306
appLaunchProcess.command = ["ghostty", "-e", desktopId]
307+
} else if (source === "flatpak") {
308+
// Flatpak apps: use flatpak run
309+
appLaunchProcess.command = ["flatpak", "run", desktopId]
282310
} else {
283-
// GUI apps: use gtk4-launch with desktop_id
311+
// Native apps: use gtk4-launch with desktop_id
284312
appLaunchProcess.command = ["gtk4-launch", desktopId]
285313
}
286314
// Launch detached so apps survive shell restart and run independently
@@ -296,11 +324,18 @@ ColumnLayout {
296324
command: ["true"]
297325
}
298326

299-
// Reset state when sidebar closes
327+
// Handle sidebar state changes
300328
Connections {
301329
target: Root.GlobalStates
302330
function onSidebarLeftOpenChanged() {
303-
if (!Root.GlobalStates.sidebarLeftOpen) {
331+
if (Root.GlobalStates.sidebarLeftOpen) {
332+
// Refresh apps if list is empty (datacube may have restarted)
333+
if (root.allApps.length === 0) {
334+
root.retryCount = 0
335+
root.loadAllApps()
336+
}
337+
} else {
338+
// Reset state when sidebar closes
304339
searchInput.text = ""
305340
searchResults = []
306341
}

dot_files/quickshell/services/Datacube.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Singleton {
7878
exec: item.exec || "",
7979
provider: item.provider || "",
8080
score: item.score || 0,
81+
source: item.source || "native",
8182
metadata: item.metadata || {},
8283
_raw: item
8384
}

system_files/shared/etc/greetd/config.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ user = "greeter"
99

1010
[initial_session]
1111
# First boot wizard - runs once as root, then exits to show regreet
12+
# Check if regular users exist (UID >= 1000) - if so, skip wizard and remove this block
1213
# Set XDG_RUNTIME_DIR for quickshell/Qt to work properly as root
13-
command = "sh -c 'mkdir -p /run/user/0 && export XDG_RUNTIME_DIR=/run/user/0; /usr/sbin/cage -s -- /usr/sbin/quickshell -p /usr/share/hypercube/config/quickshell/welcome-mode.qml'"
14+
command = "sh -c 'if getent passwd | awk -F: \"\\$3 >= 1000 && \\$3 < 65534\" | grep -q .; then sed -i \"/^\\[initial_session\\]/,\\$d\" /etc/greetd/config.toml; exit 0; fi; mkdir -p /run/user/0 && export XDG_RUNTIME_DIR=/run/user/0; /usr/sbin/cage -s -- /usr/sbin/quickshell -p /usr/share/hypercube/config/quickshell/welcome-mode.qml'"
1415
user = "root"

system_files/shared/usr/share/ublue-os/just/60-custom.just

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# vim: set ft=make :
2+
# Hypercube general commands
3+
4+
# Show Hypercube developer environment status
5+
dx-status:
6+
#!/usr/bin/bash
7+
set -euo pipefail
8+
9+
echo "Hypercube DX Status"
10+
echo "==================="
11+
echo ""
12+
13+
echo "Container Runtimes:"
14+
echo -n " Podman: "
15+
podman --version 2>/dev/null || echo "not found"
16+
echo ""
17+
18+
echo "Distrobox Containers:"
19+
distrobox list 2>/dev/null || echo " (none)"

system_files/shared/usr/share/ublue-os/just/61-dx.just

Lines changed: 0 additions & 130 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# vim: set ft=make :
2+
# Hypercube Neovim development environment commands
3+
4+
# Enter the nvim-dev container (creates if needed)
5+
nvim-dev:
6+
#!/usr/bin/bash
7+
set -euo pipefail
8+
9+
if ! distrobox list | grep -q "nvim-dev"; then
10+
echo "Creating nvim-dev container (this pulls ~2GB image on first run)..."
11+
distrobox assemble create --file /etc/distrobox/distrobox.ini
12+
fi
13+
14+
distrobox enter nvim-dev
15+
16+
# Export nvim to host for direct access
17+
nvim-export:
18+
#!/usr/bin/bash
19+
set -euo pipefail
20+
21+
if ! distrobox list | grep -q "nvim-dev"; then
22+
echo "Creating nvim-dev container..."
23+
distrobox assemble create --file /etc/distrobox/distrobox.ini
24+
fi
25+
26+
echo "Exporting nvim to ~/.local/bin..."
27+
distrobox enter nvim-dev -- distrobox-export --bin /home/linuxbrew/.linuxbrew/bin/nvim --export-path ~/.local/bin
28+
echo ""
29+
echo "Done! You can now run 'nvim' directly from the host."
30+
31+
# Quick setup: create container + export nvim
32+
nvim-setup:
33+
#!/usr/bin/bash
34+
set -euo pipefail
35+
36+
echo "Setting up nvim-dev environment..."
37+
echo ""
38+
39+
if ! distrobox list | grep -q "nvim-dev"; then
40+
echo "Creating nvim-dev container (this pulls ~2GB image on first run)..."
41+
distrobox assemble create --file /etc/distrobox/distrobox.ini
42+
else
43+
echo "Container nvim-dev already exists"
44+
fi
45+
46+
echo ""
47+
echo "Exporting nvim to ~/.local/bin..."
48+
distrobox enter nvim-dev -- distrobox-export --bin /home/linuxbrew/.linuxbrew/bin/nvim --export-path ~/.local/bin
49+
50+
echo ""
51+
echo "Setup complete! You can now run 'nvim' directly."
52+
53+
# Upgrade nvim-dev container to latest image
54+
nvim-upgrade:
55+
#!/usr/bin/bash
56+
set -euo pipefail
57+
58+
echo "Upgrading nvim-dev to latest image..."
59+
distrobox upgrade nvim-dev
60+
echo "Done!"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Hypercube - Developer Workstation
2+
# https://github.com/binarypie-dev/hypercube
3+
4+
set allow-duplicate-recipes := true
5+
set ignore-comments := true
6+
7+
_default:
8+
#!/usr/bin/bash
9+
source /usr/lib/ujust/libformatting.sh
10+
echo "$(Urllink "https://github.com/binarypie-dev/hypercube" "Hypercube Documentation")"
11+
/usr/bin/ujust --list --list-heading $'Available commands:\n' --list-prefix $' - '
12+
13+
# =============================================================================
14+
# Upstream ublue-os commands
15+
# =============================================================================
16+
import "/usr/share/ublue-os/just/00-default.just"
17+
import "/usr/share/ublue-os/just/10-update.just"
18+
import "/usr/share/ublue-os/just/15-luks.just"
19+
import "/usr/share/ublue-os/just/20-clean.just"
20+
import "/usr/share/ublue-os/just/30-distrobox.just"
21+
import "/usr/share/ublue-os/just/40-nvidia.just"
22+
import "/usr/share/ublue-os/just/50-akmods.just"
23+
24+
# =============================================================================
25+
# Hypercube commands
26+
# =============================================================================
27+
import? "/usr/share/ublue-os/just/60-hypercube.just"
28+
import? "/usr/share/ublue-os/just/61-nvim.just"

0 commit comments

Comments
 (0)