2008-02-16

Linux - Disabling the Screensaver, xkill-Style

Posted in Geek Stuff at 19:48

Ever wanted a nice comfy way to tell your system “Disable the screensaver until this window closes”? If so, drop this shell script onto your system and make sure that you’ve got the xwininfo, xdg-screensaver, and awk commands installed.

#!/bin/sh

WID=`xwininfo -int | awk '/Window id/ {print $4}'`
xdg-screensaver suspend "$WID"

When you run the script, it’ll grab the cursor like xkill does. Once you pick a window, the screensaver will be disabled until it closes. You can also create a script to reverse the process by replacing “suspend” with “resume” in the last line.

RSS feed for comments on this post · TrackBack URL

Leave a Comment

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.

Bad Behavior has blocked 266 access attempts in the last 7 days.