<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
My most-hated-bugs list includes <a
href="https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug/1193716">https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug/1193716</a>.
If you are streaming video in your browser, after 10 minutes it will
blank and then lock the screen (unless you keep moving the mouse).
The bug has been fixed for 14.10, but policy has prevented the fix
from being back-ported to the LTS. Worry about a regression I
suppose, but a usability black eye for the LTS.<br>
<br>
I wrote a script that toggles to a pseudo Presentation Mode (and
back to Normal Mode if you run it again) and notifies the user of
the present mode. I also made up a desktop entry file named Power
Mode Toggler that will run the script from the Preferences menu.<br>
<br>
Note that the Presentation Mode settings are not permanent, but
expire with the session.<br>
<br>
To use these, install the very small libnotify-bin package, which is
required for the user notifications. Then as root, create both
files in /usr/local/share/applications (or an equivalent location).
Remember to make the script executable. <br>
<br>
<hr size="2" width="100%"><br>
#!/bin/bash<br>
# /usr/local/share/applications/xset-mode.sh<br>
# A script to toggle between Presentation and Normal mode and notify
the user of the mode<br>
<br>
STATUS_MONITOR=$(xset q | grep "DPMS is" | awk '{print $3}')<br>
<br>
if [ "$STATUS_MONITOR" == "Enabled" ]; then<br>
<br>
xset s off<br>
xset -dpms<br>
notify-send -t 5000 “The computer is now in Presentation
Mode”<br>
<br>
else<br>
<br>
xset s on<br>
xset +dpms<br>
notify-send -t 5000 “The computer is now in Normal Mode”<br>
<br>
fi<br>
<br>
<hr size="2" width="100%"><br>
A desktop entry file to run the script and appear in the Preferences
menu as Power Mode Toggler:<br>
/usr/local/share/applications/power-mode-toggler.desktop<br>
<br>
[Desktop Entry]<br>
Version=1.0<br>
<br>
Type=Application<br>
<br>
Name=Power Mode Toggle<br>
Icon=xfpm-ac-adapter<br>
<br>
Exec=bash /usr/local/share/applications/xset-mode.sh<br>
Terminal=false<br>
<br>
Categories=Settings<br>
Name[en_US]=Power Mode Toggler<br>
Comment[en_US]=Toggle between Presentation and Normal Mode<br>
<br>
<hr size="2" width="100%"><br>
<b>Arcane Background Reading</b><br>
<br>
A summary of my research into this problem:<br>
<br>
<i><b>Command Line Behavior</b></i><br>
<br>
Command line utility xset sets the X user preferences<br>
<br>
Some commands:<br>
xset q - queries the current settings for the X user preferences<br>
xset s on/off - turn the screen saver functions on or off<br>
xset -dpms/+dpms - disables/enables the DPMS functions<br>
<br>
xset q output includes these two sections which determine the screen
behavior:<br>
<br>
Screen Saver:<br>
prefer blanking: yes allow exposures: yes<br>
timeout: 600 cycle: 600<br>
<br>
DPMS (Energy Star):<br>
Standby: 600 Suspend: 0 Off: 900<br>
DPMS is Enabled<br>
Monitor is On<br>
<br>
This xset output is the reliable indicator of behavior, not the GUI
interfaces.<br>
<br>
An ad hoc Presentation Mode:<br>
$ xset s off # sets Screen Saver timeout: 0<br>
$ xset -dpms # disables DPMS, though leaving the Standby,
Suspend, Off values unaffected<br>
This works!<br>
<br>
An ad hoc Normal Mode:<br>
$ xset s on # sets Screen Saver timeout to the X default: 600<br>
$ xset +dpms # enables DPMS with whatever Standby, Suspend, Off
values are current<br>
<br>
<hr size="2" width="100%"><br>
<i><b>GUI Interface Behavior (A Mess)</b></i><br>
<br>
Menu: Preferences: Power Manager, Light Locker <br>
(xfce4-power-manager-settings, light-locker-settings)<br>
<br>
Changing settings in LL/XPM will also change the output of xset q,
but changing settings via xset does not result in changes to the
LL/XPM interfaces. Perhaps a reboot would effect that.<br>
<br>
If you set XPM systray icon to always appear and right-click it, you
can choose Mode: Normal/Presentation. But Presentation Mode merely
disables DPMS and does not turn off the screen saver.<br>
<br>
Note that light-locker-settings and xfce4-power-manager-settings
both offer sliders to set monitor blank/sleep and monitor switched
off. But these operate in lock-step: changing a slider setting in
LL will also change it in XPM. However, the effects in xset depend
on which interface you made the change from!!!<br>
<br>
XPM: By default the monitor-sleep slider affects DPMS Standby, but
the Extended tab can set it to affect DPMS Suspend instead. The
monitor-offs slider affects DPMS Off. XPM has no effect on the
Screen Saver section.<br>
<br>
LL: The monitor-blank slider affects Screen Saver timeout. The
monitor-off slider affects DPMS Standby and sets DPMS Off: 0.
Setting Enable Light Locker On/Off has varying effects depending on
the initial state. Enabling LL after it had been disabled set the
Screen Saver timeout: 600 and DPMS Off: 0. I thought I found a case
that set Screen Saver timeout: 0, but couldn’t duplicate that
result.<br>
<br>
An Ad Hoc Presentation Mode: Set XPM systray icon to always appear;
right-click it and choose Mode: Presentation. Set LL monitor-blank
slider to Never and Apply.<br>
<br>
An Ad Hoc Normal Mode: Right-click XPM systray icon and choose Mode:
Normal. Set LL monitor-blank slider to 10 minutes and Apply.<br>
<br>
</body>
</html>