Skip to content

Commit

Permalink
feat: Restore power profile switcher on framework (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo authored May 11, 2024
1 parent 802ab1b commit 8c9c1bd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions just/bluefin-system.just
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,22 @@ configure-vfio ACTION="":
sudo /usr/libexec/bluefin-dx-kvmfr-setup
fi

# 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
elif [[ "${OPTION,,}" =~ enable ]]; then
gnome-extensions enable [email protected]
elif [[ "${OPTION,,}" =~ disable ]]; then
gnome-extensions disable [email protected]
fi

# Install system flatpaks for rebasers
[private]
install-system-flatpaks:
Expand Down
2 changes: 1 addition & 1 deletion packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"gnome-shell-extension-gsconnect",
"gnome-shell-extension-logo-menu",
"gnome-shell-extension-search-light",
"gnome-shell-extension-power-profile-switcher",
"gnome-shell-extension-auto-power-profile",
"libgda-sqlite",
"libgda",
"libratbag-ratbagd",
Expand Down
2 changes: 2 additions & 0 deletions system_files/shared/usr/libexec/ublue-user-setup
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ fi

if [[ ":Framework:" =~ ":$VEN_ID:" ]]; then
if [[ ! -f "$UBLUE_CONFIG_DIR/framework-initialized" ]]; then
echo 'Enabling automatic power profile extension'
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 31
Expand Down
4 changes: 3 additions & 1 deletion system_files/silverblue/usr/etc/dconf/db/local.d/01-ublue
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ default-profile-uuid='2871e8027773ae74d6c87a5f659bbc74'
[org/gnome/Ptyxis/Profiles/2871e8027773ae74d6c87a5f659bbc74]
palette='catppuccin-dynamic'

[org/gnome/shell/extensions/power-profile-switcher]
[org/gnome/shell/extensions/auto-power-profile]
ac='balanced'
bat='power-saver'
notify=true
lapmode=true

0 comments on commit 8c9c1bd

Please sign in to comment.