forked from terceiro/awesome-freedesktop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
84 lines (62 loc) · 3.05 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
About
=====
This project aims to add support for freedesktop.org compliant desktop entries
and menu.
Installation
============
Just drop freedesktop/ folder in your ~/.config/awesome/ directory.
Main features
=============
* a freedesktop.org-compliant (or almost) applications menu
* a freedesktop.org-compliant (or almost) desktop
* a (yet limited) icon lookup function.
Icon themes
===========
You can choose any icon theme that's installed in /usr/share/icons/. To define
your icon theme, you can do the following before you require
"freedesktop.menu", but after you require "freedesktop.utils" (see example
usage below):
freedesktop.utils.icon_theme = 'gnome'
You can also use more than one icon theme, by assigning a Lua table containing
a list of themes.
freedesktop.utils.icon_theme = { 'Mist', 'gnome' }
When you use a list of icon themes, icons will be looked up in themes list in
the order you specified. The first theme containing the desired icon will be
used (that happens once for each icon). Note that if the icon theme already
specifies another icon theme as fallback, that is already taken care of for
you.
Usage example
=============
You can use the freedesktop module in your awesome configuration
(~/.config/awesome/rc.lua) like the example below. If you are a Debian user,
you can also uncomment the two lines that insert the Debian menu together with
the rest of the items.
-- applications menu
require('freedesktop.utils')
freedesktop.utils.terminal = terminal -- default: "xterm"
freedesktop.utils.icon_theme = 'gnome' -- look inside /usr/share/icons/, default: nil (don't use icon theme)
require('freedesktop.menu')
-- require("debian.menu")
menu_items = freedesktop.menu.new()
myawesomemenu = {
{ "manual", terminal .. " -e man awesome", freedesktop.utils.lookup_icon({ icon = 'help' }) },
{ "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua", freedesktop.utils.lookup_icon({ icon = 'package_settings' }) },
{ "restart", awesome.restart, freedesktop.utils.lookup_icon({ icon = 'gtk-refresh' }) },
{ "quit", awesome.quit, freedesktop.utils.lookup_icon({ icon = 'gtk-quit' }) }
}
table.insert(menu_items, { "awesome", myawesomemenu, beautiful.awesome_icon })
table.insert(menu_items, { "open terminal", terminal, freedesktop.utils.lookup_icon({icon = 'terminal'}) })
-- table.insert(menu_items, { "Debian", debian.menu.Debian_menu.Debian, freedesktop.utils.lookup_icon({ icon = 'debian-logo' }) })
mymainmenu = awful.menu.new({ items = menu_items, width = 150 })
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
-- desktop icons
require('freedesktop.desktop')
for s = 1, screen.count() do
freedesktop.desktop.add_applications_icons({screen = s, showlabels = true})
freedesktop.desktop.add_dirs_and_files_icons({screen = s, showlabels = true})
end
License
=======
Copyright © 2009-2011 Antonio Terceiro <[email protected]>
This code is licensed under the same terms as Awesome itself.