Skip to content

Commit

Permalink
stage ujust changes from pr
Browse files Browse the repository at this point in the history
  • Loading branch information
b- committed Oct 13, 2023
1 parent 9cab833 commit 3dfcb97
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 16 deletions.
17 changes: 1 addition & 16 deletions just/custom.just
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# vim: set ft=make :

uid := `id -u`

# Run a one minute system benchmark
benchmark:
echo 'Running a 1 minute benchmark ...'
Expand Down Expand Up @@ -56,19 +54,6 @@ brew-shell:
echo 'eval "$(/var/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.bash_profile
fi

# Change the user's shell
chsh shell:
#!/usr/bin/env bash
set -euo pipefail
CURRENT_SHELL="$(cat /etc/passwd | grep ":{{uid}}:" | cut '-d:' '-f7')"
if [ "{{shell}}" = "${CURRENT_SHELL}" ] ; then
printf "Your shell is already set to %s.\n" "${CURRENT_SHELL}"
else
sudo usermod $USER --shell "{{shell}}"
CURRENT_SHELL="$(cat /etc/passwd | grep ":{{uid}}:" | cut '-d:' '-f7')"
printf "%s's shell is now %s.\n" "$USER" "${CURRENT_SHELL}"
fi

# Enable Cockpit for web-based system management | https://cockpit-project.org/
cockpit:
echo 'Enabling Cockpit'
Expand Down Expand Up @@ -126,7 +111,7 @@ distrobox-universal:

# Switch to the fish shell
fish:
just --unstable --justfile {{justfile()}} chsh /usr/bin/fish
ujust chsh /usr/bin/fish

# Install recommended GNOME extensions
gnome-extensions:
Expand Down
44 changes: 44 additions & 0 deletions usr/share/ublue-os/just/00-default.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# vim: set ft=make :

set allow-duplicate-recipes
set ignore-comments

_default:
@just --unstable --list --list-heading $'Available commands:\n' --list-prefix $' - '

# Boot into this device's BIOS/UEFI screen
bios:
systemctl reboot --firmware-setup

# Change the user's shell
chsh new_shell:
#!/usr/bin/env bash
set -euo pipefail
if [ "{{shell}}" = "{{new_shell}}" ] ; then
printf "Your shell is already set to %s.\n" "{{new_shell}}"
else
if [ -x "{{new_shell}}" ] ; then
sudo usermod $USER --shell "{{new_shell}}"
printf "%s's shell is now %s.\n" "$USER" "{{new_shell}}"
else
echo "{{new_shell}} does not exist or is not executable!"
fi
fi

# Regenerate GRUB config, useful in dual-boot scenarios where a second operating system isn't listed
regenerate-grub:
#!/usr/bin/env bash
if [ -d /sys/firmware/efi ]; then
sudo grub2-mkconfig -o /etc/grub2-efi.cfg
else
sudo grub2-mkconfig -o /etc/grub2.cfg
fi

# Show the changelog
changelogs:
rpm-ostree db diff --changelogs

# Enroll Nvidia driver & KMOD signing key for secure boot - Enter password "ublue-os" if prompted
enroll-secure-boot-key:
sudo mokutil --import /etc/pki/akmods/certs/akmods-ublue.der
echo 'Enter password "ublue-os" if prompted'

0 comments on commit 3dfcb97

Please sign in to comment.