switched freedesktop -> menugen + little fixes

This commit is contained in:
luke bonham 2014-10-04 12:10:28 +02:00
parent b7016c15a1
commit acb830ab78
33 changed files with 65 additions and 602 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
rc.lua
wall.png

View File

@ -35,7 +35,7 @@ Notable features
- Custom layouts
- No borders when there's only one visible client
- Powerful volume bar
- Freedesktop menu
- Menubar menu
- Vi-like client focus
- Nice client border (colors change along with processes status)
- Non-empty tag browsing
@ -106,7 +106,7 @@ Then, eventually customize your ``rc.lua``, and restart Awesome (``Mod4 + ctrl +
Notes
=====
Be sure to have the latest **stable** versions of Lua, Lua-lgi, and Awesome.
Be sure to have the latest **stable** versions of Lua and Awesome.
Complements are provided by lain_: be sure to meet its dependencies_.
@ -116,10 +116,6 @@ Every theme has a colorscheme_.
Blackburn and Dremora use Icons_: be sure to have bitmaps enabled if running under Debian_ or Ubuntu_.
Freedesktop uses ``/etc/mime.types``, so be sure to have MIME support installed.
Eminent, freedesktop and scratchdrop are third-party softwares: **either disable them or rely on their creators if they cause you** slowdowns_ **or** issues_ **.**
Feel free to email me if you have any request.
.. _BY-NC-SA: http://creativecommons.org/licenses/by-nc-sa/3.0/
@ -140,5 +136,3 @@ Feel free to email me if you have any request.
.. _Icons: https://github.com/copycat-killer/dots/tree/master/.fonts
.. _Debian: http://weiwu.sdf.org/100921.html
.. _Ubuntu: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts
.. _slowdowns: https://github.com/copycat-killer/awesome-copycats/issues/24#issuecomment-33289499
.. _issues: https://github.com/copycat-killer/awesome-copycats/issues/12

View File

@ -1,10 +0,0 @@
This is [awesome-freedesktop](https://github.com/terceiro/awesome-freedesktop),
adapted to work within [awesome-copycats](https://github.com/copycat-killer/awesome-copycats).
License
=======
Copyright © 2009-2011 Antonio Terceiro <terceiro@softwarelivre.org>
This code is licensed under the same terms as Awesome WM itself: [GNU
GPLv2](http://www.gnu.org/licenses/gpl-2.0.txt).

View File

@ -1,127 +0,0 @@
local widget = widget
local screen = screen
local image = image
local button = button
local table = table
local ipairs = ipairs
local awful = require("awful")
local utils = require("freedesktop.utils")
local wibox = require("wibox")
local capi = { screen = screen }
module("freedesktop.desktop")
local current_pos = {}
local iconsize = { width = 48, height = 48 }
local labelsize = { width = 130, height = 20 }
local margin = { x = 20, y = 20 }
function add_icon(settings)
local s = settings.screen
if not current_pos[s] then
current_pos[s] = { x = (capi.screen[s].geometry.width - iconsize.width - margin.x), y = 40 }
end
local totheight = (settings.icon and iconsize.height or 0) + (settings.label and labelsize.height or 0)
if totheight == 0 then return end
if current_pos[s].y + totheight > capi.screen[s].geometry.height - 40 then
current_pos[s].x = current_pos[s].x - labelsize.width - iconsize.width - margin.x
current_pos[s].y = 40
end
if (settings.icon) then
icon = awful.widget.button({ image = settings.icon })
local newbuttons = icon:buttons({}, 1, nil, settings.click)
table.insert(newbuttons, button({}, 1, nil, settings.click));
icon:buttons(newbuttons)
icon_container = wibox({ position = "floating", screen = s, bg = "#00000000" })
icon_container.widgets = { icon }
icon_container:geometry({
width = iconsize.width,
height = iconsize.height,
y = current_pos[s].y,
x = current_pos[s].x
})
icon_container.screen = s
current_pos[s].y = current_pos[s].y + iconsize.height + 5
end
if (settings.label) then
caption = wibox.widget.textbox()
caption.ellipsize = "middle"
caption.text = settings.label
caption:buttons({
button({ }, 1, settings.click)
})
caption_container = wibox({ position = "floating", screen = s, bg = "#00000000" })
caption_container.widgets = { caption }
caption_container:geometry({
width = labelsize.width,
height = labelsize.height,
y = current_pos[s].y,
x = current_pos[s].x - labelsize.width + iconsize.width
})
caption_container.screen = s
end
current_pos[s].y = current_pos[s].y + labelsize.height + margin.y
end
--- Adds subdirs and files icons to the desktop
-- @param dir The directory to parse, (default is ~/Desktop)
-- @param showlabels Shows icon captions (default is false)
function add_applications_icons(arg)
for i, program in ipairs(utils.parse_desktop_files({
dir = arg.dir or '~/Desktop/',
icon_sizes = {
iconsize.width .. "x" .. iconsize.height,
"128x128", "96x96", "72x72", "64x64", "48x48",
"36x36", "32x32", "24x24", "22x22", "16x6"
}
})) do
if program.show then
add_icon({
label = arg.showlabels and program.Name or nil,
icon = program.icon_path,
screen = arg.screen,
click = function () awful.util.spawn(program.cmdline) end
})
end
end
end
--- Adds subdirs and files icons to the desktop
-- @param dir The directory to parse
-- @param showlabels Shows icon captions
-- @param open_with The program to use to open clicked files and dirs (i.e. xdg_open, thunar, etc.)
function add_dirs_and_files_icons(arg)
arg.open_with = arg.open_width or 'thunar'
for i, file in ipairs(utils.parse_dirs_and_files({
dir = arg.dir or '~/Desktop/',
icon_sizes = {
iconsize.width .. "x" .. iconsize.height,
"128x128", "96x96", "72x72", "64x64", "48x48",
"36x36", "32x32", "24x24", "22x22", "16x6"
}
})) do
if file.show then
add_icon({
label = arg.showlabels and file.filename or nil,
icon = file.icon,
screen = arg.screen,
click = function () awful.util.spawn(arg.open_with .. ' ' .. file.path) end
})
end
end
end
function add_desktop_icons(args)
add_applications_icons(args)
add_dirs_and_files_icons(args)
end

View File

@ -1,37 +0,0 @@
-- This is an usage example
-- Modify according to your preferences
-- 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 (11 and 33).
local awful = require("awful")
local beautiful = require("beautiful")
require("freedesktop")
require("freedesktop.utils")
-- require("debian.menu")
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()
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' }) }
}
for s = 1, screen.count() do
--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, theme = { width = 150 } })
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = mymainmenu })

