Skip to content

Commit

Permalink
feat: Add option to ujust to control background transparency of the P…
Browse files Browse the repository at this point in the history
…tyxis terminal
  • Loading branch information
KyleGospo committed Apr 21, 2024
1 parent 94334a0 commit 0767471
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,20 @@ setup-decky ACTION="":
echo 'Please install Decky Loader by running "ujust setup-decky install" first.'
fi
fi

# Ptyxis terminal transparency
ptyxis-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.Ptyxis 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.Ptyxis.Profile:/org/gnome/Ptyxis/Profiles/${i}/"
gsettings set "${location}" opacity "{{ opacity }}"; done
printf "Ptyxis opacity is now %s.\n" "{{ opacity }}"
else
printf "Value must be between 0 and 1: %s.\n" "{{ opacity }}"
fi

0 comments on commit 0767471

Please sign in to comment.