使用 Hulu 桌面时禁用屏幕保护程序

Rob*_*Rob 5 screensaver

您的主文件夹中有一个文件,可让您为 Hulu 桌面配置一些设置:~/.huludesktop. 它有一个选项让脚本运行以禁用/启用屏幕保护程序。

我想写一个脚本,在看视频时被Hulu调用。看来,在Ubuntu 10.04中gconftool设置idle_activation_enabledidle_activation_enabled不再禁止在gnome-屏幕或监视器的睡眠。

这些是我尝试使用的命令:


gconftool-2 --set /apps/gnome-screensaver/idle_activation_enabled --type bool TRUE
gconftool-2 --set /apps/gnome-powermanager/idle_activation_enabled --type bool TRUE
Run Code Online (Sandbox Code Playgroud)

我也发现gnome-screensaver-command了该--inhibit选项,但是它在活动时会阻塞,这意味着我的挂起脚本很难适应这两个.huludesktop选项 ( suspend_script& resume_script)

我不想使用 Caffin,因为这是在 Ubuntu NBR 下,并且顶部面板空间很有价值。

msw*_*msw 3

$ cat ~/bin/hulu-suspend
#!/bin/sh
# wrapper for gnome-screensaver-command utility to inhibit and 
# refrain from inhibiting screensaver. comments and robustness
# are sacrificed for simplicity

case $0 in
    *suspend*) 
        gnome-screensaver-command --application-name Hulu \
            --reason "watchin stuffs" --inhibit & 
        gnome-screensaver-command --query ;;
    *resume*) 
        killall gnome-screensaver-command;
        gnome-screensaver-command --query ;;
    *) echo "usage $0: read the script $0"; exit 1;;
esac
$ chmod +x ~/bin/hulu-suspend
$ ln ~/bin/hulu-suspend ~/bin/hulu-resume
$ hulu-suspend
The screensaver is being inhibited by:
Application="Hulu"; Since="2010-09-30T03:30:15.169875Z"; 
    Reason="watchin stuffs";
$ ln ~/bin/hulu-suspend ~/bin/hulu-resume
$ ~/bin/hulu-resume
The screensaver is not inhibited
Run Code Online (Sandbox Code Playgroud)

已经过测试;它声称可以工作。享受。