diff --git a/freedesktop/desktop.lua b/freedesktop/desktop.lua index 6209ae3..53ab0ed 100644 --- a/freedesktop/desktop.lua +++ b/freedesktop/desktop.lua @@ -1,4 +1,3 @@ -local wibox = wibox local widget = widget local screen = screen local image = image diff --git a/freedesktop/freedesktop.lua b/freedesktop/freedesktop.lua index 04236b6..ad7c677 100644 --- a/freedesktop/freedesktop.lua +++ b/freedesktop/freedesktop.lua @@ -12,8 +12,8 @@ require('freedesktop.desktop') require('freedesktop.menu') -- require("debian.menu") -freedesktop.utils.terminal = terminal -freedesktop.utils.icon_theme = 'gnome' -- look inside /usr/share/icons/, default: nil (don't use icon theme) +freedesktop.utils.terminal = terminal -- defined in rc.lua, otherwise define it here (default: "xterm") +freedesktop.utils.icon_theme = 'gnome' -- choose your favourite from /usr/share/icons/ (default: nil) menu_items = freedesktop.menu.new() @@ -25,14 +25,14 @@ myawesomemenu = { } 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}) + --freedesktop.desktop.add_application_icons({screen = s, showlabels = true}) + --freedesktop.desktop.add_dirs_and_file_icons({screen = s, showlabels = true}) + freedesktop.desktop.add_desktop_icons({screen = s, showlabels = true}) end 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 = 200 }) - +mymainmenu = awful.menu.new({ items = menu_items, theme = { width = 150 } }) mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = mymainmenu }) diff --git a/freedesktop/menu.lua b/freedesktop/menu.lua index a465661..8595961 100644 --- a/freedesktop/menu.lua +++ b/freedesktop/menu.lua @@ -71,17 +71,17 @@ function new(arg) end local menu = { - { "Accessories", programs["Utility"], utils.lookup_icon({ icon = 'applications-accessories.png' }) }, - { "Development", programs["Development"], utils.lookup_icon({ icon = 'applications-development.png' }) }, - { "Education", programs["Education"], utils.lookup_icon({ icon = 'applications-science.png' }) }, - { "Games", programs["Game"], utils.lookup_icon({ icon = 'applications-games.png' }) }, - { "Graphics", programs["Graphics"], utils.lookup_icon({ icon = 'applications-graphics.png' }) }, - { "Internet", programs["Network"], utils.lookup_icon({ icon = 'applications-internet.png' }) }, - { "Multimedia", programs["AudioVideo"], utils.lookup_icon({ icon = 'applications-multimedia.png' }) }, - { "Office", programs["Office"], utils.lookup_icon({ icon = 'applications-office.png' }) }, - { "Other", programs["Other"], utils.lookup_icon({ icon = 'applications-other.png' }) }, - { "Settings", programs["Settings"], utils.lookup_icon({ icon = 'preferences-desktop.png' }) }, - { "System Tools", programs["System"], utils.lookup_icon({ icon = 'applications-system.png' }) }, + { "Accessories", programs["Utility"], utils.lookup_icon({ icon = 'applications-accessories' }) }, + { "Development", programs["Development"], utils.lookup_icon({ icon = 'applications-development' }) }, + { "Education", programs["Education"], utils.lookup_icon({ icon = 'applications-science' }) }, + { "Games", programs["Game"], utils.lookup_icon({ icon = 'applications-games' }) }, + { "Graphics", programs["Graphics"], utils.lookup_icon({ icon = 'applications-graphics' }) }, + { "Internet", programs["Network"], utils.lookup_icon({ icon = 'applications-internet' }) }, + { "Multimedia", programs["AudioVideo"], utils.lookup_icon({ icon = 'applications-multimedia' }) }, + { "Office", programs["Office"], utils.lookup_icon({ icon = 'applications-office' }) }, + { "Other", programs["Other"], utils.lookup_icon({ icon = 'applications-other' }) }, + { "Settings", programs["Settings"], utils.lookup_icon({ icon = 'preferences-desktop' }) }, + { "System Tools", programs["System"], utils.lookup_icon({ icon = 'applications-system' }) }, } -- Removing empty entries from menu diff --git a/freedesktop/utils.lua b/freedesktop/utils.lua index c5247c3..b20edc2 100644 --- a/freedesktop/utils.lua +++ b/freedesktop/utils.lua @@ -6,12 +6,15 @@ local table = table local type = type local ipairs = ipairs local pairs = pairs +local lgi = require('lgi') +local Gtk = lgi.Gtk module("freedesktop.utils") terminal = 'xterm' icon_theme = nil +local gtk_icon_theme = Gtk.IconTheme.get_default() all_icon_sizes = { '128x128', @@ -23,7 +26,9 @@ all_icon_sizes = { '32x32', '24x24', '22x22', - '16x16' + '16x16', + '8x8', + 'scalable' } all_icon_types = { 'apps', @@ -59,10 +64,16 @@ function file_exists(filename) end function lookup_icon(arg) - if arg.icon:sub(1, 1) == '/' and (arg.icon:find('.+%.png') or arg.icon:find('.+%.xpm')) then + if arg.icon:sub(1, 1) == '/' and (arg.icon:find('.+%.png') or arg.icon:find('.+%.xpm') or arg.icon:find('.+%.svg')) then -- icons with absolute path and supported (AFAICT) formats return arg.icon else + local gtk_icon_info = Gtk.IconTheme.lookup_icon(gtk_icon_theme, arg.icon, 48, 0) + if gtk_icon_info then + filename = Gtk.IconInfo.get_filename(gtk_icon_info) + if filename then return filename end + end + local icon_path = {} local icon_themes = {} local icon_theme_paths = {} @@ -97,12 +108,14 @@ function lookup_icon(arg) table.insert(icon_path, '/usr/share/app-install/icons/') for i, directory in ipairs(icon_path) do - if (arg.icon:find('.+%.png') or arg.icon:find('.+%.xpm')) and file_exists(directory .. arg.icon) then + if (arg.icon:find('.+%.png') or arg.icon:find('.+%.xpm') or arg.icon:find('.+%.svg')) and file_exists(directory .. arg.icon) then return directory .. arg.icon elseif file_exists(directory .. arg.icon .. '.png') then return directory .. arg.icon .. '.png' elseif file_exists(directory .. arg.icon .. '.xpm') then return directory .. arg.icon .. '.xpm' + elseif file_exists(directory .. arg.icon .. '.svg') then + return directory .. arg.icon .. '.svg' end end end diff --git a/themes/holo/icons/bg_focus_noline.png b/themes/holo/icons/bg_focus_noline.png index 5a43e8f..3126d98 100644 Binary files a/themes/holo/icons/bg_focus_noline.png and b/themes/holo/icons/bg_focus_noline.png differ diff --git a/themes/rainbow/icons/awesome_icon.png b/themes/rainbow/icons/awesome_icon.png new file mode 100644 index 0000000..bd2bff1 Binary files /dev/null and b/themes/rainbow/icons/awesome_icon.png differ diff --git a/themes/rainbow/icons/square_sel2.png b/themes/rainbow/icons/square_sel2.png new file mode 100644 index 0000000..0485d33 Binary files /dev/null and b/themes/rainbow/icons/square_sel2.png differ diff --git a/themes/rainbow/theme.lua b/themes/rainbow/theme.lua index 1938b11..8eb7d67 100644 --- a/themes/rainbow/theme.lua +++ b/themes/rainbow/theme.lua @@ -26,6 +26,16 @@ theme.taglist_bg_focus = "#3D3D3D" theme.menu_height = "16" theme.menu_width = "140" +theme.ocol = "" +theme.ccol = "" +theme.tasklist_sticky = theme.ocol .. " [S]" .. theme.ccol +theme.tasklist_ontop = theme.ocol .. " [T]" .. theme.ccol +theme.tasklist_floating = theme.ocol .. " [F]" .. theme.ccol +theme.tasklist_maximized_horizontal = theme.ocol .. "[M] " .. theme.ccol +theme.tasklist_maximized_vertical = "" +theme.tasklist_disable_icon = true + +theme.awesome_icon = theme.dir .. "/icons/awesome_icon.png" theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png" theme.taglist_squares_sel = theme.dir .. "/icons/square_sel2.png" theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png" @@ -45,8 +55,13 @@ theme.layout_txt_fullscreen = "[F]" theme.layout_txt_magnifier = "[M]" theme.layout_txt_floating = "[*]" -theme.tasklist_floating = "" -theme.tasklist_maximized_horizontal = "" -theme.tasklist_maximized_vertical = "" +theme.layout_txt_tilegaps = "[tg]" +theme.layout_txt_tileleftgaps = "[tlg]" +theme.layout_txt_tilebottomgaps = "[tbg]" +theme.layout_txt_tiletopgaps = "[ttg]" +theme.layout_txt_fairhgaps = "[fhg]" +theme.layout_txt_fairvgaps = "[fvg]" +theme.layout_txt_spiralgaps = "[spg]" +theme.layout_txt_dwindlegaps = "[dwg]" return theme