I am running into a few things that I used with xfce-panel.
In this case, I want to raise an idea for presentation mode.
Xfce power managment has a checkbox to turn the presentation mode on / off.
I am now using a script so I can use tint2’s power module and switch the presentation mode with notification. A change in color of icon would be nice too.
What do you think, to add presentation mode toggle to the tint2 power module.
I will be happy to help you with this and possible further things about tint2. (If I remember correctly you are using some kind of launcher for music - made as xfce4 panel - that should be very easy to achieve as tint2 also).
But sorry for my ignorance… what exactly xfce4 presentation mode is? Is this something related to monitor blanking? I played with this but did not notice any changes Actually I don’t use any power manager at all.
If the thing is related to monitor blanking… we have noblank script for that, try W-A-b (super + alt +b) it toggles monitor blanking and shows notification.
Maybe this is enough?
Indeed, presentation mode is that the screen does not turn off when watching e.g. video
It can be set from the tray icon.
I assume this is the same as W+A+b. Did’t know it was present. Probably enough indeed.
When attached to a computer as you are, then power management is indeed useless.
On / Off. you got the power.
Out of curiosity. Which command is used for W+A+b.
I guess you mean, a genmon script could be translated to tint2.
Audacious output i used as genmon script. Will have a look at it for further investication.
If i have more specific question about this, i know where to go.
napcok@mabox ~ $ cat /usr/local/bin/noblank
#!/usr/bin/env bash
case "$LANG" in
pl*)
DISABLED="Wygaszanie monitora jest WYŁĄCZONE"
ENABLED="Wygaszanie monitora jest WŁĄCZONE"
;;
*)
DISABLED="Monitor blanking is DISABLED"
ENABLED="Monitor blanking is ENABLED"
;;
esac
if (xset q|grep --quiet "DPMS is Enabled");
then
xset s off -dpms
notify-send -i monitor -t 5000 "DPMS" "$DISABLED"
else
xset s on +dpms
notify-send -i monitor -t 5000 "DPMS" "$ENABLED"
fi
script does not touch blanking time at all. It just disable/enable blanking. I believe default ‘blanking time’ is 600. Check with:
xset q
script have nothing in common with any xfce4 tool
I refer to what we have in Mabox by default. And have no idea why script does not work for you.
Maybe you have notification daemon disabled?
Or you removed script keybindings from rc.xml?
I think there is a misunderstanding.
The script runs and gives the notification. Only the blanking proces seems not to work.
Samenvatting
vogel@vogel-box ~/Scripts $ xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000002
XKB indicators:
00: Caps Lock: off 01: Num Lock: on 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: off
auto repeat delay: 660 repeat rate: 25
auto repeating keys: 00ffffffdffffbbf
fadfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 0 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 2/1 threshold: 4
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 600
Colors:
default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffffff
Font Path:
/usr/share/fonts/misc,/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,/usr/share/fonts/100dpi,/usr/share/fonts/75dpi,built-ins
DPMS (Display Power Management Signaling):
Standby: 0 Suspend: 0 Off: 0
DPMS is Disabled
vogel@vogel-box ~/Scripts $ noblank
vogel@vogel-box ~/Scripts $ xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000002
XKB indicators:
00: Caps Lock: off 01: Num Lock: on 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: off
auto repeat delay: 660 repeat rate: 25
auto repeating keys: 00ffffffdffffbbf
fadfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 0 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 2/1 threshold: 4
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 600 cycle: 600
Colors:
default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffffff
Font Path:
/usr/share/fonts/misc,/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,/usr/share/fonts/100dpi,/usr/share/fonts/75dpi,built-ins
DPMS (Display Power Management Signaling):
Standby: 0 Suspend: 0 Off: 0
DPMS is Enabled
Monitor is On
It seems that xset dpms is working. Needed more patient.
Nice to learn the script part of tint2. Even simpler than Genmon.
SET : Battery not showing below 70%.
DOT: shows if blanking is on or not.
RED: Blanking is On.
Green: Blanking Off.
#!/usr/bin/env sh
## switch between icon set.
readonly noblank_on="${HOME}/.icons/dot-rood.svg"
readonly noblank_off="${HOME}/.icons/dot-green.svg"
DPMS_check="$(xset q | grep "Enabled" | wc -l)"
if test $DPMS_check -gt 0
then
echo "$noblank_on"
else
echo "$noblank_off"
fi
I am not sure but is computer compatible with more icon theme’s. At least when i try different theme’s, computer seems to work.
Kind of similar symbol as monitor?
#!/usr/bin/env sh
## switch between icon set.
readonly noblank_on="path/to/icon"
readonly noblank_off="path/to/icon"
DPMS_check="$(xset q | grep "Enabled" | wc -l)"
if test $DPMS_check -gt 0
then
echo "$noblank_on"
else
echo "$noblank_off"
fi
*Click:
Delay Standby xset-600.sh.
Mabox noblank
L: changes the delay time between 250 & 600
MW: noblank on/off
#!/usr/bin/env sh
DPMS_delay="$(xset q | grep "Standby: 600" | wc -l)"
if test $DPMS_delay -gt 0
then
xset dpms 250 700 900
notify-send -i computer -t 5000 "Sleep time set to 250"
else
xset dpms 600 700 900
notify-send -i computer -t 5000 "Sleep time set to 600"
fi
I like to share my modified tint2 script for sleeptime management.
Icon only visible in noblank/Presentation modes. (see previous post for icon)
Mouse click on icon changes time between 250 or 600 sec for blanking screen.
Executor tint2 : noblank-notif.sh
Shows only an icon when in noblank modes.
check icon path and modify to yours.
#!/bin/env bash
## icon path.
noblank_on=${HOME}/.icons/power-save.svg
noblank_off=${HOME}/.icons/powerpoint.svg
# check noblank state. [on|off]
function DPMS_check {
! xset q | grep Enabled
}
if DPMS_check
then
echo "$noblank_off"
else
echo ""
fi
Mouse click script: xset-600.sh
For changing delay time. Between 250 or 600 sec.
Can only be used when icon is visible.
#!/bin/env bash
# check if delay is set to 600 or not.
DPMS_delay="$(xset q | grep -c "Standby: 600" )"
if test $DPMS_delay -gt 0
then
xset dpms 250 700 900 # set to 250 and activate blanking.
xset -dpms # disable blanking.
notify-send -i computer -t 5000 "Sleep time set to 250"
else
xset dpms 600 700 900 # set to 600 and activate blanking.
xset -dpms # disable blanking.
notify-send -i computer -t 5000 "Sleep time set to 600"
fi
Thank you @muzqs for your idea. I’m going to throw my two cents with the following tips.
You can replace:
xset q | grep "Standby: 600" | wc -l
With just:
xset q | grep -c "Standby: 600"
That said, xset, sadly, doesn’t include any parameters in order to isolate its values, meaning that you must relay on word filtering to do so. I think (please correct me, @napcok and other guys with no Latin alphabets) this could be a problem. My proposal to extract the Standby value directly is:
Because is using the very output format instead of words it should work fine with any Latin alphabet (English, Spanish, etc). The command’s translation is “find the 6th section of xset’s output [DPMS], then the line just below and finally the second column [600]”