Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(just): Make zeliblue-cli a toggle #170

Merged
merged 4 commits into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions config/files/shared/share/ublue-os/just/60-custom.just
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,33 @@ remove-davinci:
distrobox stop -Y davincibox
distrobox rm -Y davincibox

# Initialize Zeliblue CLI environment
# Toggle Zeliblue-CLI
zeliblue-cli ACTION="prompt":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
CURRENT_STATE="Disabled"
if systemctl --quiet --user is-active zeliblue-cli.service; then
CURRENT_STATE="Enabled"
fi
OPTION={{ ACTION }}
if [ "$OPTION" == "prompt" ]; then
echo "Zeliblue CLI is currently: ${bold}${CURRENT_STATE}${normal}"
echo "Enable or Disable Zeliblue CLI?"
OPTION=$(ugum choose Enable Disable)
elif [ "$OPTION" == "help" ]; then
echo "Usage: ujust zeliblue-cli <option>"
echo " <option>: Specify the quick option - 'enable' or 'disable'"
echo " Use 'enable' to Enable Zeliblue CLI."
echo " Use 'disable' to Disable Zeliblue CLI."
exit 0
fi
if [ "${OPTION,,}" == "enable" ]; then
just enable-zeliblue-cli
elif [ "${OPTION,,}" == "disable" ]; then
just disable-zeliblue-cli
fi

[private]
enable-zeliblue-cli:
#!/usr/bin/env bash
mkdir -p ~/.config/containers/systemd
Expand All @@ -46,14 +72,19 @@ enable-zeliblue-cli:

systemctl --user enable --now podman-auto-update.timer

# Disable Zeliblue CLI
echo "Zeliblue CLI is now enabled."

[private]
disable-zeliblue-cli:
#!/usr/bin/env bash
rm ~/.config/containers/systemd/zeliblue-cli.container

systemctl --user stop zeliblue-cli.service
rm ~/.config/containers/systemd/zeliblue-cli.container

systemctl --user disable --now podman-auto-update.timer

podman image rm ghcr.io/zelikos/zeliblue-cli:latest

systemctl --user daemon-reload

echo "Zeliblue CLI is now disabled."
Loading