-
-
Save Caellian/c15e704c375395bef6d7f38063089bce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function echo (what) | |
os.execute("echo -n '" .. what .. "'") | |
end | |
local function print_mods (mods) | |
echo("mods:\n") | |
for k,v in pairs(mods) do | |
if (v) then | |
echo("\t- " .. k .. "\n") | |
end | |
end | |
end | |
function conky_mouse (event) | |
if (event.type == "mouse_move") then | |
return false | |
end | |
echo("type: " .. event.type .. ",\n") | |
echo("x: " .. tostring(event.x) .. ", ") | |
echo("y: " .. tostring(event.y) .. ", ") | |
echo("x_abs: " .. tostring(event.x_abs) .. ", ") | |
echo("y_abs: " .. tostring(event.y_abs) .. ",\n") | |
echo("time: " .. tostring(event.time) .. ",\n") | |
if (event.type == "button_down") then | |
print_mods(event.mods) | |
echo("button: " .. tostring(event.button) .. "\n") | |
echo("button_code: " .. tostring(event.button_code) .. "\n") | |
elseif (event.type == "button_up") then | |
echo("button: " .. tostring(event.button) .. "\n") | |
echo("button_code: " .. tostring(event.button_code) .. "\n") | |
elseif (event.type == "mouse_scroll") then | |
echo("direction: " .. tostring(event.direction) .. "\n") | |
elseif (event.type == "mouse_move") then | |
print_mods(event.mods) | |
elseif (event.type == "mouse_enter") then | |
-- pass | |
elseif (event.type == "mouse_leave") then | |
-- pass | |
elseif (event.type == nil) then | |
echo("Unknown event type.") | |
end | |
return false | |
end | |
function echo (what) | |
os.execute("echo -n '" .. what .. "'") | |
end | |
local function print_mods (mods) | |
echo("mods:\n") | |
for k,v in pairs(mods) do | |
if (v) then | |
echo("\t- " .. k .. "\n") | |
end | |
end | |
end | |
function conky_mouse (event) | |
if (event.type == "mouse_move") then | |
return false | |
end | |
echo("type: " .. event.type .. ",\n") | |
echo("x: " .. tostring(event.x) .. ", ") | |
echo("y: " .. tostring(event.y) .. ", ") | |
echo("x_abs: " .. tostring(event.x_abs) .. ", ") | |
echo("y_abs: " .. tostring(event.y_abs) .. ",\n") | |
echo("time: " .. tostring(event.time) .. ",\n") | |
if (event.type == "button_down") then | |
print_mods(event.mods) | |
echo("button: " .. tostring(event.button) .. "\n") | |
echo("button_code: " .. tostring(event.button_code) .. "\n") | |
elseif (event.type == "button_up") then | |
echo("button: " .. tostring(event.button) .. "\n") | |
echo("button_code: " .. tostring(event.button_code) .. "\n") | |
elseif (event.type == "mouse_scroll") then | |
echo("direction: " .. tostring(event.direction) .. "\n") | |
elseif (event.type == "mouse_move") then | |
print_mods(event.mods) | |
elseif (event.type == "mouse_enter") then | |
-- pass | |
elseif (event.type == "mouse_leave") then | |
-- pass | |
elseif (event.type == nil) then | |
echo("Unknown event type.") | |
end | |
return false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment