Thanks for sharing.
It seems a cool way to do it for those (like me) who don't like to have skippy-xd on board. the old and good cb-hotcorners script by corenominal might be another way to launch it instead of xautolock if you don't mind to use python. It needs wmctrl, xdotool & python-xlib
cb-hotcorners:
#!/usr/bin/env python
# cb-hotcorners:
# A script for adding hot corners to Openbox.
# Written for CrunchBang Linux <http://crunchbang.org/>
# by Philip Newborough <corenominal@corenominal.org>
# ----------------------------------------------------------------------
# License:
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
# ----------------------------------------------------------------------
from Xlib import display
from Xlib.ext.xtest import fake_input
from Xlib import X
from subprocess import Popen, PIPE, STDOUT
import sys, time, os, ConfigParser, re
check_intervall = 0.2
p = Popen(['xdotool','getdisplaygeometry'], stdout=PIPE, stderr=STDOUT)
Dimensions = p.communicate()
Dimensions = Dimensions[0].replace('\n', '')
Dimensions = Dimensions.split(' ')
width = int(Dimensions[0])
height = int(Dimensions[1])
hw = width / 2
rt = width - 1
bt = height - 1
def print_usage():
print "cb-hotcorners: usage:"
print " --help show this message and exit"
print " --kill attempt to kill any running instances"
print " --daemon run daemon and listen for cursor triggers"
print ""
exit()
if len(sys.argv) < 2 or sys.argv[1] == "--help":
print_usage()
elif sys.argv[1] == "--kill":
print "Attempting to kill any running instances..."
os.system('pkill -9 -f cb-hotcorners')
exit()
elif sys.argv[1] == "--daemon":
Config = ConfigParser.ConfigParser()
cfgdir = os.getenv("HOME")+"/.config/cb-hotcorners"
rcfile = cfgdir+"/cb-hotcornersrc"
bounce = 40
disp = display.Display()
root=display.Display().screen().root
def mousepos():
data = root.query_pointer()._data
return data["root_x"], data["root_y"], data["mask"]
def mousemove(x, y):
fake_input(disp, X.MotionNotify, x=x, y=y)
disp.sync()
try:
cfgfile = open(rcfile)
except IOError as e:
if not os.path.exists(cfgdir):
os.makedirs(cfgdir)
cfgfile = open(rcfile,'w')
Config.add_section('Hot Corners')
Config.set('Hot Corners','top_left_corner_command', 'gmrun')
Config.set('Hot Corners','top_right_corner_command', '')
Config.set('Hot Corners','bottom_left_corner_command', '')
Config.set('Hot Corners','bottom_right_corner_command', '')
Config.write(cfgfile)
cfgfile.close()
while True:
Config.read(rcfile)
time.sleep(check_intervall)
pos = mousepos()
if pos[0] == 0 and pos[1] == 0:
if Config.get('Hot Corners','top_left_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == 0 and pos[1] == 0:
mousemove(pos[0] + bounce, pos[1] + bounce)
os.system('(' + Config.get('Hot Corners','top_left_corner_command') + ') &')
mousemove(pos[0] + bounce, pos[1] + bounce)
time.sleep(2)
elif pos[0] == rt and pos[1] == 0:
if Config.get('Hot Corners','top_right_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == rt and pos[1] == 0 :
mousemove(pos[0] - bounce, pos[1] + bounce)
os.system('(' + Config.get('Hot Corners','top_right_corner_command') + ') &')
mousemove(pos[0] - bounce, pos[1] + bounce)
time.sleep(2)
elif pos[0] == 0 and pos[1] == bt:
if Config.get('Hot Corners','bottom_left_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == 0 and pos[1] == bt:
mousemove(pos[0] + bounce, pos[1] - bounce)
os.system('(' + Config.get('Hot Corners','bottom_left_corner_command') + ') &')
mousemove(pos[0] + bounce, pos[1] - bounce)
time.sleep(2)
elif pos[0] == rt and pos[1] == bt:
if Config.get('Hot Corners','bottom_right_corner_command') != '':
time.sleep(0.2)
pos = mousepos()
if pos[0] == rt and pos[1] == bt:
mousemove(pos[0] - bounce, pos[1] - bounce)
os.system('(' + Config.get('Hot Corners','bottom_right_corner_command') + ') &')
mousemove(pos[0] - bounce, pos[1] - bounce)
time.sleep(2)
else:
print_usage()
You can add it to the fluxbox startup (or ~/.xinitrc, or whatever,,,) and at fist run it will create a ~/.config/cb-hotcornersrc file that you can edit for your tricks. Here's an example: (this is an abandoned/forgotten config attempt to get some xdotool goodness from it. Some of the commented lines may not work, but you'll get the idea. All this reminded me II should go over it again).
[Hot Corners]
#TOP LEFT
top_left_corner_command = rofi -show window -font "snap 10" -fg "#505050" -bg "#000000" -hlfg "#ffb964" -hlbg "#000000" -o 85
#top_left_corner_command = xdotool behave_screen_edge top exec notify-send test
#top_left_corner_command = xdotool key --clearmodifiers "alt+Tab"
#top_left_corner_command = xdotool key "alt+Tab"
#TOP RIGHT
#top_right_corner_command = rofi -show window -font "snap 10" -fg "#505050" -bg "#000000" -hlfg "#ffb964" -hlbg "#000000" -o 85
top_right_corner_command = xfce4-terminal --drop-down
#top_right_corner_command = xdotool behave_screen_edge top exec notify-send test
#BOTTOM LEFT
#bottom_left_corner_command = dmenu_extended_run
#bottom_left_corner_command = xdotool key --clearmodifiers "alt+space" ## knupfer
#bottom_left_corner_command = xdotool key --clearmodifiers "alt+mousewheel" ## Cycle desktops???
#bottom_left_corner_command = xdotool key --clearmodifiers "alt+Tab"
#bottom_left_corner_command = xdotool key "alt+Tab"
#bottom_left_corner_command = xdotool key "alt+F4"
bottom_left_corner_command = rofi -show run -font "snap 10" -fg "#505050" -bg "#000000" -hlfg "#ffb964" -hlbg "#000000" -o 85
#BOTTOM RIGHT
bottom_right_corner_command = xdotool behave_screen_edge top exec notify-send test
#bottom_right_corner_command = rofi -show run -font "snap 10" -fg "#505050" -bg "#000000" -hlfg "#ffb964" -hlbg "#000000" -o 85
#bottom_right_corner_command = xfce4-appfinder --collapsed
#bottom_right_corner_command = xdotool key "alt+Tab"
#bottom_right_corner_command = xdotool key --clearmodifiers "super+mousewheel"