LazyRun v1.0.0: shortcut maker untuk executable dan PWA
- Fungsi A: shortcut dari file executable (ELF/AppImage/script) - Fungsi B: shortcut PWA/URL dengan deteksi browser (native, /opt, Flatpak) - Checkbox Menu Aplikasi / Desktop, desktop-only pakai NoDisplay=true - List + uninstall + deteksi shortcut yang file .desktop-nya hilang - Metadata ~/.config/lazyrun/shortcuts.json, refresh cache XDG/KDE - AppImage + zsync update info via build.sh
This commit is contained in:
1 parent
9cd5a1f82d
commit
da31f7d7d7
31 files changed
+2916
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package shortcut
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"lazyrun/internal/xdg"
|
||||
)
|
||||
|
||||
// RefreshCache memberi tahu desktop environment supaya .desktop baru langsung terbaca.
|
||||
// Best-effort: kalau tool tidak ada atau gagal, menu tetap refresh saat login berikutnya.
|
||||
func RefreshCache() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
|
||||
defer cancel()
|
||||
|
||||
if p, err := exec.LookPath("update-desktop-database"); err == nil {
|
||||
_ = exec.CommandContext(ctx, p, xdg.ApplicationsDir()).Run()
|
||||
}
|
||||
for _, tool := range []string{"kbuildsycoca6", "kbuildsycoca5"} {
|
||||
if p, err := exec.LookPath(tool); err == nil {
|
||||
_ = exec.CommandContext(ctx, p, "--noincremental").Run()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user