Change power and screensaver rules

This commit is contained in:
Robin C. 2025-01-09 07:26:36 +01:00
parent 8a2b312f76
commit 4ed7889d62
2 changed files with 25 additions and 3 deletions

View File

@ -303,6 +303,10 @@ sudo zypper --non-interactive install xscreensaver-data xscreensaver-data-extra
# Build Essentials
sudo zypper --non-interactive install gcc-c++ libXxf86vm-devel webkit2gtk3-devel alsa-lib-devel freetype-devel libpulse-devel glu-devel libudev-devel libXss-devel make ninja
# Use SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false to prevent freezing when suspending
sudo mkdir -p /etc/systemd/system/systemd-suspend.service.d/
sudo sh -c 'echo -e "[Service]\nEnvironment=\"SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false\"" > /etc/systemd/system/systemd-suspend.service.d/disable_freeze_user_session.conf'
# Tell the user we're done
echo
echo "All done!"

View File

@ -28,11 +28,13 @@ ln -sf $SCRIPT_DIR/xfce4-panel.xml $XDG_CONFIG_HOME/xfce4/xfconf/xfce-perchannel
sleep 3
xfce4-panel &
# Enable the screensaver and set to a timeout of 14 minutes
# Screensaver and Screen Blanking
# The screensaver cannot be blocked by applications, so set a high timeout
# Screen blanking can be blocked by lots of things, like sound and applications
echo
echo "Enabling the screensaver and setting a timeout of 14 minutes"
echo "Enabling the screensaver and setting a timeout of 120 minutes (2 hours)"
xfconf-query -c xfce4-screensaver -p /saver/idle-activation/enabled --create --type bool -s true
xfconf-query -c xfce4-screensaver -p /saver/idle-activation/delay --create --type int -s 14
xfconf-query -c xfce4-screensaver -p /saver/idle-activation/delay --create --type int -s 120
# Set the screensaver to Matrix
echo
@ -45,6 +47,22 @@ echo
echo "Locking the screen after 1 minute of screensaving"
xfconf-query -c xfce4-screensaver -p /lock/saver-activation/delay --create --type int -s 1
# Enable Display Power Management
echo
echo "Setting machine power profile to performance on AC"
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/profile-on-ac --create --type string -s "performance"
echo "Enabling Display Power Management"
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-enabled --create --type bool -s true
echo "Setting the display to power off after 15 minutes on AC"
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-sleep --create --type int -s 15
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-ac-off --create --type int -s 16
echo "Setting the display to power off after 5 minutes on battery"
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep --create --type int -s 5
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off --create --type int -s 6
echo "Setting machine to Hibernate after 30 minutes on AC"
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-sleep-mode-on-ac --create --type int -s 2
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-ac --create --type int -s 30
# Dracula theme
echo
echo "Setting the Dracula theme"