Disable screensaver / monitor power saving when using a specific program

I set Power manager to blank the screen after some time of inactivity, eventually locking the screen. For normal use I’m happy with this, but when using certain programs (like Ardour) I’d like to disable this as long as those programs are running.

I found this this related guide and tried replacing flash player with Ardour, but couldn’t get it working.

Anyone have ideas?

Xfce power management has a Presentation Mode to disable suspend settings
Left click Power Management plugin in system tray to access control to enable Presentation Mode
xfce:xfce4-power-manager:4.16:panel-plugin [Xfce Docs]

or use this command to toggle Presentation Mode on/off

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T


I’d still like a script to automatically enable Presentation Mode when Ardour is running, so I’ll investigate if the mentioned script can be tweaked to check if Ardour is running and if so enable Presentation Mode.

This suggestion seems good, there’s just some minor issues to solve.

Script currently looks like this:

pgrep Ardour >/dev/null

if [[ $? -eq 0 ]]
    xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
    notify-send "ardour is not running!"

It turns out I was wrong to mark as solved. This command returns an error:

Property "/xfce4-power-manager/presentation-mode" does not exist on channel "xfce4-power-manager".

Trying to find out what went wrong here…

This command returns an error

Check power manager settings in Settings Editor GUI xfce4-settings-editor or:

cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

Also suggest turn on setting for show-presentation-indicator to show additional icon when presentation-mode is active

The suggested script does not pass shellcheck - SC2181 · koalaman/shellcheck Wiki · GitHub
I suspect that toggling presentation mode might only work every other time
This script would have to be running all the time checking for presence of Ardour

I used to use this script to turn on presentation-mode before starting JACK
(panel launcher for QjackCtl changed to Exec=/usr/bin/sh qjstart)

# ~/.local/bin/qjstart
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true > /dev/null 2>&1 &
/usr/bin/qjackctl --start --preset=gnomic &&
sleep 1
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false > /dev/null 2>&1 &

Script turns on presentation-mode; launches qjackctl; pauses at && until qjackctl is closed; then turns off presentation-mode and exit

1 Like

Fantastic, thank you so much!

Since I’m using Cadence to control Jack and closing the Cadence window just minimizes to tray (making complete shutdown easy to forget), I modified your script to start Ardour instead:

# ~/Documents/bin/Ardour-start.sh
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true > /dev/null 2>&1 &
notify-send "Presentation Mode on" &
cadence &&
sleep 1
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false > /dev/null 2>&1 &
notify-send "Presentation Mode off" &

Works perfectly. Just wonder if you could explain to a scripting newbie what the 2>&1 part is actually doing? Thanks again!

see this https://stackoverflow.com/questions/10508843/what-is-dev-null-21

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.