add bash completion to os for survey and pm commands

This commit is contained in:
Robin Olsen
2026-02-26 20:26:15 +01:00
parent dcf9fbaa50
commit e00b201a77
5 changed files with 44 additions and 14 deletions

2
.gitignore vendored
View File

@@ -10,7 +10,7 @@ node_modules/
package-lock.json package-lock.json
package.json package.json
build/survey build
# Added by goreleaser init: # Added by goreleaser init:
dist/ dist/

View File

@@ -33,22 +33,25 @@ docker-run:
docker-push: docker-push:
@docker push telikz/lazypm:latest @docker push telikz/lazypm:latest
os-build: build os-build: build completions
@cp ./bin/pm ./build/pm
@cp ./bin/survey ./build/survey @cp ./bin/survey ./build/survey
@docker build -t telikz/lazypm:os ./build @cp ./bin/survey_bash.sh ./build/survey_bash.sh
@cp ./bin/pm_bash.sh ./build/pm_bash.sh
@docker build -t telikz/lazyos ./build
@echo "Built lazyos image successfully. You can run it using 'make os-run'." @echo "Built lazyos image successfully. You can run it using 'make os-run'."
os-run: os-build os-run: os-build
@docker run -d --name=lazyos -e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC -p 3000:3000 -p 3001:3001 --shm-size="1gb" telikz/lazypm:os @docker run -d --name=lazyos -e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC -p 3000:3000 -p 3001:3001 --shm-size="1gb" telikz/lazyos
@echo "Started lazyos container successfully. You can access the web interface at http://localhost:3000." @echo "Started lazyos container successfully. You can access the web interface at http://localhost:3000."
os-stop: os-stop:
@docker stop lazyos @docker stop lazyos
@docker rm lazyos @docker rm -v --force lazyos
@echo "Stopped and removed lazyos container successfully." @echo "Stopped and removed lazyos container successfully."
os-push: os-push:
@docker push telikz/lazypm:os @docker push telikz/lazyos
start: start:
@go run ./cmd/survey start @go run ./cmd/survey start
@@ -74,8 +77,10 @@ tw: tw-install
completions: completions:
@go build -o ./bin/pm ./cmd/pm
@mkdir -p ./bin @mkdir -p ./bin
@go build -o ./bin/pm ./cmd/pm
@go build -o ./bin/survey ./cmd/survey
@./bin/survey completion bash > ./bin/survey_bash.sh
@./bin/pm completion bash > ./bin/pm_bash.sh @./bin/pm completion bash > ./bin/pm_bash.sh
@./bin/pm completion zsh > ./bin/pm_zsh.sh @./bin/pm completion zsh > ./bin/pm_zsh.sh
@./bin/pm completion fish > ./bin/pm_fish.sh @./bin/pm completion fish > ./bin/pm_fish.sh

View File

@@ -1,6 +1,11 @@
FROM lscr.io/linuxserver/webtop:latest FROM lscr.io/linuxserver/webtop:latest
RUN apk add --no-cache gcompat libc6-compat RUN apk add --no-cache exo gcompat libc6-compat bash bash-completion alacritty
COPY pm /usr/local/bin/pm
COPY pm_bash.sh /etc/bash_completion.d/pm
COPY survey_bash.sh /etc/bash_completion.d/survey
RUN chmod +x /usr/local/bin/pm
COPY survey /usr/local/bin/survey COPY survey /usr/local/bin/survey
RUN chmod +x /usr/local/bin/survey RUN chmod +x /usr/local/bin/survey

View File

@@ -5,19 +5,40 @@ echo "**** Setting up custom desktop shortcuts ****"
# Ensure the Desktop folder exists for the default 'abc' user # Ensure the Desktop folder exists for the default 'abc' user
mkdir -p /config/Desktop mkdir -p /config/Desktop
cat <<EOF > /config/Desktop/MyGoApp.desktop cat <<EOF > /config/Desktop/LazyPM.desktop
[Desktop Entry] [Desktop Entry]
Version=1.0 Version=1.0
Type=Application Type=Application
Name=PM Survey Name=PM Survey
Comment=Launch my custom Go binary Comment=Launch the Prompt Manageragment Survey
Exec=/usr/local/bin/survey start Exec=/usr/local/bin/survey start
Icon=utilities-terminal Icon=utilities-terminal
Terminal=true Terminal=true
Categories=Utility; Categories=Utility;
EOF EOF
chmod +x /config/Desktop/MyGoApp.desktop chmod +x /config/Desktop/LazyPM.desktop
chown abc:abc /config/Desktop/MyGoApp.desktop chown abc:abc /config/Desktop/LazyPM.desktop
echo "**** Setting default browser to Chromium... ****"
xdg-settings set default-web-browser chromium.desktop
echo "**** Setting default handlers for HTTP and HTTPS... ****"
xdg-mime default chromium.desktop x-scheme-handler/http
xdg-mime default chromium.desktop x-scheme-handler/https
echo "**** Setting up bash completion... ****"
source /etc/bash/bash_completion.sh
echo "Setting Alacritty as default terminal..."
mkdir -p /config/.config/xfce4
cat > /config/.config/xfce4/helpers.rc <<EOF
TerminalEmulator=alacritty.desktop
TerminalEmulatorDismissed=true
EOF
chown -R abc:abc /config/.config
echo "**** Desktop setup complete ****" echo "**** Desktop setup complete ****"

View File

@@ -43,5 +43,4 @@ func AppFromContext(ctx context.Context) *service.App {
} }
func init() { func init() {
RootCmd.CompletionOptions.DisableDefaultCmd = true
} }