You can configure hotkeys in your config.h
. To use your eclipse
example (with a rule to have it open in a specific tag1 when you hit Ctrle:
static const Rule rules[] = {
{ "Eclipse", NULL, NULL, 1 << 0, False, -1 },
...
/* commands */
static const char *eclipsecmd[] = { "/opt/eclipse/eclipse", NULL };
...
static Key keys[] = {
{ ControlMask, XK_e, spawn, {.v = eclipsecmd } },
The window will not grab the input, irrespective of where the focus is.
1. Ignore the rule if you don't want to assign eclipse
to the first tag...
As far as I know (but I'm no X expert), visibility is only tracked through VisibilityNotify
events, it isn't a state that you can query like IsViewable
. You'd need to get KDE to spit it out, I don't know if it can do that.
You may be solve your problem by sending the window a VisibilityNotify(state=VisibilityUnobscured)
event. I don't know if that's enough, you may also need to send a MapNotify
event. Here's some untested Python code to send a VisibilityNotify
event.
#! /usr/bin/env python
import re, sys, time
import Xlib.X, Xlib.XK, Xlib.display, Xlib.protocol
def parse_action(string):
state = {
'0': 0,
'1': 1,
'2': 2,
'unobscured': 0,
'partiallyobscured': 1,
'fullyobscured': 2,
'visibilityunobscured': 0,
'visibilitypartiallyobscured': 1,
'visibilityfullyobscured': 2,
}[string.lower()]
return state
def parse_window(display, arg):
wid = int(arg, 0)
return display.create_resource_object('window', wid)
def send_event(display, window, state):
window.send_event(Xlib.protocol.event.VisibilityNotify(window=window,
state=state))
display.sync()
if __name__ == "__main__":
display = Xlib.display.Display()
send_event(display, parse_window(display, sys.argv[1]), parse_action(sys.argv[2]))
Best Answer
The euphoniously named scrot takes screenshots from the command line...
It has a couple of simple options, including a time delay and image quality.
If you are wanting to take a shot in the console, and you are running a framebuffer, then you can use fbgrab.