[awesome] apply solarized theme

This commit is contained in:
Simon Bruder 2019-02-16 16:37:01 +00:00
parent 1d2ee787c4
commit 076196acc0
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
3 changed files with 108 additions and 91 deletions

View file

@ -14,10 +14,6 @@ local hotkeys_popup = require("awful.hotkeys_popup").widget
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
-- Load Debian menu entries
local debian = require("debian.menu")
local has_fdo, freedesktop = pcall(require, "freedesktop")
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
@ -45,9 +41,7 @@ end
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
beautiful.font = "Terminess Powerline 8"
beautiful.wallpaper = "/usr/share/wallpapers/wallpaper.jpg"
beautiful.init(gears.filesystem.get_configuration_dir() .. "theme.lua")
-- Default shell
awful.util.shell = "/bin/zsh"
@ -101,44 +95,10 @@ end
-- }}}
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "hotkeys", function() return false, hotkeys_popup.show_help end},
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end}
}
local menu_awesome = { "awesome", myawesomemenu, beautiful.awesome_icon }
local menu_terminal = { "open terminal", terminal }
if has_fdo then
mymainmenu = freedesktop.menu.build({
before = { menu_awesome },
after = { menu_terminal }
})
else
mymainmenu = awful.menu({
items = {
menu_awesome,
{ "Debian", debian.menu.Debian_menu.Debian },
menu_terminal,
}
})
end
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}
-- Keyboard map indicator and switcher
mykeyboardlayout = awful.widget.keyboardlayout()
-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
@ -206,7 +166,7 @@ awful.screen.connect_for_each_screen(function(s)
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
awful.tag({ "", "", "", "", "", "", "", "", "" }, s, awful.layout.layouts[1])
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt()
@ -232,7 +192,6 @@ awful.screen.connect_for_each_screen(function(s)
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
@ -253,7 +212,6 @@ end)
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
@ -282,9 +240,6 @@ globalkeys = gears.table.join(
end,
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
@ -342,8 +297,7 @@ globalkeys = gears.table.join(
{description = "restore minimized", group = "client"}),
-- Prompt
--awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
awful.key({ modkey }, "r", function () awful.util.spawn({"rofi", "-show", "combi"}) end,
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x",
@ -532,48 +486,6 @@ client.connect_signal("manage", function (c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = gears.table.join(
awful.button({ }, 1, function()
client.focus = c
c:raise()
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
client.focus = c
c:raise()
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c) : setup {
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c),
awful.titlebar.widget.ontopbutton (c),
awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier

View file

@ -0,0 +1,96 @@
local theme_assets = require("beautiful.theme_assets")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
local gfs = require("gears.filesystem")
local themes_path = gfs.get_themes_dir()
local spawn = require("awful.spawn")
local utils = require("../utils")
local theme = {}
theme.font = "Terminess Powerline 8"
theme.colors = {}
theme.colors.base03 = "#fdf6e3"
theme.colors.base02 = "#eee8d5"
theme.colors.base01 = "#93a1a1"
theme.colors.base00 = "#839496"
theme.colors.base0 = "#657b83"
theme.colors.base1 = "#586e75"
theme.colors.base2 = "#073642"
theme.colors.base3 = "#002b36"
theme.colors.yellow = "#b58900"
theme.colors.orange = "#cb4b16"
theme.colors.red = "#dc322f"
theme.colors.magenta = "#d33682"
theme.colors.violet = "#6c71c4"
theme.colors.blue = "#268bd2"
theme.colors.cyan = "#2aa198"
theme.colors.green = "#859900"
theme.bg_normal = theme.colors.base3
theme.bg_focus = theme.colors.base2
theme.bg_urgent = theme.colors.red
theme.bg_minimize = "#303030"
theme.bg_systray = theme.bg_normal
theme.fg_normal = theme.colors.base02
theme.fg_focus = theme.colors.base03
theme.fg_urgent = theme.colors.base3
theme.fg_minimize = "#ffffff"
theme.taglist_font = "Unifont 10"
theme.taglist_bg_focus = theme.colors.green
theme.useless_gap = dpi(0)
theme.border_width = dpi(0)
theme.border_normal = "#000000"
theme.border_focus = "#535d6c"
theme.wibar_height = 21
theme.tasklist_disable_icon = true
-- Hotkeys popup (Mod+s)
theme.hotkeys_font = "Iosevka sbruder Bold 10"
theme.hotkeys_description_font = "Iosevka sbruder 10"
theme.hotkeys_modifiers_fg = theme.fg_normal
theme.wallpaper = function(s)
if utils.file_exists(utils.home() .. ".fehbg") then
spawn({utils.home() .. ".fehbg"})
end
end
-- Generate taglist squares:
local taglist_square_size = dpi(4)
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
taglist_square_size, theme.fg_normal
)
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
taglist_square_size, theme.fg_normal
)
-- You can use your own layout icons like this:
theme.layout_fairh = themes_path .. "default/layouts/fairhw.png"
theme.layout_fairv = themes_path .. "default/layouts/fairvw.png"
theme.layout_floating = themes_path .. "default/layouts/floatingw.png"
theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png"
theme.layout_max = themes_path .. "default/layouts/maxw.png"
theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png"
theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png"
theme.layout_tileleft = themes_path .. "default/layouts/tileleftw.png"
theme.layout_tile = themes_path .. "default/layouts/tilew.png"
theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png"
theme.layout_spiral = themes_path .. "default/layouts/spiralw.png"
theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png"
theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png"
theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png"
theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png"
theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png"
return theme
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View file

@ -8,4 +8,13 @@ function utils.readfile(command)
return text:gsub("^%s*(.-)%s*$", "%1")
end
function utils.file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
function utils.home()
return os.getenv("HOME") .. "/"
end
return utils