You are not logged in.
Pages: 1
This might make a useful addition to the documentation.
Presentation mode turns off the screen saver and automatic locking. It is nice while you are watching a movie or giving a presentation.
Ordinarily you can access it from the upper panel, power manager plugin. You may have to enable it: right click on the power manager plugin, go to properties, and enable "Show 'Presentation mode' indicator:".
However you may want to toggle it on or off in a script. If so:
xfconf-query -c xfce4-power-manager -n -p /xfce4-power-manager/presentation-mode -T
That works fine in a terminal window as well.
Now, suppose you want to assign that to a keystroke, say <Alt>p? Do this:
xfconf-query -v -c xfce4-keyboard-shortcuts -n -p "/commands/custom/<Alt>p" -t string -s "xfconf-query -c xfce4-power-manager -n -p /xfce4-power-manager/presentation-mode -T"
I welcome suggestions for improvement.
Offline
When I restart the computer, and log in again (such as when beginning a music performance at a remote location), the presentation mode button on the power manager says presentation mode is still enabled (good, that's what I need), but in fact it is NOT enabled (very very bad -- it wrecks the performance). It's clearly a bug. I'm running up-to-date Debian 12 stable. What to do?
Offline
but in fact it is NOT enabled (very very bad -- it wrecks the performance).
What exactly happens? screensaver quicks in? computer goes to sleep? etc.
As a test:
Make sure presentation mode is set. Also post back the result of:
xfconf-query -c xfce4-power-manager -n -p /xfce4-power-manager/presentation-mode
Go to the power manager settings on the System tab for either "On Battery" or "plugged in" (depending on which you are) ad set the "System Sleep Mode" to "Suspend" and the Inactive time to 1 minute.
Run xfce4-power-manager in debug mode:
xfce4-power-manager -q
xfce4-power-manager --debug
Wait for one minute until something happens - if presentation mode is not working, then something will happen.
Post back what was displayed in the debug output.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
#1 displays "True"
The rest of the test you suggested provided no explanation, because nothing untoward happened. Everything worked as it should; the screen did not turn off. Here are a couple of theories:
1. The problem has to do with logging out. When packing up before or after gigs, I impatiently run systemctl -f poweroff, thus skipping the logout process (mostly). After rebooting, the *apparent* status of the Presentation Mode toggle (On) doesn't match the *actual* status, so it doesn't work. Once I have toggled it twice (so now it *still* says presentation mode is on), presentation mode actually takes effect.
2. The problem has to do with VNC. The computer lives over a piano keyboard when I'm at home, so if I'm doing computer things with that computer, as opposed to music things, it's much easier for me to interact with its VNC server from a client computer. When I do this, the client computer loses its ability to turn its own screen off. Is that an intentional VNC quirk, I wonder? I'm using x11vnc server and tigerVNC client.
I wish I had another theory. I don't find the two theories above very compelling. The problem remains unexplained, as far as I'm concerned, unless you have some insight that buttresses some theory of the case. Be assured I have no intention of abandoning XFCE4. It has the fewest quirks and is the most transparent, AFAICT. My problem wouldn't be quite so annoying if it weren't so unusual.
Offline
To confirm, Debian 12 is running xfce4-power-manager 4.18.x
See if you can replicate the steps that generate this issue and on reboot, note if the presentation toggle is enabled and run the xfconf command above to confirm that it is set the same (on = true). As a workaround, you could manually enable presentation mode on login so you don't have the issue, but it would depend on the results of above.
I honestly can't think of a reason why there would be a discrepancy between the state and the actual value, but perhaps you've hit some sort of edge case. I've searched the bug reports and no-one has reported anything like this. Perhaps vnc is somehow involved.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
4.18.1, so yes, it's 4.18.x.
Well, it just happened again, despite the fact that I've configured the power manager to NEVER turn off the screen either on battery or mains. I wonder whether I'd get better results if I simply disabled the power manager altogether. How best to try that, I wonder?
I'd like to add another theory, namely that it has something to do with the lid switch, but I've been unable to verify that. I note that the lid switch *always* turns off the screen, presentation mode or no.
By the way, the presentation mode status was reported as "True", as usual, but the screen had just turned off, which is inconsistent with the report, as usual. Maybe the status is always consistent with the appearance of the toggle, but not necessarily with reality. Or maybe it has nothing to do with the power manager. Weird.
Offline
If you could continuously run xfce4-power-manager in debug mode (see above) and then when it happens post back the output from around that time, it might help identify whats happening and maybe confirm one of your theories.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I've added to Session and Startup -> Application Autostart the following script:
#!/bin/bash
progname="$(basename $0)"
outputFilePath="/tmp/${progname}_$(date '+%Y%m%d-%H%M%S')"
/bin/bash -c '
/usr/bin/xfce4-power-manager -q
/usr/bin/xfce4-power-manager --debug
' >"$outputFilePath" 2>&1 &
disown
Naturally, since I added this, the problem isn't appearing. However, the output file is being created OK. I'll let you know when the problem recurs, and I'll post the output here.
Offline
Nothing has gone wrong since I last posted. I'm wondering whether putting the power manager in --debug mode prevents the bug from occurring. If so, it's a solution, sort of. The login script (see previous message) that saves the debug output now looks like this:
#!/bin/bash
progname="$(basename $0)"
outputFilePath="/tmp/${progname}_$(date '+%Y%m%d-%H%M%S')"
/bin/bash -c '
/usr/bin/xfce4-power-manager -q 2>&1
/usr/bin/xfce4-power-manager --debug 2>&1
' | /usr/local/ch-tools3/prependdatestolines.py > "$outputFilePath" 2>&1 & disown
And here's prependdatestolines.py:
#!/usr/bin/env python3
import datetime, fcntl, os, re, sys, time
newlineRE = re.compile( r'\n')
## make stdin nonblocking
fcntl.fcntl(
sys.stdin.fileno(),
fcntl.F_SETFL,
(
fcntl.fcntl( sys.stdin.fileno(), fcntl.F_GETFL)
|
os.O_NONBLOCK
),
)
heldTrailingNewline = ''
firstTimeThroughLoop = True
while True:
try:
incoming = os.read( sys.stdin.fileno(), 1024).decode( 'utf-8')
except BlockingIOError:
time.sleep( 0.1)
continue
if not incoming: ## EOT yet ?
if heldTrailingNewline:
outgoing = '\n'
os.write( sys.stdout.fileno(), heldTrailingNewline.encode( 'utf-8'))
heldTrailingNewline = ''
break ## we're done
outgoing = ''.join(
[
''.join(
[
datetime.datetime.now().strftime( '%Y%m%d%H%M%S'),
' ',
],
) if ( firstTimeThroughLoop) else '',
heldTrailingNewline if (
heldTrailingNewline
) else '',
incoming,
],
)
heldTrailingNewline = ''
firstTimeThroughLoop = False
if outgoing[ -1] in [ '\n']:
outgoing = outgoing[ : -1]
heldTrailingNewline = '\n' ## for next time
os.write(
sys.stdout.fileno(),
newlineRE.sub(
'\n%s ' % ( datetime.datetime.now().strftime( '%Y%m%d%H%M%S')),
outgoing,
).encode( 'utf-8')
)
Offline
Pages: 1
[ Generated in 0.015 seconds, 7 queries executed - Memory usage: 591.3 KiB (Peak: 608.15 KiB) ]