add bash completion to os for survey and pm commands
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -10,7 +10,7 @@ node_modules/
|
||||
package-lock.json
|
||||
package.json
|
||||
|
||||
build/survey
|
||||
build
|
||||
|
||||
# Added by goreleaser init:
|
||||
dist/
|
||||
|
||||
17
Makefile
17
Makefile
@@ -33,22 +33,25 @@ docker-run:
|
||||
docker-push:
|
||||
@docker push telikz/lazypm:latest
|
||||
|
||||
os-build: build
|
||||
os-build: build completions
|
||||
@cp ./bin/pm ./build/pm
|
||||
@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'."
|
||||
|
||||
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."
|
||||
|
||||
os-stop:
|
||||
@docker stop lazyos
|
||||
@docker rm lazyos
|
||||
@docker rm -v --force lazyos
|
||||
@echo "Stopped and removed lazyos container successfully."
|
||||
|
||||
os-push:
|
||||
@docker push telikz/lazypm:os
|
||||
@docker push telikz/lazyos
|
||||
|
||||
start:
|
||||
@go run ./cmd/survey start
|
||||
@@ -74,8 +77,10 @@ tw: tw-install
|
||||
|
||||
|
||||
completions:
|
||||
@go build -o ./bin/pm ./cmd/pm
|
||||
@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 zsh > ./bin/pm_zsh.sh
|
||||
@./bin/pm completion fish > ./bin/pm_fish.sh
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
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
|
||||
RUN chmod +x /usr/local/bin/survey
|
||||
|
||||
@@ -5,19 +5,40 @@ echo "**** Setting up custom desktop shortcuts ****"
|
||||
# Ensure the Desktop folder exists for the default 'abc' user
|
||||
mkdir -p /config/Desktop
|
||||
|
||||
cat <<EOF > /config/Desktop/MyGoApp.desktop
|
||||
cat <<EOF > /config/Desktop/LazyPM.desktop
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=PM Survey
|
||||
Comment=Launch my custom Go binary
|
||||
Comment=Launch the Prompt Manageragment Survey
|
||||
Exec=/usr/local/bin/survey start
|
||||
Icon=utilities-terminal
|
||||
Terminal=true
|
||||
Categories=Utility;
|
||||
EOF
|
||||
|
||||
chmod +x /config/Desktop/MyGoApp.desktop
|
||||
chown abc:abc /config/Desktop/MyGoApp.desktop
|
||||
chmod +x /config/Desktop/LazyPM.desktop
|
||||
chown abc:abc /config/Desktop/LazyPM.desktop
|
||||
|
||||
echo "**** Desktop setup complete ****"
|
||||
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 ****"
|
||||
@@ -43,5 +43,4 @@ func AppFromContext(ctx context.Context) *service.App {
|
||||
}
|
||||
|
||||
func init() {
|
||||
RootCmd.CompletionOptions.DisableDefaultCmd = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user