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

fix(deck): don't force scaling each time desktop loads #2166

Merged
merged 1 commit into from
Jan 21, 2025
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
47 changes: 27 additions & 20 deletions system_files/deck/shared/usr/bin/bazzite-desktop-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ IMAGE_INFO="/usr/share/ublue-os/image-info.json"
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)

if [[ "${XDG_SESSION_TYPE}" = "wayland" ]]; then
mkdir -p "$HOME/.config/bazzite/fixups" 2>/dev/null
if [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
if /usr/libexec/hwsupport/needs-left-rotation || /usr/libexec/hwsupport/needs-right-rotation; then
# Try to wait for kscreen to be ready. This was mostly a hack to try to make the below bug not happen, but I'm afraid
Expand Down Expand Up @@ -50,18 +51,21 @@ if [[ "${XDG_SESSION_TYPE}" = "wayland" ]]; then
fi

# Then try to fix the scaling
if /usr/libexec/hwsupport/needs-100-scale; then
kscreen-doctor output.eDP.scale.1 \
|| kscreen-doctor output.eDP-1.scale.1 \
|| true
elif /usr/libexec/hwsupport/needs-150-scale; then
kscreen-doctor output.eDP.scale.1.5 \
|| kscreen-doctor output.eDP-1.scale.1.5 \
|| true
elif /usr/libexec/hwsupport/needs-200-scale; then
kscreen-doctor output.eDP.scale.2 \
|| kscreen-doctor output.eDP-1.scale.2 \
|| true
if [ ! -f "$HOME/.config/bazzite/fixups/scaling_fixup" ]; then
if /usr/libexec/hwsupport/needs-100-scale; then
kscreen-doctor output.eDP.scale.1 \
|| kscreen-doctor output.eDP-1.scale.1 \
|| true
elif /usr/libexec/hwsupport/needs-150-scale; then
kscreen-doctor output.eDP.scale.1.5 \
|| kscreen-doctor output.eDP-1.scale.1.5 \
|| true
elif /usr/libexec/hwsupport/needs-200-scale; then
kscreen-doctor output.eDP.scale.2 \
|| kscreen-doctor output.eDP-1.scale.2 \
|| true
fi
touch "$HOME/.config/bazzite/fixups/scaling_fixup"
fi
fi

Expand All @@ -77,14 +81,17 @@ if [[ "${XDG_SESSION_TYPE}" = "wayland" ]]; then
fi
elif [[ $BASE_IMAGE_NAME =~ "silverblue" ]]; then
# Set scale on GNOME desktops, rotation tends to work without issue.
if /usr/libexec/hwsupport/needs-100-scale; then
gnome-randr modify eDP --scale 1 \
|| gnome-randr modify eDP-1 --scale 1 \
|| true
elif /usr/libexec/hwsupport/needs-200-scale; then
gnome-randr modify eDP --scale 2 \
|| gnome-randr modify eDP-1 --scale 2 \
|| true
if [ ! -f "$HOME/.config/bazzite/fixups/scaling_fixup" ]; then
if /usr/libexec/hwsupport/needs-100-scale; then
gnome-randr modify eDP --scale 1 \
|| gnome-randr modify eDP-1 --scale 1 \
|| true
elif /usr/libexec/hwsupport/needs-200-scale; then
gnome-randr modify eDP --scale 2 \
|| gnome-randr modify eDP-1 --scale 2 \
|| true
fi
touch "$HOME/.config/bazzite/fixups/scaling_fixup"
fi
fi
fi
Loading