27 lines
1.2 KiB
Plaintext
Raw Normal View History

chore(just): cleanup and standardize just recipes (#765) * fix(just): correctly generate tmpfile config with sudo heredoc * fix(just): correct vfio-pci.ids to vfio_pci.ids in echo * chore(just): cleanup heredoc for just syntax highlighting in vscode * feat(just): turn sunshine recipes into 1 recipe * feat(just): add service toggle to sunshine * feat(just): turn watchdog recipes into configure-watchdog * feat(just): turn hide-grub and unhide-grub into 1 recipe also add option to "fix double ostree entries" * feat(just): turn virtualization and vfio recipes into 1 recipe * feat(just): split virtualization recipes into its own file * feat(just): move install application recipes to its own file * feat(just): move setup-sunshine to its own file * feat(just): move waydroid recipes to its own file * feat(just): move audio recipes into its own file * fix(just): move distrobox-check-fedora to bazzite-apps just file * feat(just): standardize verbs for applications * feat(just): move fixes to its own repository * feat(just): add alias for yafti (until we change the command in yafti) * fix(just): apply correct playback props for virtual channels when on deck image a valve update added virtual sink and filter chain which messes up default outputs for the old config * chore(just): add more recommended programs for routing audio * chore: Update to use Sunshine from copr * chore: Hide toggle-autologin * chore(just): merge setup and remove recipes for audio * feat(just): add recipe to restart pipewire * chore(just): Combine waydroid recipes * fix(yafti): make yafti use the new recipes for sunshine and grub * feat(just): add looking-glass selinux option to setup-virtualization * feat(just): add alias for wayland toggle This is mainly so both _toggle_wayland and _toggle-wayland will be correct, as this is the only recipe with underscore instead of dash * chore(just): remove aliases to old "patch" verb for fixes * feat(just): combine install decky and get alt handheld recipes to setup-decky * feat(yafti): update yafti config to use new changes * chore: update readme to reflect new ujust recipes * fix(yafti): update desktop yafti config to use new ujust recipes * chore(just): add echo to restart-pipewire * feat(just): implement ujust configure-powerprofile for kde * feat: add support for sending power-saver dbus signal on gnome * fix(just): activate the default power profile after selecting it as default * feat(just): add message with highlight to ask people to use Balanced profile for testing/debugging * fix: only try to remove the autostart file if the file exists --------- Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
2024-03-01 07:31:59 +01:00
#!/usr/bin/bash
# This script sends the Power Profile Daemon dbus call to set tuneD to power-saver mode
# This is useful only for battery powered devices where you want to start in power-saver mode by default
POWERSAVE=1
if [ -n "$1" ]; then
if [ "$1" == "0" ]; then
chore(just): cleanup and standardize just recipes (#765) * fix(just): correctly generate tmpfile config with sudo heredoc * fix(just): correct vfio-pci.ids to vfio_pci.ids in echo * chore(just): cleanup heredoc for just syntax highlighting in vscode * feat(just): turn sunshine recipes into 1 recipe * feat(just): add service toggle to sunshine * feat(just): turn watchdog recipes into configure-watchdog * feat(just): turn hide-grub and unhide-grub into 1 recipe also add option to "fix double ostree entries" * feat(just): turn virtualization and vfio recipes into 1 recipe * feat(just): split virtualization recipes into its own file * feat(just): move install application recipes to its own file * feat(just): move setup-sunshine to its own file * feat(just): move waydroid recipes to its own file * feat(just): move audio recipes into its own file * fix(just): move distrobox-check-fedora to bazzite-apps just file * feat(just): standardize verbs for applications * feat(just): move fixes to its own repository * feat(just): add alias for yafti (until we change the command in yafti) * fix(just): apply correct playback props for virtual channels when on deck image a valve update added virtual sink and filter chain which messes up default outputs for the old config * chore(just): add more recommended programs for routing audio * chore: Update to use Sunshine from copr * chore: Hide toggle-autologin * chore(just): merge setup and remove recipes for audio * feat(just): add recipe to restart pipewire * chore(just): Combine waydroid recipes * fix(yafti): make yafti use the new recipes for sunshine and grub * feat(just): add looking-glass selinux option to setup-virtualization * feat(just): add alias for wayland toggle This is mainly so both _toggle_wayland and _toggle-wayland will be correct, as this is the only recipe with underscore instead of dash * chore(just): remove aliases to old "patch" verb for fixes * feat(just): combine install decky and get alt handheld recipes to setup-decky * feat(yafti): update yafti config to use new changes * chore: update readme to reflect new ujust recipes * fix(yafti): update desktop yafti config to use new ujust recipes * chore(just): add echo to restart-pipewire * feat(just): implement ujust configure-powerprofile for kde * feat: add support for sending power-saver dbus signal on gnome * fix(just): activate the default power profile after selecting it as default * feat(just): add message with highlight to ask people to use Balanced profile for testing/debugging * fix: only try to remove the autostart file if the file exists --------- Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
2024-03-01 07:31:59 +01:00
POWERSAVE=0
fi
fi
# Check what DE we are on
if command -v /usr/bin/mutter > /dev/null; then
# If we are on Gnome send the dbus signal with gdbus
if [ "$POWERSAVE" == "0" ]; then
chore(just): cleanup and standardize just recipes (#765) * fix(just): correctly generate tmpfile config with sudo heredoc * fix(just): correct vfio-pci.ids to vfio_pci.ids in echo * chore(just): cleanup heredoc for just syntax highlighting in vscode * feat(just): turn sunshine recipes into 1 recipe * feat(just): add service toggle to sunshine * feat(just): turn watchdog recipes into configure-watchdog * feat(just): turn hide-grub and unhide-grub into 1 recipe also add option to "fix double ostree entries" * feat(just): turn virtualization and vfio recipes into 1 recipe * feat(just): split virtualization recipes into its own file * feat(just): move install application recipes to its own file * feat(just): move setup-sunshine to its own file * feat(just): move waydroid recipes to its own file * feat(just): move audio recipes into its own file * fix(just): move distrobox-check-fedora to bazzite-apps just file * feat(just): standardize verbs for applications * feat(just): move fixes to its own repository * feat(just): add alias for yafti (until we change the command in yafti) * fix(just): apply correct playback props for virtual channels when on deck image a valve update added virtual sink and filter chain which messes up default outputs for the old config * chore(just): add more recommended programs for routing audio * chore: Update to use Sunshine from copr * chore: Hide toggle-autologin * chore(just): merge setup and remove recipes for audio * feat(just): add recipe to restart pipewire * chore(just): Combine waydroid recipes * fix(yafti): make yafti use the new recipes for sunshine and grub * feat(just): add looking-glass selinux option to setup-virtualization * feat(just): add alias for wayland toggle This is mainly so both _toggle_wayland and _toggle-wayland will be correct, as this is the only recipe with underscore instead of dash * chore(just): remove aliases to old "patch" verb for fixes * feat(just): combine install decky and get alt handheld recipes to setup-decky * feat(yafti): update yafti config to use new changes * chore: update readme to reflect new ujust recipes * fix(yafti): update desktop yafti config to use new ujust recipes * chore(just): add echo to restart-pipewire * feat(just): implement ujust configure-powerprofile for kde * feat: add support for sending power-saver dbus signal on gnome * fix(just): activate the default power profile after selecting it as default * feat(just): add message with highlight to ask people to use Balanced profile for testing/debugging * fix: only try to remove the autostart file if the file exists --------- Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
2024-03-01 07:31:59 +01:00
gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' "<'balanced'>"
else
gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' "<'power-saver'>"
fi
else
# Assume we are on KDE and send the dbus signal with qdbus
if [ "$POWERSAVE" == "0" ]; then
chore(just): cleanup and standardize just recipes (#765) * fix(just): correctly generate tmpfile config with sudo heredoc * fix(just): correct vfio-pci.ids to vfio_pci.ids in echo * chore(just): cleanup heredoc for just syntax highlighting in vscode * feat(just): turn sunshine recipes into 1 recipe * feat(just): add service toggle to sunshine * feat(just): turn watchdog recipes into configure-watchdog * feat(just): turn hide-grub and unhide-grub into 1 recipe also add option to "fix double ostree entries" * feat(just): turn virtualization and vfio recipes into 1 recipe * feat(just): split virtualization recipes into its own file * feat(just): move install application recipes to its own file * feat(just): move setup-sunshine to its own file * feat(just): move waydroid recipes to its own file * feat(just): move audio recipes into its own file * fix(just): move distrobox-check-fedora to bazzite-apps just file * feat(just): standardize verbs for applications * feat(just): move fixes to its own repository * feat(just): add alias for yafti (until we change the command in yafti) * fix(just): apply correct playback props for virtual channels when on deck image a valve update added virtual sink and filter chain which messes up default outputs for the old config * chore(just): add more recommended programs for routing audio * chore: Update to use Sunshine from copr * chore: Hide toggle-autologin * chore(just): merge setup and remove recipes for audio * feat(just): add recipe to restart pipewire * chore(just): Combine waydroid recipes * fix(yafti): make yafti use the new recipes for sunshine and grub * feat(just): add looking-glass selinux option to setup-virtualization * feat(just): add alias for wayland toggle This is mainly so both _toggle_wayland and _toggle-wayland will be correct, as this is the only recipe with underscore instead of dash * chore(just): remove aliases to old "patch" verb for fixes * feat(just): combine install decky and get alt handheld recipes to setup-decky * feat(yafti): update yafti config to use new changes * chore: update readme to reflect new ujust recipes * fix(yafti): update desktop yafti config to use new ujust recipes * chore(just): add echo to restart-pipewire * feat(just): implement ujust configure-powerprofile for kde * feat: add support for sending power-saver dbus signal on gnome * fix(just): activate the default power profile after selecting it as default * feat(just): add message with highlight to ask people to use Balanced profile for testing/debugging * fix: only try to remove the autostart file if the file exists --------- Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
2024-03-01 07:31:59 +01:00
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/PowerProfile setProfile balanced
else
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/PowerProfile setProfile power-saver
fi
fi