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: add ability to set Prompt terminal transparency with ujust #886

Merged
merged 3 commits into from
Feb 11, 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
17 changes: 17 additions & 0 deletions just/custom.just
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,23 @@ nix-devbox-global:
echo 'run "devbox global run install-hook-zsh" to configure zsh shell'
echo 'run "devbox global run" to see other available configuration commands'

# Prompt terminal transparency
prompt-transparency opacity="0.95":
#!/usr/bin/env bash
set -euxo pipefail
if [[ -n "$(echo "{{ opacity }}" | grep -v '^[.0-9]*$')" ]]; then
printf "Value must be numeric: %s.\n" "{{ opacity }}"
elif [[ $(echo "0<{{ opacity }} && 1>{{ opacity }}" | bc -q) -eq 1 ]]; then
raw="$(gsettings get org.gnome.Prompt profile-uuids)"
uuids="$(sed -En 's|[^0-9a-z]*||g; s|([0-9a-z]{32})|\1\n|gp' <<<${raw})"
for i in ${uuids}; do
location="org.gnome.Prompt.Profile:/org/gnome/Prompt/Profiles/${i}/"
gsettings set "${location}" opacity "{{ opacity }}"; done
printf "Prompt opacity is now %s.\n" "{{ opacity }}"
else
printf "Value must be between 0 and 1: %s.\n" "{{ opacity }}"
fi

# Run pytorch
pytorch:
echo 'Follow the prompts and check the tutorial: https://docs.anaconda.com/free/anaconda/jupyter-notebooks/'
Expand Down
Loading