Comments (16)
👍
from awesome.
awful.key
might get changed to accept an optional table of arguments, where desc
would be part of (to make it more flexible for future changes). But then, adding desc
as a new arg by itself would make it easier to use by default (no table/key needed).
from awesome.
mb it can be like:
function key.new(mod, _key, press, release, ...)
allkeys[mod][_key]['keydata'] = ...
desc = foo.keydata[1]
or even add some workaround do omit release by default, but use it from keydata and shift keydata by one if first member is function:
function key.new(mod, _key, press, ...)
local keydata = ...
local release
if type(keydata[1]) == 'function' then
release = keydata[1]
keydata = h_table.range(keydata, 2)
end
allkeys[mod][_key]['keydata'] = keydata
from awesome.
Just as a side note, I also would like to have categories. I made a module for that, but after implementing it, the syntax isn't as nice looking as I thought it would be:
https://github.com/Elv13/awesome-configs/blob/master/shortcuts.lua#L136
The reason for this is to implement this as the welcome page:
![http://upload.wikimedia.org/wikipedia/commons/9/93/Ubuntu_Unity_Keyboard_shortcuts_-_En.png]
Many complains about tiled WM is that they are hard to learn (meh...) because they lack WYSIWYG hints. This kind of welcome screen help with that. Actionless edition with the visual keyboard layout is very useful too, maybe an hybrid of both could be used. The Shorter
module used here have many issues, so I don't think it is the way forward versus upgrading awful.key. However, maybe we could break things a little more to make this use case better covered. What do you think?
from awesome.
so the solution with ...
should help with categories, ie it can be like
awful.key({modkey}, 'a', do_action, 'Do some action', 'Misc stuff')
category = foo.keydata[2]
from awesome.
maybe more like
awful.key({modkey}, 'a', do_action, {desc='Do some action', category='Misc stuff'})
?
from awesome.
it's more straight-forward, i am agree.
but a tricky thing to remember here what it will be repeated about 100 times in a row, so imho specifiying table key names (desc, category) every time will be too verbose
from awesome.
At the same time, if we want to add another parameter at some point, the function will have 6 arguments, this start to be problematic. It also allow shortcuts helper implementations like yours and mine to have different metadata fields (color, icons?)
from awesome.
yup, if starting to think about more additional parameters using table keys will make sense and will be less complicated, but i still would like to make it like:
function key.new(mod, _key, press, release, keydata)
if type(release) == 'table' and not keydata then
keydata = release
release = nil
end
btw, in my thing only description and category are defined.
colors for categories are set in widget itself, in depend on category.
from awesome.
is example in a message above seems ok to you, guys?
also there is a second topic to discuss is how to store bindings?
i was thinking about storing it like:
{
"joined_modifiers_repr": {
"key": { keydata },
"key2": { keydata },
},
"Control_Mod4": {
"r": { keydata },
"q": { keydata }
}
}
what do you think about it?
currently to get representation of modifiers for key i am also sorting it for clarity: https://github.com/actionless/awesome_config/blob/devel/actionless/hotkeys.lua#L76-L84
after some agreement on both cases i will start implementing it
from awesome.
also just noticed GNOME plans on that topic:
https://wiki.gnome.org/Design/OS/HelpOverlay
from awesome.
@blueyed @Elv13 any comments on code examples above?
from awesome.
bump
from awesome.
@actionless
I think your code examples are fine.
from awesome.
Yes, I like the storage example. awful.util.table.join
"format" is unusable.
from awesome.
If I understand correctly, the merge of #421 fixed this
from awesome.
Related Issues (20)
- Hotkeys overwritten by KDE when system wakes up HOT 1
- Notification tray icon issue w/ Indicator Sound Switcher HOT 5
- Attach clients into the stack area when you toggle a new tag into view
- prompt hooks keep making prompt stopped HOT 1
- Focus by hover ignored after layout change to max HOT 1
- Border around Firefox developer tools popup HOT 11
- awesomeWM workspaces and skippy-xd HOT 3
- `urgent = false` not working HOT 3
- BUG: `gears.timer {call_now=true}` doesn't pass `self` (`ret`) HOT 1
- Incorrect completion_callback usage example
- Errors returned with luajit but not lua 5.4 HOT 2
- Mouse events ignored by application only when managed by Awesome
- Lgi FFI error on startup HOT 1
- Multiple definition error while compiling on a 32bit machine. HOT 1
- GTK theme breaks if user's locale uses commas instead of dots as decimal separators HOT 11
- How to make new notifications update to existing notifications? HOT 2
- workaround for pystray python tray icon programs HOT 2
- Shell environment not correct while using `awful.spawn_with_shell`? HOT 4
- Stdout not working correctly for awful.spawn.with_line_callback but stderr does HOT 4
- awesomewm freezes occasionally with E: awesome: Failed to load 'userdata: (nil)' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome.