Skip to content

Commit

Permalink
feat: add ability to set Prompt terminal transparency with ujust (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
dperson authored Feb 11, 2024
1 parent 922550e commit 98873c5
Showing 1 changed file with 17 additions and 0 deletions.
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

1 comment on commit 98873c5

@jtbrough
Copy link

@jtbrough jtbrough commented on 98873c5 Apr 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dperson the help text is a bit misleading (at least to me on this late evening)...

ujust wants ujust ptyxis-transparency ".95"
but the help text implies that it should be ujust ptyxis-transparency opacity="0.95"

Please sign in to comment.