Skip to content

Commit

Permalink
feat(gnome): Use auto-power-profile extension with customizations fro…
Browse files Browse the repository at this point in the history
…m Universal Blue
  • Loading branch information
KyleGospo committed May 10, 2024
1 parent 8082434 commit 45f533e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
gnome-shell-extension-bazzite-menu \
gnome-shell-extension-hotedge \
gnome-shell-extension-caffeine \
gnome-shell-extension-power-profile-switcher \
gnome-shell-extension-auto-power-profile \
rom-properties-gtk3 \
openssh-askpass && \
rpm-ostree override remove \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,19 @@ restore-gnome-de-settings:
# Restore Bazzite customized applications folders
restore-gnome-folders:
dconf load / < /usr/etc/dconf/db/local.d/04-bazzite-folders

# Change automatic power profile switching behavior
configure-auto-power-profile ACTION="help":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-auto-power-profile <option>"
echo " Use 'enable' to allow automatic power profile switching based on power state
echo " Use 'disable' to prevent automatic power profile switching based on power state
exit 0
if [[ "${OPTION,,}" =~ enable ]]; then
gnome-extensions enable [email protected]
elif [[ "${OPTION,,}" =~ disable ]]; then
gnome-extensions disable [email protected]
fi
9 changes: 3 additions & 6 deletions system_files/desktop/shared/usr/libexec/bazzite-user-setup
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/bash

if [ "${EUID:-$(id -u)}" -eq 0 ]; then
echo "Bazzite user setup ran as root user. Exiting."
exit 0
elif [ "$(whoami)" = "sddm" ]; then
echo "Bazzite user setup ran as sddm user. Exiting."
if [ "${EUID:-$(id -u)}" -lt 1000 ]; then
echo "Bazzite user setup ran as unsupported user. Exiting."
exit 0
fi

Expand Down Expand Up @@ -112,7 +109,7 @@ else
if [[ ":Framework:" =~ ":$VEN_ID:" ]]; then
if [[ ! -f "$BAZZITE_CONFIG_DIR/framework-initialized" ]]; then
echo 'Enabling automatic power profile extension'
gnome-extensions enable power-profile[email protected]
ujust configure-auto-power-profile enable
echo 'Setting Framework logo menu'
dconf write /org/gnome/shell/extensions/Logo-menu/symbolic-icon true
dconf write /org/gnome/shell/extensions/Logo-menu/menu-button-icon-image 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ show-gamemode=false
hide-forcequit=true
show-boxbuddy=true

[org/gnome/shell/extensions/power-profile-switcher]
[org/gnome/shell/extensions/auto-power-profile]
ac='balanced'
bat='power-saver'
notify=true
lapmode=true
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,19 @@ restore-gnome-de-settings:
# Restore Bazzite customized applications folders
restore-gnome-folders:
dconf load / < /usr/etc/dconf/db/local.d/04-bazzite-folders

# Change automatic power profile switching behavior
configure-auto-power-profile ACTION="help":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust configure-auto-power-profile <option>"
echo " Use 'enable' to allow automatic power profile switching based on power state
echo " Use 'disable' to prevent automatic power profile switching based on power state
exit 0
if [[ "${OPTION,,}" =~ enable ]]; then
gnome-extensions enable [email protected]
elif [[ "${OPTION,,}" =~ disable ]]; then
gnome-extensions disable [email protected]
fi

0 comments on commit 45f533e

Please sign in to comment.