You are not logged in.
Is it possible to toggle the presentation mode via a terminal? I'd like to bind it to a key in openbox.
Thank you.
Offline
Hello and welcome.
You can use:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
The "-T" will toggle the setting between true and false.
Offline
Fantastic! Thank you and thank you for the welcome. Good to be here.
Offline
Is there a command that will return the current state of the toggle?
Offline
If all you want to see is a true or false, this should do it:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -v
Offline
Perfect! Thank you.
Offline
Hello, this is exactly what I was looking for, so thank you. It's great, that this can be turned into a shortcut.
Also, is there a way to have an icon or something, that sits somewhere in the xfce4-panel (taskbar), which shows the current status after the toggle?
Offline
I have never used it but xfce4-genmon-plugin should be able to do it. xfconf allows monitoring a channel, so for example, the following:
xfconf-query --monitor --channel xfce4-desktop
will keep watching the xfce4-desktop channel for changes.
Xubuntu 20.04
Offline
Also, is there a way to have an icon or something, that sits somewhere in the xfce4-panel (taskbar), which shows the current status after the toggle?
Which version of xfce4-power-manager are you running? It should have an icon popup next to the battery icon when presentation mode is enabled:
Offline
I apologize, ToZ. That's way too off-topic but your panel icons are lit. What's the theme called?
Xubuntu 20.04
Offline
I apologize, ToZ. That's way too off-topic but your panel icons are lit. What's the theme called?
From the VM with that screenshot, they are WhiteSur. The elementary-xfce icon set looks similar.
Offline
I am sorry, I've searched but I am not sure if I found the correct xfce4-power-manager version, the right-click on the battery icon shows version 1.6.6, but I am definitely not seeing that awesome flipchart icon
My xfce4 DE panel is 4.14.3 and looks like this:
no matter if the Presentation mode is on or off.
The only way I am checking if it's toggled is when I click the battery icon and the drop-down menu shows it.
Also it seems that it doesn't matter if the laptop is plugged in or not.
Offline
It was added in version 1.7.0. As a workaround, you could use the xfce4-genmon-plugin and a script like this:
#!/bin/bash
ON_ICON=emblem-mounted
OFF_ICON=emblem-unmounted
if [ $1 == "toggle" ]; then
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
PLUGIN_ID=`basename $(fgrep -ri $(basename $0) ~/.config/xfce4/panel/genmon* | awk -F':' '{print $1}') .rc`
xfce4-panel --plugin-event=$PLUGIN_ID:refresh:bool:true
exit 0
fi
[[ $(xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode) == "false" ]] && ICON=$OFF_ICON || ICON=$ON_ICON
# do the genmon
echo "<icon>$ICON</icon>"
echo "<iconclick>$0 toggle</iconclick>"
echo "<tool></tool>"
...just change the ON_ICON and OFF_ICON variables to suit.
Offline
But can't I just upgrade it? I mean this came with my distribution of xubuntu 18.04 (updated to 20.04), which I initially installed on the previous laptop.
I just took the HDD after it died and I am now using it on this one, so I am not sure if this is the initial version of power manager, or it got updated somewhere along the way.
I am not on version 1.6.6 for any particular reason.
Offline
Xubuntu 20.04 only packages up to 1.6.6 - you'd need to either upgrade to a newer distro version or enable some test/dev repository.
Offline
Thanks also.
xfconf-query --help and the docs unfortunately make us think that the command would be
xfconf-query -c xfce4-power-manager -p /presentation-mode -T
which doesn't work.
Last edited by kunzlata (2022-04-23 15:44:25)
Offline
You need to be careful to get the correct path to the key. You can get the complete list of of keys with:
xfconf-query -c xfce4-power-manager -lv
...and there you can see:
...
/xfce4-power-manager/presentation-mode false
...
Offline