From 98873c5f151ce88368a178894b4b13d9d132b259 Mon Sep 17 00:00:00 2001 From: David Personette Date: Sat, 10 Feb 2024 19:31:36 -0500 Subject: [PATCH] feat: add ability to set Prompt terminal transparency with ujust (#886) --- just/custom.just | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/just/custom.just b/just/custom.just index 1121cd02f34..8a57bfaa97f 100644 --- a/just/custom.just +++ b/just/custom.just @@ -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/'