diff --git a/system_files/shared/usr/libexec/ptyxis-add-profile.sh b/system_files/shared/usr/libexec/ptyxis-add-profile.sh deleted file mode 100755 index f682bdb7135..00000000000 --- a/system_files/shared/usr/libexec/ptyxis-add-profile.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/bash - -# Read the current value of the array -CURRENT_VALUE=$(dconf read /org/gnome/Ptyxis/profile-uuids) -guid="$1" - -# remove the leading and trailing brackets -CURRENT_VALUE=${CURRENT_VALUE:1:-1} - -# remove any spaces -CURRENT_VALUE=${CURRENT_VALUE// /} - -# split the string into an array -IFS=',' read -r -a array <<<"$CURRENT_VALUE" - -# Exit if the guid already is in the array -[[ $CURRENT_VALUE =~ $guid ]] && exit 0 - -# add the new value -array+=("'$guid'") - -# join the array back into a string -UPDATED_VALUE=$(printf "%s," "${array[@]}") - -# remove the trailing comma -UPDATED_VALUE=${UPDATED_VALUE%?} - -# add the leading and trailing brackets -UPDATED_VALUE="[$UPDATED_VALUE]" - -# Write the updated array back to dconf -dconf write /org/gnome/Ptyxis/profile-uuids "$UPDATED_VALUE" diff --git a/system_files/shared/usr/libexec/ptyxis-create-profile.sh b/system_files/shared/usr/libexec/ptyxis-create-profile.sh deleted file mode 100755 index 657b8e4e8b2..00000000000 --- a/system_files/shared/usr/libexec/ptyxis-create-profile.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/bash - -# create a Ptyxis profile using dconf given the guid of the instance -# $1 = name - -# dconf read /org/gnome/Ptyxis/Profiles/d092b3519698570a3252762c658f7629/ -# /org/gnome/Ptyxis/Profiles/d092b3519698570a3252762c658f7629/custom-command -# 'blincus shell myubuntu' -# /org/gnome/Ptyxis/Profiles/d092b3519698570a3252762c658f7629/label -# 'myubuntu' -# /org/gnome/Ptyxis/Profiles/d092b3519698570a3252762c658f7629/login-shell -# true -# /org/gnome/Ptyxis/Profiles/d092b3519698570a3252762c658f7629/use-custom-command -# true - -# shellcheck disable=SC1091 -. /usr/share/ublue-os/bluefin-cli/known-ptyxis-profiles - -# if dconf doesn't exist, just return -if ! command -v dconf >/dev/null; then - exit 0 -fi - - -# shellcheck disable=SC2001 -gen_uuid() { - uuid="$(cat /proc/sys/kernel/random/uuid)" - echo "$uuid" | sed 's/-//g' -} - -name="$1" -default="$2" -palette="$3" - -# shellcheck disable=2154 -for check in "${!known_profile[@]}"; do - if test "$check" = "$name"; then - guid=${known_profile[$check]} - fi -done - -if test -z "$guid"; then - guid=$(gen_uuid) -fi - -default_guid=$(dconf read /org/gnome/Ptyxis/default-profile-uuid) -default_guid=${default_guid:1:-1} - -# If default profile is trying to be made, just exit -if test "$guid" = "$default_guid"; then - exit 0 -fi - -if test -z "$default"; then - make_default=0 -elif test "$default" = "default" || test "$default" -eq 1; then - make_default=1 -fi - -# Write the default value if specified -if test "$make_default" -eq 1; then - dconf write /org/gnome/Ptyxis/default-profile-uuid "'${guid}'" -fi - -profile="/org/gnome/Ptyxis/Profiles/${guid}/" -opacity=$(dconf read /org/gnome/Ptyxis/Profiles/"${default_guid}"/opacity) - -if test "$name" = "Host"; then - dconf write "${profile}label" "'${name}'" -fi - -if test -n "$opacity"; then - dconf write "${profile}opacity" "'${opacity}'" -fi - -if test -n "$palette"; then - dconf write "${profile}palette" "'${palette}'" -fi - -/usr/libexec/ptyxis-add-profile.sh "$guid" diff --git a/system_files/shared/usr/libexec/ptyxis-remove-profile.sh b/system_files/shared/usr/libexec/ptyxis-remove-profile.sh deleted file mode 100755 index 77059c2637f..00000000000 --- a/system_files/shared/usr/libexec/ptyxis-remove-profile.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/bash -# ensure that the ptyxis profiles for deleted instances are removed - -# if dconf doesn't exist, just return -if ! command -v dconf >/dev/null; then - return -fi - -# Cleanup any stale profiles -for i in $(dconf list /org/gnome/Ptyxis/Profiles/); do - i=${i:0:-1} - [[ $(dconf read /org/gnome/Ptyxis/profile-uuids) =~ $i ]] || dconf reset -f "/org/gnome/Ptyxis/Profiles/${i}/" -done - -name="$1" - -# Read the current value of the array -CURRENT_VALUE=$(dconf read /org/gnome/Ptyxis/profile-uuids) - -# remove the leading and trailing brackets -CURRENT_VALUE=${CURRENT_VALUE:1:-1} - -# remove any spaces -CURRENT_VALUE=${CURRENT_VALUE// /} - -# split the string into an array -IFS=',' read -r -a array <<<"$CURRENT_VALUE" - -# Get Default -DEFAULT_VALUE=$(dconf read /org/gnome/Ptyxis/default-profile-uuid) - -# loop through the array and remove any that don't exist -for i in "${!array[@]}"; do - guid=${array[i]} - - # remove single quotes from guid - guid=${guid//\'/} - - #echo "Checking profile for $(red $guid)" - profile="/org/gnome/Ptyxis/Profiles/${guid}/" - - ublue_os=$(dconf read "${profile}ublue-os") - label=$(dconf read "${profile}label") - label=${label:1:-1} - - if test "$ublue_os" = "true"; then - # Don't delete the profile if it's the default or if it's enabled - if ! test "$DEFAULT_VALUE" = "$guid" && test "$name" = "$label" && ! systemctl --user --quiet is-enabled "${name}".target; then - dconf reset -f "${profile}" - # remove the guid from the array - unset 'array[i]' - # join the array back into a string - UPDATED_VALUE=$(printf "%s," "${array[@]}") - - # remove the trailing comma - UPDATED_VALUE=${UPDATED_VALUE%?} - - # add the leading and trailing brackets - UPDATED_VALUE="[$UPDATED_VALUE]" - - # Write the updated array back to dconf - dconf write /org/gnome/Ptyxis/profile-uuids "$UPDATED_VALUE" - fi - fi -done diff --git a/system_files/shared/usr/share/ublue-os/bluefin-cli/known-ptyxis-profiles b/system_files/shared/usr/share/ublue-os/bluefin-cli/known-ptyxis-profiles deleted file mode 100644 index f49e2a99d0c..00000000000 --- a/system_files/shared/usr/share/ublue-os/bluefin-cli/known-ptyxis-profiles +++ /dev/null @@ -1,7 +0,0 @@ -# shellcheck shell=bash -declare -Ar known_profile=( - ["Host"]="2871e8027773ae74d6c87a5f659bbc74" -) -declare -Ar known_guid=( - ["2871e8027773ae74d6c87a5f659bbc74"]="Host" -) diff --git a/system_files/silverblue/etc/dconf/db/distro.d/02-bluefin-keybindings b/system_files/silverblue/etc/dconf/db/distro.d/02-bluefin-keybindings index e2bdebcab25..04f505c5227 100644 --- a/system_files/silverblue/etc/dconf/db/distro.d/02-bluefin-keybindings +++ b/system_files/silverblue/etc/dconf/db/distro.d/02-bluefin-keybindings @@ -3,12 +3,12 @@ [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0] binding='t' -command='/usr/bin/ptyxis --tab-with-profile="2871e8027773ae74d6c87a5f659bbc74" --new-window' +command='/usr/bin/ptyxis --new-window' name='Ptyxis' [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1] binding='Return' -command='/usr/bin/ptyxis --tab-with-profile="2871e8027773ae74d6c87a5f659bbc74" --new-window' +command='/usr/bin/ptyxis --new-window' name='Ptyxis Alt' [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2]