Skip to content

Commit 8c89a1d

Browse files
Initial commit: ArchTask-Pro GUI v2.0 with Startup Tab and Polkit support
1 parent d7339ff commit 8c89a1d

37 files changed

Lines changed: 8031 additions & 0 deletions

β€Ž.gitignoreβ€Ž

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Wails Build Binaries
2+
build/bin/
3+
build/windows/
4+
build/darwin/
5+
build/linux/
6+
7+
# Go dependencies & artifacts
8+
vendor/
9+
go.sum
10+
*.exe
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Frontend dependencies & build artifacts
16+
frontend/node_modules/
17+
frontend/dist/
18+
frontend/.DS_Store
19+
20+
# IDEs & System files
21+
.vscode/
22+
.idea/
23+
*.swp
24+
*~
25+
.DS_Store

β€Ž10-archtask-pro.rulesβ€Ž

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* /usr/share/polkit-1/rules.d/10-archtask-pro.rules
3+
*
4+
* ArchTask-Pro GUI β€” Polkit Rule
5+
* ==============================
6+
* Grants members of the "wheel" group passwordless access to:
7+
* 1. cpupower β€” CPU governor switching
8+
* 2. systemctl β€” service start/stop/restart/enable/disable
9+
* 3. kill β€” terminate system processes
10+
*
11+
* Install:
12+
* sudo install -Dm644 polkit/10-archtask-pro.rules \
13+
* /usr/share/polkit-1/rules.d/10-archtask-pro.rules
14+
*
15+
* For a single user instead of wheel group, change:
16+
* subject.isInGroup("wheel")
17+
* to:
18+
* subject.user == "yourusername"
19+
*/
20+
21+
polkit.addRule(function(action, subject) {
22+
23+
// ── cpupower (CPU governor) ───────────────────────────────────────────────
24+
if (action.id === "org.freedesktop.policykit.exec") {
25+
var prog = action.lookup("program") || "";
26+
27+
if ((prog.indexOf("cpupower") !== -1) && subject.isInGroup("wheel")) {
28+
return polkit.Result.YES;
29+
}
30+
31+
// ── systemctl service management ─────────────────────────────────────
32+
if ((prog === "/usr/bin/systemctl" || prog === "/bin/systemctl") &&
33+
subject.isInGroup("wheel"))
34+
{
35+
var cmd = action.lookup("command_line") || "";
36+
var allowed = ["start", "stop", "restart", "enable", "disable"];
37+
for (var i = 0; i < allowed.length; i++) {
38+
if (cmd.indexOf("systemctl " + allowed[i]) !== -1) {
39+
return polkit.Result.YES;
40+
}
41+
}
42+
}
43+
44+
// ── kill (for system processes) ───────────────────────────────────────
45+
if ((prog === "/bin/kill" || prog === "/usr/bin/kill") &&
46+
subject.isInGroup("wheel"))
47+
{
48+
return polkit.Result.YES;
49+
}
50+
}
51+
});

β€ŽMakefileβ€Ž

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
##############################################################################
2+
## ArchTask-Pro GUI β€” Makefile (Wails v2 + React)
3+
##############################################################################
4+
5+
BINARY := archtask-pro
6+
DESTDIR ?= /usr/local/bin
7+
POLKIT_DIR := /usr/share/polkit-1/rules.d
8+
GO := go
9+
WAILS := wails
10+
11+
.PHONY: all dev build install uninstall clean polkit deps fmt help
12+
13+
##── Default: dev mode ────────────────────────────────────────────────────────
14+
all: deps dev
15+
16+
##── Install Wails CLI if missing ─────────────────────────────────────────────
17+
install-wails:
18+
@command -v wails >/dev/null 2>&1 || \
19+
$(GO) install github.com/wailsapp/wails/v2/cmd/wails@latest
20+
@echo "βœ“ Wails CLI ready"
21+
22+
##── Install all dependencies ─────────────────────────────────────────────────
23+
deps: install-wails
24+
@echo "β†’ Go dependencies…"
25+
$(GO) mod tidy
26+
@echo "β†’ Node dependencies…"
27+
cd frontend && npm install
28+
@echo "βœ“ Dependencies ready"
29+
30+
##── Dev mode: hot-reload (Go + Vite) ─────────────────────────────────────────
31+
dev:
32+
@echo "β†’ Starting dev server…"
33+
$(WAILS) dev
34+
35+
##── Production build ─────────────────────────────────────────────────────────
36+
build:
37+
@echo "β†’ Building production binary…"
38+
$(WAILS) build -clean -o $(BINARY)
39+
@echo "βœ“ Binary: ./build/bin/$(BINARY)"
40+
41+
##── Build with debug symbols ─────────────────────────────────────────────────
42+
build-debug:
43+
$(WAILS) build -debug -o $(BINARY)-debug
44+
45+
##── Install system-wide ──────────────────────────────────────────────────────
46+
install: build
47+
install -Dm755 build/bin/$(BINARY) $(DESTDIR)/$(BINARY)
48+
@echo "βœ“ Installed to $(DESTDIR)/$(BINARY)"
49+
50+
##── Install polkit rules (passwordless cpupower + systemctl) ─────────────────
51+
polkit:
52+
install -Dm644 polkit/10-archtask-pro.rules \
53+
$(POLKIT_DIR)/10-archtask-pro.rules
54+
@echo "βœ“ Polkit rule installed"
55+
56+
##── Uninstall ────────────────────────────────────────────────────────────────
57+
uninstall:
58+
rm -f $(DESTDIR)/$(BINARY)
59+
rm -f $(POLKIT_DIR)/10-archtask-pro.rules
60+
@echo "βœ“ Uninstalled"
61+
62+
##── Format Go code ───────────────────────────────────────────────────────────
63+
fmt:
64+
$(GO) fmt ./...
65+
66+
##── Clean build artifacts ────────────────────────────────────────────────────
67+
clean:
68+
rm -rf build/
69+
$(GO) clean -cache
70+
@echo "βœ“ Clean"
71+
72+
##── Help ─────────────────────────────────────────────────────────────────────
73+
help:
74+
@echo ""
75+
@echo " ArchTask-Pro GUI Build System (Wails v2)"
76+
@echo ""
77+
@echo " make deps β€” install Wails CLI + Go & Node deps"
78+
@echo " make dev β€” hot-reload dev mode"
79+
@echo " make build β€” production build"
80+
@echo " make install β€” install binary to $(DESTDIR)"
81+
@echo " make polkit β€” install polkit rule (run as root)"
82+
@echo " make uninstall β€” remove binary + polkit rule"
83+
@echo " make clean β€” remove build artifacts"
84+
@echo ""
85+
@echo " Quick start:"
86+
@echo " make deps && make dev"
87+
@echo ""
88+
@echo " Full install:"
89+
@echo " make build && make install && sudo make polkit"
90+
@echo ""

0 commit comments

Comments
Β (0)