View File

@ -1,5 +0,0 @@
require("freedesktop.utils")
require("freedesktop.menu")
require("freedesktop.desktop")
module("freedesktop")

View File

@ -1,97 +0,0 @@
-- Grab environment
local utils = require("freedesktop.utils")
local io = io
local string = string
local table = table
local os = os
local ipairs = ipairs
local pairs = pairs
module("freedesktop.menu")
all_menu_dirs = {
'/usr/share/applications/',
'/usr/local/share/applications/',
'~/.local/share/applications/'
}
show_generic_name = false
--- Create menus for applications
-- @param menu_dirs A list of application directories (optional).
-- @return A prepared menu w/ categories
function new(arg)
-- the categories and their synonyms where shamelessly copied from lxpanel
-- source code.
local programs = {}
local config = arg or {}
programs['AudioVideo'] = {}
programs['Development'] = {}
programs['Education'] = {}
programs['Game'] = {}
programs['Graphics'] = {}
programs['Network'] = {}
programs['Office'] = {}
programs['Settings'] = {}
programs['System'] = {}
programs['Utility'] = {}
programs['Other'] = {}
for i, dir in ipairs(config.menu_dirs or all_menu_dirs) do
local entries = utils.parse_desktop_files({dir = dir})
for j, program in ipairs(entries) do
-- check whether to include in the menu
if program.show and program.Name and program.cmdline then
if show_generic_name and program.GenericName then
program.Name = program.Name .. ' (' .. program.GenericName .. ')'
end
local target_category = nil
if program.categories then
for _, category in ipairs(program.categories) do
if programs[category] then
target_category = category
break
end
end
end
if not target_category then
target_category = 'Other'
end
if target_category then
table.insert(programs[target_category], { program.Name, program.cmdline, program.icon_path })
end
end
end
end
-- sort each submenu alphabetically case insensitive
for k, v in pairs(programs) do
table.sort(v, function(a, b) return a[1]:lower() < b[1]:lower() end)
end
local menu = {
{ "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
local cleanedMenu = {}
for index, item in ipairs(menu) do
itemTester = item[2]
if itemTester[1] then
table.insert(cleanedMenu, item)
end
end
return cleanedMenu
end

View File

@ -1,255 +0,0 @@
-- Grab environment
local io = io
local os = os
local table = table
local type = type
local ipairs = ipairs
local pairs = pairs
module("freedesktop.utils")
terminal = 'xterm'
icon_theme = nil
all_icon_sizes = {
'128x128',
'96x96',
'72x72',
'64x64',
'48x48',
'36x36',
'32x32',
'24x24',
'22x22',
'16x16'
}
all_icon_types = {
'apps',
'actions',
'devices',
'places',
'categories',
'status',
'mimetypes'
}
all_icon_paths = { os.getenv("HOME") .. '/.icons/', '/usr/share/icons/' }
icon_sizes = {}
local mime_types = {}
function get_lines(...)
local f = io.popen(...)
return function () -- iterator
local data = f:read()
if data == nil then f:close() end
return data
end
end
function file_exists(filename)
local file = io.open(filename, 'r')
local result = (file ~= nil)
if result then
file:close()
end
return result
end
function lookup_icon(arg)
if arg.icon:sub(1, 1) == '/' and (arg.icon:find('.+%.png') or arg.icon:find('.+%.xpm')) then
-- icons with absolute path and supported (AFAICT) formats
return arg.icon
else
local icon_path = {}
local icon_themes = {}
local icon_theme_paths = {}
if icon_theme and type(icon_theme) == 'table' then
icon_themes = icon_theme
elseif icon_theme then
icon_themes = { icon_theme }
end
for i, theme in ipairs(icon_themes) do
for j, path in ipairs(all_icon_paths) do
table.insert(icon_theme_paths, path .. theme .. '/')
end
-- TODO also look in parent icon themes, as in freedesktop.org specification
end
table.insert(icon_theme_paths, '/usr/share/icons/hicolor/') -- fallback theme cf spec
local isizes = icon_sizes
for i, sz in ipairs(all_icon_sizes) do
table.insert(isizes, sz)
end
for i, icon_theme_directory in ipairs(icon_theme_paths) do
for j, size in ipairs(arg.icon_sizes or isizes) do
for k, icon_type in ipairs(all_icon_types) do
table.insert(icon_path, icon_theme_directory .. size .. '/' .. icon_type .. '/')
end
end
end
-- lowest priority fallbacks
table.insert(icon_path, '/usr/share/pixmaps/')
table.insert(icon_path, '/usr/share/icons/')
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
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'
end
end
end
end
function lookup_file_icon(arg)
load_mime_types()
local extension = arg.filename:match('%a+$')
local mime = mime_types[extension] or ''
local mime_family = mime:match('^%a+') or ''
-- possible icons in a typical gnome theme (i.e. Tango icons)
local possible_filenames = {
mime,
'gnome-mime-' .. mime,
mime_family,
'gnome-mime-' .. mime_family,
extension
}
for i, filename in ipairs(possible_filenames) do
local icon = lookup_icon({icon = filename, icon_sizes = (arg.icon_sizes or all_icon_sizes)})
if icon then
return icon
end
end
-- If we don't find ad icon, then pretend is a plain text file
return lookup_icon({ icon = 'txt', icon_sizes = arg.icon_sizes or all_icon_sizes })
end
--- Load system MIME types
-- @return A table with file extension <--> MIME type mapping
function load_mime_types()
if #mime_types == 0 then
for line in io.lines('/etc/mime.types') do
if not line:find('^#') then
local parsed = {}
for w in line:gmatch('[^%s]+') do
table.insert(parsed, w)
end
if #parsed > 1 then
for i = 2, #parsed do
mime_types[parsed[i]] = parsed[1]:gsub('/', '-')
end
end
end
end
end
end
--- Parse a .desktop file
-- @param file The .desktop file
-- @param requested_icon_sizes A list of icon sizes (optional). If this list is given, it will be used as a priority list for icon sizes when looking up for icons. If you want large icons, for example, you can put '128x128' as the first item in the list.
-- @return A table with file entries.
function parse_desktop_file(arg)
local program = { show = true, file = arg.file }
for line in io.lines(arg.file) do
for key, value in line:gmatch("(%w+)=(.+)") do
program[key] = value
end
end
-- Don't show the program if NoDisplay is true
-- Only show the program if there is not OnlyShowIn attribute
-- or if it's equal to 'awesome'
if program.NoDisplay == "true" or program.OnlyShowIn ~= nil and program.OnlyShowIn ~= "awesome" then
program.show = false
end
-- Look up for a icon.
if program.Icon then
program.icon_path = lookup_icon({ icon = program.Icon, icon_sizes = (arg.icon_sizes or all_icon_sizes) })
if program.icon_path ~= nil and not file_exists(program.icon_path) then
program.icon_path = nil
end
end
-- Split categories into a table.
if program.Categories then
program.categories = {}
for category in program.Categories:gmatch('[^;]+') do
table.insert(program.categories, category)
end
end
if program.Exec and program.Name then
local cmdline = program.Exec:gsub('%%c', program.Name)
cmdline = cmdline:gsub('%%[fmuFMU]', '')
cmdline = cmdline:gsub('%%k', program.file)
if program.icon_path then
cmdline = cmdline:gsub('%%i', '--icon ' .. program.icon_path)
else
cmdline = cmdline:gsub('%%i', '')
end
if program.Terminal == "true" then
cmdline = terminal .. ' -e ' .. cmdline
end
program.cmdline = cmdline
end
return program
end
--- Parse a directory with .desktop files
-- @param dir The directory.
-- @param icons_size, The icons sizes, optional.
-- @return A table with all .desktop entries.
function parse_desktop_files(arg)
local programs = {}
local files = get_lines('find '.. arg.dir ..' -name "*.desktop" 2>/dev/null')
for file in files do
arg.file = file
table.insert(programs, parse_desktop_file(arg))
end
return programs
end
--- Parse a directory files and subdirs
-- @param dir The directory.
-- @param icons_size, The icons sizes, optional.
-- @return A table with all .desktop entries.
function parse_dirs_and_files(arg)
local files = {}
local paths = get_lines('find '..arg.dir..' -maxdepth 1 -type d')
for path in paths do
if path:match("[^/]+$") then
local file = {}
file.filename = path:match("[^/]+$")
file.path = path
file.show = true
file.icon = lookup_icon({ icon = "folder", icon_sizes = (arg.icon_sizes or all_icon_sizes) })
table.insert(files, file)
end
end
local paths = get_lines('find '..arg.dir..' -maxdepth 1 -type f')
for path in paths do
if not path:find("%.desktop$") then
local file = {}
file.filename = path:match("[^/]+$")
file.path = path
file.show = true
file.icon = lookup_file_icon({ filename = file.filename, icon_sizes = (arg.icon_sizes or all_icon_sizes) })
table.insert(files, file)
end
end
return files
end

View File

@ -1,5 +1,5 @@
--[[
Blackburn Awesome WM config 2.0
github.com/copycat-killer
@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -50,7 +50,6 @@ end
run_once("urxvtd")
run_once("unclutter")
run_once("compton")
-- }}}
-- {{{ Variable definitions
@ -101,7 +100,8 @@ end
-- }}}
-- {{{ Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
-- }}}
-- {{{ Wibox

View File

@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -51,7 +51,6 @@ end
run_once("urxvtd")
run_once("unclutter")
run_once("compton")
-- }}}
-- {{{ Variable definitions
@ -112,7 +111,8 @@ end
-- }}}
-- {{{ Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
-- }}}
-- {{{ Wibox
@ -244,7 +244,7 @@ settings = function()
volicon:set_image(beautiful.vol)
end
end,
colors =
colors =
{
background = beautiful.bg_normal,
mute = "#EB8F8F",
@ -484,22 +484,22 @@ globalkeys = awful.util.table.join(
awful.key({ altkey }, "Up",
function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "+")
volume.notify()
volume.update()
end),
awful.key({ altkey }, "Down",
function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "-")
volume.notify()
volume.update()
end),
awful.key({ altkey }, "m",
function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " playback toggle")
volume.notify()
volume.update()
end),
awful.key({ altkey, "Control" }, "m",
function ()
awful.util.spawn("amixer -q set " .. volume.channel .. " playback 100%")
volume.notify()
volume.update()
end),
-- MPD control

View File

@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -50,7 +50,6 @@ end
run_once("urxvtd")
run_once("unclutter")
run_once("compton")
-- }}}
-- {{{ Variable definitions
@ -58,7 +57,7 @@ run_once("compton")
--os.setlocale(os.getenv("LANG"))
-- beautiful init
beautiful.init(awful.util.getdir("config") .. "/themes/dremora/theme.lua")
beautiful.init(os.getenv("HOME") .. "/.config/awesome/themes/dremora/theme.lua")
-- common
modkey = "Mod4"
@ -101,7 +100,8 @@ end
-- }}}
-- {{{ Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
-- }}}
-- {{{ Wibox

View File

@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -50,7 +50,6 @@ end
run_once("urxvtd")
run_once("unclutter")
run_once("compton")
-- }}}
-- {{{ Variable definitions
@ -102,7 +101,10 @@ end
-- }}}
-- {{{ Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
menu = mymainmenu })
-- }}}
-- {{{ Wibox
@ -111,11 +113,6 @@ blue = "#80CCE6"
space3 = markup.font("Tamsyn 3", " ")
space2 = markup.font("Tamsyn 2", " ")
-- Menu icon
awesome_icon = wibox.widget.imagebox()
awesome_icon:set_image(beautiful.awesome_icon)
awesome_icon:buttons(awful.util.table.join( awful.button({ }, 1, function() mymainmenu:toggle() end)))
-- Clock
mytextclock = awful.widget.textclock(markup("#FFFFFF", space3 .. "%H:%M" .. space2))
clock_icon = wibox.widget.imagebox()
@ -175,7 +172,7 @@ mpdwidget = lain.widgets.mpd({
mpd_now.artist = mpd_now.artist:upper():gsub("&.-;", string.lower)
mpd_now.title = mpd_now.title:upper():gsub("&.-;", string.lower)
widget:set_markup(markup.font("Tamsyn 4", " ")
.. markup.font("Tamsyn 8",
.. markup.font("Tamsyn 8",
mpd_now.artist
.. " - " ..
mpd_now.title
@ -419,7 +416,7 @@ for s = 1, screen.count() do
-- Widgets that are aligned to the bottom left
bottom_left_layout = wibox.layout.fixed.horizontal()
bottom_left_layout:add(awesome_icon)
bottom_left_layout:add(mylauncher)
-- Widgets that are aligned to the bottom right
bottom_right_layout = wibox.layout.fixed.horizontal()

View File

@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -107,7 +107,8 @@ end
-- }}}
-- {{{ Freedesktop Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
-- }}}
-- {{{ Wibox
@ -198,7 +199,7 @@ volumewidget = lain.widgets.alsa({
end
})
-- Net
-- Net
netdownicon = wibox.widget.imagebox(beautiful.widget_netdown)
--netdownicon.align = "middle"
netdowninfo = wibox.widget.textbox()
@ -301,11 +302,11 @@ mytasklist.buttons = awful.util.table.join(
end))
for s = 1, screen.count() do
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt()
-- We need one layoutbox per screen.
mylayoutbox[s] = awful.widget.layoutbox(s)
mylayoutbox[s]:buttons(awful.util.table.join(
@ -321,9 +322,9 @@ for s = 1, screen.count() do
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
-- Create the upper wibox
mywibox[s] = awful.wibox({ position = "top", screen = s, height = 20 })
mywibox[s] = awful.wibox({ position = "top", screen = s, height = 20 })
--border_width = 0, height = 20 })
-- Widgets that are aligned to the upper left
local left_layout = wibox.layout.fixed.horizontal()
left_layout:add(mytaglist[s])
@ -362,20 +363,20 @@ for s = 1, screen.count() do
layout:set_left(left_layout)
--layout:set_middle(mytasklist[s])
layout:set_right(right_layout)
mywibox[s]:set_widget(layout)
-- Create the bottom wibox
mybottomwibox[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 20 })
--mybottomwibox[s].visible = false
-- Widgets that are aligned to the bottom left
bottom_left_layout = wibox.layout.fixed.horizontal()
-- Widgets that are aligned to the bottom right
bottom_right_layout = wibox.layout.fixed.horizontal()
bottom_right_layout:add(mylayoutbox[s])
-- Now bring it all together (with the tasklist in the middle)
bottom_layout = wibox.layout.align.horizontal()
bottom_layout:set_left(bottom_left_layout)
@ -735,7 +736,7 @@ for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
c.border_width = 0
elseif awful.client.floating.get(c) or layout == "floating" then
c.border_width = beautiful.border_width
elseif #clients == 1 then
elseif #clients == 1 then
clients[1].border_width = 0
if layout ~= "max" then
awful.client.moveresize(0, 0, 2, 0, clients[1])

View File

@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -104,7 +104,8 @@ end
-- }}}
-- {{{ Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
-- }}}
-- {{{ Wibox

View File

@ -1,5 +1,5 @@
--[[
Rainbow Awesome WM config 2.0
github.com/copycat-killer
@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -50,7 +50,6 @@ end
run_once("urxvtd")
run_once("unclutter")
run_once("compton")
-- }}}
-- {{{ Variable definitions
@ -108,7 +107,8 @@ end
-- }}}
-- {{{ Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
-- }}}
-- {{{ Wibox

View File

@ -9,7 +9,7 @@
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
@ -50,7 +50,6 @@ end
run_once("urxvtd")
run_once("unclutter")
run_once("compton")
-- }}}
-- {{{ Variable definitions
@ -106,7 +105,8 @@ end
-- }}}
-- {{{ Menu
require("freedesktop/freedesktop")
mymainmenu = awful.menu.new({ items = require("menugen").build_menu(),
theme = { height = 16, width = 130 }})
-- }}}
-- {{{ Wibox

View File

@ -75,19 +75,19 @@ function toggle(prog, vert, horiz, width, height, sticky, screen)
-- Client geometry and placement
local screengeom = capi.screen[screen].workarea
if width <= 1 then width = (screengeom.width * width) - 3 end
if width <= 1 then width = screengeom.width * width end
if height <= 1 then height = screengeom.height * height end
if horiz == "left" then x = screengeom.x
elseif horiz == "right" then x = screengeom.width - width
else x = screengeom.x+(screengeom.width-width)/2 - 1 end
else x = screengeom.x+(screengeom.width-width)/2 end
if vert == "bottom" then y = screengeom.height + screengeom.y - height
elseif vert == "center" then y = screengeom.y+(screengeom.height-height)/2
else y = screengeom.y end
else y = screengeom.y - screengeom.y end
-- Client properties
c:geometry({ x = x, y = y, width = width, height = height })
c:geometry({ x = x, y = y + mywibox[mouse.screen].height, width = width, height = height })
c.ontop = true
c.above = true
c.skip_taskbar = true
@ -101,7 +101,7 @@ function toggle(prog, vert, horiz, width, height, sticky, screen)
-- Add manage signal and spawn the program
attach_signal("manage", spawnw)
awful.util.spawn_with_shell(prog, false) -- original without '_with_shell'
awful.util.spawn(prog, false)
else
-- Get a running client
c = dropdown[prog][screen]
@ -114,8 +114,8 @@ function toggle(prog, vert, horiz, width, height, sticky, screen)
-- Focus and raise if hidden
if c.hidden then
-- Make sure it is centered
if vert == "center" then awful.placement.center_vertical(c) end
if horiz == "center" then awful.placement.center_horizontal(c) end
--if vert == "center" then awful.placement.center_vertical(c) end
--if horiz == "center" then awful.placement.center_horizontal(c) end
c.hidden = false
c:raise()
capi.client.focus = c

View File

@ -30,7 +30,7 @@ theme.tasklist_bg_focus = "#060606"
theme.menu_height = "16"
theme.menu_width = "140"
theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
theme.submenu_icon = theme.dir .. "/icons/submenu.png"
theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
theme.arrl_lr_pre = theme.dir .. "/icons/arrl_lr_pre.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 KiB

View File

@ -36,7 +36,7 @@ theme.tasklist_maximized_vertical = ""
theme.tasklist_disable_icon = true
theme.awesome_icon = theme.dir .."/icons/awesome.png"
theme.menu_submenu_icon = theme.dir .."/icons/submenu.png"
theme.submenu_icon = theme.dir .."/icons/submenu.png"
theme.taglist_squares_sel = theme.dir .. "/icons/square_unsel.png"
theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
theme.widget_bg = theme.dir .. "/icons/widget_bg.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 KiB

View File

@ -28,7 +28,7 @@ theme.taglist_bg_focus = "#121212"
theme.menu_height = "16"
theme.menu_width = "140"
theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
theme.submenu_icon = theme.dir .. "/icons/submenu.png"
theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
theme.arrl_lr_pre = theme.dir .. "/icons/arrl_lr_pre.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 KiB

View File

@ -37,7 +37,7 @@ theme.menu_width = "400"
theme.widget_bg = theme.icon_dir .. "/bg_focus_noline.png"
theme.awesome_icon = theme.icon_dir .. "/awesome_icon.png"
theme.vol_bg = theme.icon_dir .. "/vol_bg.png"
theme.menu_submenu_icon = theme.icon_dir .. "/submenu.png"
theme.submenu_icon = theme.icon_dir .. "/submenu.png"
theme.taglist_squares_sel = theme.icon_dir .. "/square_sel.png"
theme.taglist_squares_unsel = theme.icon_dir .. "/square_unsel.png"
theme.last = theme.icon_dir .. "/last.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

View File

@ -42,7 +42,7 @@ theme.menu_fg_focus = "#ff8c00"
theme.menu_bg_normal = "#050505dd"
theme.menu_bg_focus = "#050505dd"
theme.menu_submenu_icon = theme.confdir .. "/icons/submenu.png"
theme.submenu_icon = theme.confdir .. "/icons/submenu.png"
theme.widget_temp = theme.confdir .. "/icons/temp.png"
theme.widget_uptime = theme.confdir .. "/icons/ac.png"
theme.widget_cpu = theme.confdir .. "/icons/cpu.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

View File

@ -36,7 +36,7 @@ theme.mouse_finder_color = "#CC9393"
theme.menu_height = "16"
theme.menu_width = "140"
theme.menu_submenu_icon = themes_dir .. "/icons/submenu.png"
theme.submenu_icon = themes_dir .. "/icons/submenu.png"
theme.taglist_squares_sel = themes_dir .. "/icons/square_sel.png"
theme.taglist_squares_unsel = themes_dir .. "/icons/square_unsel.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

View File

@ -33,9 +33,9 @@ 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.menu_awesome_icon = theme.dir .."/icons/awesome.png"
theme.menu_submenu_icon = theme.dir .."/icons/submenu.png"
theme.submenu_icon = theme.dir .."/icons/submenu.png"
theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
theme.vol_bg = theme.dir .. "/icons/vol_bg.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -41,7 +41,7 @@ theme.layout_txt_fullscreen = "[F]"
theme.layout_txt_magnifier = "[M]"
theme.layout_txt_floating = "[|]"
theme.menu_submenu_icon = themes_dir .. "/icons/submenu.png"
theme.submenu_icon = themes_dir .. "/icons/submenu.png"
theme.taglist_squares_sel = themes_dir .. "/icons/square_sel.png"
theme.taglist_squares_unsel = themes_dir .. "/icons/square_unsel.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 KiB