Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-01-18 12:35:48

nemodlenec
Member
From: Prague, CZ
Registered: 2019-01-18
Posts: 11

Toggling presentation mode via terminal. (xfce4-power-manager)

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

#2 2019-01-18 14:23:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-01-19 09:09:26

nemodlenec
Member
From: Prague, CZ
Registered: 2019-01-18
Posts: 11

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

Fantastic! Thank you and thank you for the welcome. Good to be here.

Offline

#4 2020-05-01 18:52:22

nemodlenec
Member
From: Prague, CZ
Registered: 2019-01-18
Posts: 11

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

Is there a command that will return the current state of the toggle?

Offline

#5 2020-05-01 20:21:17

MrEen
Member
Registered: 2019-04-19
Posts: 295

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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

#6 2020-05-02 07:50:39

nemodlenec
Member
From: Prague, CZ
Registered: 2019-01-18
Posts: 11

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

Perfect! Thank you.

Offline

#7 2022-01-08 14:00:54

blankcat
Member
Registered: 2021-08-26
Posts: 3

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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

#8 2022-01-08 14:42:43

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#9 2022-01-08 15:28:08

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

blankcat wrote:

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:
pmode.png


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2022-01-08 15:44:22

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

I apologize, ToZ. That's way too off-topic but your panel icons are lit. What's the theme called?


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#11 2022-01-08 15:50:40

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

KBar wrote:

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.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2022-01-13 10:27:56

blankcat
Member
Registered: 2021-08-26
Posts: 3

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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 big_smile

My xfce4 DE panel is 4.14.3 and looks like this:
Clipboard01.jpg
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

#13 2022-01-13 11:56:03

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#14 2022-01-13 21:03:41

blankcat
Member
Registered: 2021-08-26
Posts: 3

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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

#15 2022-01-13 21:23:12

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#16 2022-04-23 15:43:57

kunzlata
Member
Registered: 2019-06-24
Posts: 42

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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

#17 2022-04-23 16:52:51

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Toggling presentation mode via terminal. (xfce4-power-manager)

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
...

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB