Re: Xfce Power Manger and watching movies full screen

2019-04-03 Thread Georgios
I understand what you are saying but I dont think its the simpler option
to make 2 different launcher for the same application with different
parameters. I will try the script Curt send me. I think that solution is
applicable to other use cases. Reading pdf files, presentations etc.

Thanks for your reply!

On 4/2/19 5:46 PM, David Wright wrote:
> On Tue 02 Apr 2019 at 08:55:58 (+0300), Georgios wrote:
>> I'm watching movies through netflix so I do not have any ideas how to
>> write a script that will do that thing. I guess the script should detect
>> if an application is in full screen mode.
> 
> What the script is doing is signalling your intent to watch a movie
> rather than to, say, browse the web. The power of the CLI is that you
> can wrap a number of actions that follow from your intent within one
> command, whereas it might take several clicks on menus and buttons
> to achieve the ssme ends on a DE.
> 
> You write "an application" above. Presumably you watch movies in
> one application but you also use that same application to do other
> things too. One solution to this may be to have two ways of opening
> this application, one for when watching movies, one for otherwis
> 
> This is standard practice with CLIs, where calling the same program
> but with a different commandname makes it behave differently,
> eg aplay and arecord, which call the same binary.
> 
> For a DE, this could mean, say, having two icons for opening the same
> application, but which do different things to start with. It's much
> easier to cause something to happen on the system than to try to
> ascertain a certain application's state when its author didn't think
> of providing the means to find out.
> 
> A different tack might be to see if your WM has menus, or can create
> buttons, or define a function key, that can be used to change your
> power settings. For example, in fvwm, I have Alt-F10 set to take a
> full screen shot with:
> Key F10 A M Exec exec myfvwm-scrot-key-png.sh
> and a button for just a window:
> *MyButtons: (2x1+2+0, Title 'Grab PNG', Icon xterm.xpm, \
> Action 'Exec exec myfvwm-scrot-png.sh &')
> Ignore the syntax and particulars here; the myfvwm… script could be
> used to make any number of actions or changes to settings.
> 
>> A "solution" I'm thinking is to put a cron job with the following command
>> xfconf-query -c xfce4-power-manager -p
>> /xfce4-power-manager/presentation-mode -s false to repeat it self every
>> morning.
>>
>> Theoretically that should solve the problem of forgetting to change it back.
>>
>> Doesn't feel like a clean solution.
> 
> Cron has a facility for running commands at every reboot, for example:
> @reboot   /sbin/kbdrate -r 8 -d 500 -s
> As for being a clean solution, the system itself runs scripts to
> initialise state that would otherwise persist across reboots,
> eg cleaning /tmp.
> 
>> Anyway It isn't a big problem. Usually I do not watch movies at all.
>> Just had a leg surgery and I'm going to be bored to death the next
>> couple of weeks until i start walking again.
> 
> Good luck! Perhaps you won't miss the facility for long.
> 
>> On 4/2/19 5:09 AM, David Wright wrote:
>>> On Mon 01 Apr 2019 at 18:43:33 (+0300), Georgios wrote:
 Thanks for your reply.
 I already took a look at Caffeine before I send my first email.
 The problem with it is that it looks for an app running so I do not
 think its a good idea.
 I often leave my laptop with a lot of firefox tabs open and expect it to
 go to sleep mode or hibernation instead of closing it.

 I will probably have to settle with manually checking presentation mode
 although i was hopping for a more automated solution.

 On 4/1/19 6:15 PM, Curt wrote:
> On 2019-04-01, Georgios  wrote:
>> Hi!
>> First of all thanks for the fast reply.
>>
>> Yes I have presentation mode. I didn't even try it to see if its working
>> with hibernate. The problem with that is that its inconvenient to check
>> it and uncheck it all the time.
>>
>> I will inevitably forget it sooner or later.
>>>
>>> How about watching your movies with an in principle 3-line script:
>>>
>>> set the presentation mode
>>> run the movie
>>> revert to non-presentation mode
>>>
> Well, that's how you do it, presumably, with xfce power manager, which
> was the question. Obviously, you toggle presentation mode on and off as
> necessary, unless you're watching netflix 24/7, which might curdle your
> brain.
>
> If not, there's 'caffeine'.
> 
> Cheers,
> David.
> 



Re: Xfce Power Manger and watching movies full screen

2019-04-03 Thread Georgios
Thanks for your help! I will try that!

I think grubing cdm decryption module makes the program too specific. I
can think a couple use cases that full screen should prevent hibernation.

On 4/2/19 3:55 PM, Curt wrote:
> On 2019-04-02, Georgios  wrote:
>> I'm watching movies through netflix so I do not have any ideas how to
>> write a script that will do that thing. I guess the script should detect
>> if an application is in full screen mode.
>>
> 
> Here's a GPL script not far from your desire (can't vouch for it, though).
> 
> https://raw.githubusercontent.com/jamcnaughton/useful-linux-scripts/master/xscreensaver/xscreensaverstopper.sh
> 
> You'd have to alter, of course, the if clause to toggle on
> xfce-power-manager presentation mode (xfconf-query ...) rather than
> deactivating xscreensaver ('xscreensaver-command -deactivate'), and I
> guess add an 'else' to toggle it off when the active window isn't
> fullscreen.
> 
> It seems possible to grep the output of 'ps aux' for the cdm decryption
> module, which might be another way to go in Netflix stream detection.
> 



Re: Xfce Power Manger and watching movies full screen

2019-04-02 Thread David Wright
On Tue 02 Apr 2019 at 08:55:58 (+0300), Georgios wrote:
> I'm watching movies through netflix so I do not have any ideas how to
> write a script that will do that thing. I guess the script should detect
> if an application is in full screen mode.

What the script is doing is signalling your intent to watch a movie
rather than to, say, browse the web. The power of the CLI is that you
can wrap a number of actions that follow from your intent within one
command, whereas it might take several clicks on menus and buttons
to achieve the ssme ends on a DE.

You write "an application" above. Presumably you watch movies in
one application but you also use that same application to do other
things too. One solution to this may be to have two ways of opening
this application, one for when watching movies, one for otherwise.

This is standard practice with CLIs, where calling the same program
but with a different commandname makes it behave differently,
eg aplay and arecord, which call the same binary.

For a DE, this could mean, say, having two icons for opening the same
application, but which do different things to start with. It's much
easier to cause something to happen on the system than to try to
ascertain a certain application's state when its author didn't think
of providing the means to find out.

A different tack might be to see if your WM has menus, or can create
buttons, or define a function key, that can be used to change your
power settings. For example, in fvwm, I have Alt-F10 set to take a
full screen shot with:
Key F10 A M Exec exec myfvwm-scrot-key-png.sh
and a button for just a window:
*MyButtons: (2x1+2+0, Title 'Grab PNG', Icon xterm.xpm, \
Action 'Exec exec myfvwm-scrot-png.sh &')
Ignore the syntax and particulars here; the myfvwm… script could be
used to make any number of actions or changes to settings.

> A "solution" I'm thinking is to put a cron job with the following command
> xfconf-query -c xfce4-power-manager -p
> /xfce4-power-manager/presentation-mode -s false to repeat it self every
> morning.
> 
> Theoretically that should solve the problem of forgetting to change it back.
> 
> Doesn't feel like a clean solution.

Cron has a facility for running commands at every reboot, for example:
@reboot   /sbin/kbdrate -r 8 -d 500 -s
As for being a clean solution, the system itself runs scripts to
initialise state that would otherwise persist across reboots,
eg cleaning /tmp.

> Anyway It isn't a big problem. Usually I do not watch movies at all.
> Just had a leg surgery and I'm going to be bored to death the next
> couple of weeks until i start walking again.

Good luck! Perhaps you won't miss the facility for long.

> On 4/2/19 5:09 AM, David Wright wrote:
> > On Mon 01 Apr 2019 at 18:43:33 (+0300), Georgios wrote:
> >> Thanks for your reply.
> >> I already took a look at Caffeine before I send my first email.
> >> The problem with it is that it looks for an app running so I do not
> >> think its a good idea.
> >> I often leave my laptop with a lot of firefox tabs open and expect it to
> >> go to sleep mode or hibernation instead of closing it.
> >>
> >> I will probably have to settle with manually checking presentation mode
> >> although i was hopping for a more automated solution.
> >>
> >> On 4/1/19 6:15 PM, Curt wrote:
> >>> On 2019-04-01, Georgios  wrote:
>  Hi!
>  First of all thanks for the fast reply.
> 
>  Yes I have presentation mode. I didn't even try it to see if its working
>  with hibernate. The problem with that is that its inconvenient to check
>  it and uncheck it all the time.
> 
>  I will inevitably forget it sooner or later.
> > 
> > How about watching your movies with an in principle 3-line script:
> > 
> > set the presentation mode
> > run the movie
> > revert to non-presentation mode
> > 
> >>> Well, that's how you do it, presumably, with xfce power manager, which
> >>> was the question. Obviously, you toggle presentation mode on and off as
> >>> necessary, unless you're watching netflix 24/7, which might curdle your
> >>> brain.
> >>>
> >>> If not, there's 'caffeine'.

Cheers,
David.



Re: Xfce Power Manger and watching movies full screen

2019-04-02 Thread Curt
On 2019-04-02, Georgios  wrote:
> I'm watching movies through netflix so I do not have any ideas how to
> write a script that will do that thing. I guess the script should detect
> if an application is in full screen mode.
>

Here's a GPL script not far from your desire (can't vouch for it, though).

https://raw.githubusercontent.com/jamcnaughton/useful-linux-scripts/master/xscreensaver/xscreensaverstopper.sh

You'd have to alter, of course, the if clause to toggle on
xfce-power-manager presentation mode (xfconf-query ...) rather than
deactivating xscreensaver ('xscreensaver-command -deactivate'), and I
guess add an 'else' to toggle it off when the active window isn't
fullscreen.

It seems possible to grep the output of 'ps aux' for the cdm decryption
module, which might be another way to go in Netflix stream detection.



Re: Xfce Power Manger and watching movies full screen

2019-04-02 Thread Georgios
I'm watching movies through netflix so I do not have any ideas how to
write a script that will do that thing. I guess the script should detect
if an application is in full screen mode.

A "solution" I'm thinking is to put a cron job with the following command
xfconf-query -c xfce4-power-manager -p
/xfce4-power-manager/presentation-mode -s false to repeat it self every
morning.

Theoretically that should solve the problem of forgetting to change it back.

Doesn't feel like a clean solution.

Anyway It isn't a big problem. Usually I do not watch movies at all.
Just had a leg surgery and I'm going to be bored to death the next
couple of weeks until i start walking again.

On 4/2/19 5:09 AM, David Wright wrote:
> On Mon 01 Apr 2019 at 18:43:33 (+0300), Georgios wrote:
>> Thanks for your reply.
>> I already took a look at Caffeine before I send my first email.
>> The problem with it is that it looks for an app running so I do not
>> think its a good idea.
>> I often leave my laptop with a lot of firefox tabs open and expect it to
>> go to sleep mode or hibernation instead of closing it.
>>
>> I will probably have to settle with manually checking presentation mode
>> although i was hopping for a more automated solution.
>>
>> On 4/1/19 6:15 PM, Curt wrote:
>>> On 2019-04-01, Georgios  wrote:
 Hi!
 First of all thanks for the fast reply.

 Yes I have presentation mode. I didn't even try it to see if its working
 with hibernate. The problem with that is that its inconvenient to check
 it and uncheck it all the time.

 I will inevitably forget it sooner or later.
> 
> How about watching your movies with an in principle 3-line script:
> 
> set the presentation mode
> run the movie
> revert to non-presentation mode
> 
>>> Well, that's how you do it, presumably, with xfce power manager, which
>>> was the question. Obviously, you toggle presentation mode on and off as
>>> necessary, unless you're watching netflix 24/7, which might curdle your
>>> brain.
>>>
>>> If not, there's 'caffeine'.
> 
> Cheers,
> David.
> 



Re: Xfce Power Manger and watching movies full screen

2019-04-01 Thread David Wright
On Mon 01 Apr 2019 at 18:43:33 (+0300), Georgios wrote:
> Thanks for your reply.
> I already took a look at Caffeine before I send my first email.
> The problem with it is that it looks for an app running so I do not
> think its a good idea.
> I often leave my laptop with a lot of firefox tabs open and expect it to
> go to sleep mode or hibernation instead of closing it.
> 
> I will probably have to settle with manually checking presentation mode
> although i was hopping for a more automated solution.
> 
> On 4/1/19 6:15 PM, Curt wrote:
> > On 2019-04-01, Georgios  wrote:
> >> Hi!
> >> First of all thanks for the fast reply.
> >>
> >> Yes I have presentation mode. I didn't even try it to see if its working
> >> with hibernate. The problem with that is that its inconvenient to check
> >> it and uncheck it all the time.
> >>
> >> I will inevitably forget it sooner or later.

How about watching your movies with an in principle 3-line script:

set the presentation mode
run the movie
revert to non-presentation mode

> > Well, that's how you do it, presumably, with xfce power manager, which
> > was the question. Obviously, you toggle presentation mode on and off as
> > necessary, unless you're watching netflix 24/7, which might curdle your
> > brain.
> > 
> > If not, there's 'caffeine'.

Cheers,
David.



Re: Xfce Power Manger and watching movies full screen

2019-04-01 Thread Georgios
Thanks for your reply.
I already took a look at Caffeine before I send my first email.
The problem with it is that it looks for an app running so I do not
think its a good idea.
I often leave my laptop with a lot of firefox tabs open and expect it to
go to sleep mode or hibernation instead of closing it.

I will probably have to settle with manually checking presentation mode
although i was hopping for a more automated solution.


On 4/1/19 6:15 PM, Curt wrote:
> On 2019-04-01, Georgios  wrote:
>> Hi!
>> First of all thanks for the fast reply.
>>
>> Yes I have presentation mode. I didn't even try it to see if its working
>> with hibernate. The problem with that is that its inconvenient to check
>> it and uncheck it all the time.
>>
>> I will inevitably forget it sooner or later.
>>
> 
> Well, that's how you do it, presumably, with xfce power manager, which
> was the question. Obviously, you toggle presentation mode on and off as
> necessary, unless you're watching netflix 24/7, which might curdle your
> brain.
> 
> If not, there's 'caffeine'.
> 
> curty@einstein:~$ apt-cache show caffeine
> Package: caffeine
> Version: 2.8.3-3
> Installed-Size: 314
> Maintainer: Andrew Shadura 
> Architecture: all
> Depends: python3.5:any, python3:any (>= 3.3.2-2~), perl, gir1.2-gtk-3.0, 
> gir1.2-appindicator3-0.1, python3-xlib, python3-pkg-resources, python3-gi, 
> libnet-dbus-perl
> Description-en: prevent the desktop becoming idle in full-screen mode
>  Caffeine prevents the desktop from becoming idle when an application
>  is running full-screen. A desktop indicator ‘caffeine-indicator’
>  supplies a manual toggle, and the command ‘caffeinate’ can be used
>  to prevent idleness for the duration of any command.
> 
> This exhausts my extensive knowledge in the area.
> 



Re: Xfce Power Manger and watching movies full screen

2019-04-01 Thread Curt
On 2019-04-01, Georgios  wrote:
> Hi!
> First of all thanks for the fast reply.
>
> Yes I have presentation mode. I didn't even try it to see if its working
> with hibernate. The problem with that is that its inconvenient to check
> it and uncheck it all the time.
>
> I will inevitably forget it sooner or later.
>

Well, that's how you do it, presumably, with xfce power manager, which
was the question. Obviously, you toggle presentation mode on and off as
necessary, unless you're watching netflix 24/7, which might curdle your
brain.

If not, there's 'caffeine'.

curty@einstein:~$ apt-cache show caffeine
Package: caffeine
Version: 2.8.3-3
Installed-Size: 314
Maintainer: Andrew Shadura 
Architecture: all
Depends: python3.5:any, python3:any (>= 3.3.2-2~), perl, gir1.2-gtk-3.0, 
gir1.2-appindicator3-0.1, python3-xlib, python3-pkg-resources, python3-gi, 
libnet-dbus-perl
Description-en: prevent the desktop becoming idle in full-screen mode
 Caffeine prevents the desktop from becoming idle when an application
 is running full-screen. A desktop indicator ‘caffeine-indicator’
 supplies a manual toggle, and the command ‘caffeinate’ can be used
 to prevent idleness for the duration of any command.

This exhausts my extensive knowledge in the area.



Re: Xfce Power Manger and watching movies full screen

2019-04-01 Thread Georgios
Hi!
First of all thanks for the fast reply.

Yes I have presentation mode. I didn't even try it to see if its working
with hibernate. The problem with that is that its inconvenient to check
it and uncheck it all the time.

I will inevitably forget it sooner or later.


On 4/1/19 4:02 PM, Curt wrote:
> On 2019-04-01, Georgios  wrote:
>> Hi there!
>>
>> I'm running debian testing buster and I'm using xfce power manager.
>> In xfce power manager settings on "System" tab I activate "hibernate" on
>> 30 minutes and on the "Display" tab "Put to sleep" after 9 minutes and
>> "Switch off after" 10 minutes.
>>
>> When i watch videos on netflix (full screen) the display doesn't Switch
>> off in 10 minutes but the computer hibernate at 30 minutes.
>>
>> I do not want my laptop to transits on hibernate if I'm watching videos
>> full screen.
> 
> I really can't understand your attitude here.
> 
> Just kidding.
> 
> Don't you have a "Presentation Mode" checkbox somewhere in your xfce
> power manager settings (or right-clicking an icon somewhere or something)?
> 
> Or maybe
> 
>  xfconf-query -c xfce4-power-manager -p 
> /xfce4-power-manager/presentation-mode -T
> 
> I actually don't have xfce power manager here, so this is all completely
> theoretical.
> 
> Or are you already in presentation mode, and something else is intervening?
> 
>> I'm running debian buster with firefox-esr browser and xfce4.
>>
>> Thanks in advance for your help.
>>
>>
> 
> 



Re: Xfce Power Manger and watching movies full screen

2019-04-01 Thread Curt
On 2019-04-01, Georgios  wrote:
> Hi there!
>
> I'm running debian testing buster and I'm using xfce power manager.
> In xfce power manager settings on "System" tab I activate "hibernate" on
> 30 minutes and on the "Display" tab "Put to sleep" after 9 minutes and
> "Switch off after" 10 minutes.
>
> When i watch videos on netflix (full screen) the display doesn't Switch
> off in 10 minutes but the computer hibernate at 30 minutes.
>
> I do not want my laptop to transits on hibernate if I'm watching videos
> full screen.

I really can't understand your attitude here.

Just kidding.

Don't you have a "Presentation Mode" checkbox somewhere in your xfce
power manager settings (or right-clicking an icon somewhere or something)?

Or maybe

 xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode 
-T

I actually don't have xfce power manager here, so this is all completely
theoretical.

Or are you already in presentation mode, and something else is intervening?

> I'm running debian buster with firefox-esr browser and xfce4.
>
> Thanks in advance for your help.
>
>


-- 
“Let us again pretend that life is a solid substance, shaped like a globe,
which we turn about in our fingers. Let us pretend that we can make out a plain
and logical story, so that when one matter is despatched--love for instance--
we go on, in an orderly manner, to the next.” - Virginia Woolf, The Waves



Xfce Power Manger and watching movies full screen

2019-04-01 Thread Georgios
Hi there!

I'm running debian testing buster and I'm using xfce power manager.
In xfce power manager settings on "System" tab I activate "hibernate" on
30 minutes and on the "Display" tab "Put to sleep" after 9 minutes and
"Switch off after" 10 minutes.

When i watch videos on netflix (full screen) the display doesn't Switch
off in 10 minutes but the computer hibernate at 30 minutes.

I do not want my laptop to transits on hibernate if I'm watching videos
full screen.

I'm running debian buster with firefox-esr browser and xfce4.

Thanks in advance for your help.