Skip to content

Commit

Permalink
Merge pull request #9 from actionless/devel
Browse files Browse the repository at this point in the history
Hotkeys widget; widgets' refactoring; Xresources theme initial support.
  • Loading branch information
actionless committed Sep 17, 2014
2 parents 92bb1f3 + e9ab444 commit 14817ad
Show file tree
Hide file tree
Showing 99 changed files with 2,885 additions and 2,572 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
*.bak
.~
local.lua

runtest.sh
inspect.lua

awful
beautiful.lua
gears
menubar
naughty.lua
wibox
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "eminent"]
path = eminent
[submodule "third_party/eminent"]
path = third_party/eminent
url = https://github.com/guotsuan/eminent.git
branch = master
22 changes: 0 additions & 22 deletions CHANGELOG.txt

This file was deleted.

Binary file added Meslo LG S Regular for Lcarsline.otf
Binary file not shown.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,41 @@ awesome_config
==============

example of config/local.lua: https://gist.github.com/actionless/229eef7795915068bad9

### Default theme appearance:

![Screenshot](http://fc08.deviantart.net/fs70/f/2014/213/7/0/monovedek_set_____by_actionless-d7sr317.png "Screenshot")

### Keyboard widget appearance (with different themes)

#### Monovedek theme with transparency and blur:

![hotkeys_monovedek](http://i.imgur.com/auQdZC5.png "hotkeys_monovedek")

#### Monovedek theme without transparency and blur:

![hotkeys_monovedek](http://i.imgur.com/ygsVm7E.png "hotkeys_monovedek")

#### "LCARS modern" theme without transparency and blur:

![hotkeys_lm](http://i.imgur.com/t6XRD7m.png "hotkeys_lm")

#### "LCARS xresources" with "jwr_dark" xresources theme without transparency and blur:

![hotkeys_xjwr](http://i.imgur.com/y4o3vY0.png "hotkeys_xjwr")

#### "Pokemon Light" theme without transparency and blur:

![hotkeys_pokemon_light](http://i.imgur.com/hgijuIo.png "hotkeys_pokemon_light")

#### "Pokemon Dark" theme without transparency and blur:

![pokemon_dark](http://i.imgur.com/BWnzpfh.png?1 "pokemon_dark")

#### "Gnome Noble Dark" theme without transparency and blur:

![hotkeys_noble_dark](http://i.imgur.com/XfpBqrV.png "hotkeys_noble_dark")

![noble_dark](http://i.imgur.com/AXGAT3Q.png "noble_dark")


45 changes: 0 additions & 45 deletions actionless.rc.lua

This file was deleted.

101 changes: 13 additions & 88 deletions actionless/async.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
--[[
Licensed under GNU General Public License v2
20?? Alexander Yakushev
2014 Yauheni Kirylau
--]]

-- Asynchronous io.popen for Awesome WM.
-- How to use...
-- ...asynchronously:
-- async.execute('wscript -Kiev', function(f) wwidget.text = f:read("*l") end)
-- ...synchronously
-- wwidget.text = async.demand('wscript -Kiev', 5):read("*l") or "Error"
-- How to use:
-- async.execute('echo hello!', function(str) widget.text = str end)

local awful = require('awful')

Expand All @@ -19,22 +22,6 @@ local function next_id()
return string.format("%d", async.id_counter)
end

function async.wait(seconds, callback)
local id = next_id()
async.request_table[id] = {callback = callback}
local req = string.format(
[[ bash -c 'sleep %s;
echo "async.deliver_timer(\"%s\")" | awesome-client' 2> /dev/null ]],
seconds, id)
awful.util.spawn_with_shell(req, false)
return id
end

function async.deliver_timer(id)
async.request_table[id].callback()
async.request_table[id] = nil
end

-- Sends an asynchronous request for an output of the shell command.
-- @param command Command to be executed and taken output from
-- @param callback Function to be called when the command finishes
Expand All @@ -48,8 +35,11 @@ function async.execute(command, callback)
[[
echo async.pipe_multiline_done\(\"%q\", \""$(%s | %s)"\"\) | awesome-client;
]],
id, command:gsub('"','\"'), [[awk 1 ORS='\\\\n' | sed 's/"/\\"/g']]
)) --:-'")]])) that beardy smiley is helping my stupid syntax highlighter
--"]]-- syntax highlighter fix
id,
command:gsub('"','\"'),
[[awk 1 ORS='\\\\n' | sed 's/"/\\"/g']]
))
return id
end

Expand All @@ -60,69 +50,4 @@ function async.pipe_multiline_done(id, str)
async.request_table[id] = nil
end

-- Sends an asynchronous request for an output of the shell command.
-- @param command Command to be executed and taken output from
-- @param callback Function to be called when the command finishes
-- @return Request ID
function async.execute_iter(command, callback)
local id = next_id()
async.request_table[id] = {
callback = callback,
table = {}}
awful.util.spawn_with_shell(string.format(
[[ sh -c '
%s | while read line; do
echo "async.pipe_consume(\"%q\", \"$line\")" | awesome-client;
done
echo "async.pipe_finish(\"%q\")" | awesome-client;'
]],
string.gsub(command, "'", "'\\''"), id, id
))
return id
end

-- Consumes command's output line by line
-- @param id Request ID
-- @param line The next line of the command's output
function async.pipe_consume(id, line)
if not async.request_table[id] then return end
async.request_table[id].table:insert(line)
end

-- Calls the remembered callback function on the output of the shell
-- command.
-- @param id Request ID
function async.pipe_finish(id)
if not async.request_table[id] then return end
async.request_table[id].callback(
async.request_table[id].table)
async.request_table[id] = nil
end

------------------------------------------------------------------------------

async.folder = "/tmp/async"
async.file_template = async.folder .. '/req'
-- Create a directory for asynchell response files
os.execute("mkdir -p " .. async.folder)

-- Sends a synchronous request for an output of the command. Waits for
-- the output, but if the given timeout expires returns nil.
-- @param command Command to be executed and taken output from
-- @param timeout Maximum amount of time to wait for the result
-- @return File handler on success, nil otherwise
function async.demand(command, timeout)
local id = next_id()
local tmpfname = async.file_template .. id
local f = io.popen(string.format(
[[ (%s > %s; echo async_done) &
(sleep %s; echo async_timeout) ]],
command, tmpfname, timeout))
local result = f:read("*line")
if result == "async_done" then
return io.open(tmpfname)
end
end


return async
Loading

0 comments on commit 14817ad

Please sign in to comment.