Add Theme to README
- Move Window section into theme - Add tag names with nerd font icons - Change theme font to Ubuntu Nerd Font - Adjust gap size in theme - Enable gap for single client in theme
This commit is contained in:
146
README.org
146
README.org
@@ -15,7 +15,7 @@
|
||||
- [[#key-bindings][Key Bindings]]
|
||||
- [[#rules][Rules]]
|
||||
- [[#signals][Signals]]
|
||||
- [[#windows][Windows]]
|
||||
- [[#theme][Theme]]
|
||||
|
||||
* Welcome
|
||||
|
||||
@@ -241,7 +241,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()
|
||||
@@ -693,13 +693,139 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n
|
||||
-- }}}
|
||||
#+END_SRC
|
||||
|
||||
* Windows
|
||||
* Theme
|
||||
|
||||
#+BEGIN_SRC lua :tangle rc.lua
|
||||
-- {{{ Windows
|
||||
-- Configuration of windows
|
||||
beautiful.useless_gap = 10
|
||||
beautiful.gap_single_client = true
|
||||
beautiful.border_width = 2
|
||||
-- }}}
|
||||
Based on Awesome theme which follows xrdb config by Yauhen Kirylau.
|
||||
|
||||
#+BEGIN_SRC lua :tangle theme.lua
|
||||
local theme_assets = require("beautiful.theme_assets")
|
||||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
local xrdb = xresources.get_current_theme()
|
||||
local gfs = require("gears.filesystem")
|
||||
local themes_path = gfs.get_themes_dir()
|
||||
|
||||
-- inherit default theme
|
||||
local theme = dofile(themes_path.."default/theme.lua")
|
||||
-- load vector assets' generators for this theme
|
||||
|
||||
theme.font = "Ubuntu Nerd Font 11"
|
||||
|
||||
theme.bg_normal = xrdb.background
|
||||
theme.bg_focus = xrdb.color12
|
||||
theme.bg_urgent = xrdb.color9
|
||||
theme.bg_minimize = xrdb.color8
|
||||
theme.bg_systray = theme.bg_normal
|
||||
|
||||
theme.fg_normal = xrdb.foreground
|
||||
theme.fg_focus = theme.bg_normal
|
||||
theme.fg_urgent = theme.bg_normal
|
||||
theme.fg_minimize = theme.bg_normal
|
||||
|
||||
theme.useless_gap = dpi(10)
|
||||
theme.border_width = dpi(2)
|
||||
theme.border_normal = xrdb.color0
|
||||
theme.border_focus = theme.bg_focus
|
||||
theme.border_marked = xrdb.color10
|
||||
theme.gap_single_client = true
|
||||
|
||||
-- There are other variable sets
|
||||
-- overriding the default one when
|
||||
-- defined, the sets are:
|
||||
-- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile]
|
||||
-- tasklist_[bg|fg]_[focus|urgent]
|
||||
-- titlebar_[bg|fg]_[normal|focus]
|
||||
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
|
||||
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
|
||||
-- Example:
|
||||
--theme.taglist_bg_focus = "#ff0000"
|
||||
|
||||
theme.tooltip_fg = theme.fg_normal
|
||||
theme.tooltip_bg = theme.bg_normal
|
||||
|
||||
-- Variables set for theming the menu:
|
||||
-- menu_[bg|fg]_[normal|focus]
|
||||
-- menu_[border_color|border_width]
|
||||
theme.menu_submenu_icon = themes_path.."default/submenu.png"
|
||||
theme.menu_height = dpi(16)
|
||||
theme.menu_width = dpi(100)
|
||||
|
||||
-- You can add as many variables as
|
||||
-- you wish and access them by using
|
||||
-- beautiful.variable in your rc.lua
|
||||
--theme.bg_widget = "#cc0000"
|
||||
|
||||
-- Recolor Layout icons:
|
||||
theme = theme_assets.recolor_layout(theme, theme.fg_normal)
|
||||
|
||||
-- Recolor titlebar icons:
|
||||
--
|
||||
local function darker(color_value, darker_n)
|
||||
local result = "#"
|
||||
for s in color_value:gmatch("[a-fA-F0-9][a-fA-F0-9]") do
|
||||
local bg_numeric_value = tonumber("0x"..s) - darker_n
|
||||
if bg_numeric_value < 0 then bg_numeric_value = 0 end
|
||||
if bg_numeric_value > 255 then bg_numeric_value = 255 end
|
||||
result = result .. string.format("%2.2x", bg_numeric_value)
|
||||
end
|
||||
return result
|
||||
end
|
||||
theme = theme_assets.recolor_titlebar(
|
||||
theme, theme.fg_normal, "normal"
|
||||
)
|
||||
theme = theme_assets.recolor_titlebar(
|
||||
theme, darker(theme.fg_normal, -60), "normal", "hover"
|
||||
)
|
||||
theme = theme_assets.recolor_titlebar(
|
||||
theme, xrdb.color1, "normal", "press"
|
||||
)
|
||||
theme = theme_assets.recolor_titlebar(
|
||||
theme, theme.fg_focus, "focus"
|
||||
)
|
||||
theme = theme_assets.recolor_titlebar(
|
||||
theme, darker(theme.fg_focus, -60), "focus", "hover"
|
||||
)
|
||||
theme = theme_assets.recolor_titlebar(
|
||||
theme, xrdb.color1, "focus", "press"
|
||||
)
|
||||
|
||||
-- Define the icon theme for application icons. If not set then the icons
|
||||
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
||||
theme.icon_theme = nil
|
||||
|
||||
-- Generate Awesome icon:
|
||||
theme.awesome_icon = theme_assets.awesome_icon(
|
||||
theme.menu_height, theme.bg_focus, theme.fg_focus
|
||||
)
|
||||
|
||||
-- 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
|
||||
)
|
||||
|
||||
-- Try to determine if we are running light or dark colorscheme:
|
||||
local bg_numberic_value = 0;
|
||||
for s in theme.bg_normal:gmatch("[a-fA-F0-9][a-fA-F0-9]") do
|
||||
bg_numberic_value = bg_numberic_value + tonumber("0x"..s);
|
||||
end
|
||||
local is_dark_bg = (bg_numberic_value < 383)
|
||||
|
||||
-- Generate wallpaper:
|
||||
local wallpaper_bg = xrdb.color8
|
||||
local wallpaper_fg = xrdb.color7
|
||||
local wallpaper_alt_fg = xrdb.color12
|
||||
if not is_dark_bg then
|
||||
wallpaper_bg, wallpaper_fg = wallpaper_fg, wallpaper_bg
|
||||
end
|
||||
theme.wallpaper = function(s)
|
||||
return theme_assets.wallpaper(wallpaper_bg, wallpaper_fg, wallpaper_alt_fg, s)
|
||||
end
|
||||
|
||||
return theme
|
||||
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
#+END_SRC
|
||||
|
9
rc.lua
9
rc.lua
@@ -188,7 +188,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()
|
||||
@@ -622,10 +622,3 @@ end)
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Windows
|
||||
-- Configuration of windows
|
||||
beautiful.useless_gap = 10
|
||||
beautiful.gap_single_client = true
|
||||
beautiful.border_width = 2
|
||||
-- }}}
|
||||
|
10
theme.lua
10
theme.lua
@@ -1,8 +1,3 @@
|
||||
---------------------------------------------
|
||||
-- Awesome theme which follows xrdb config --
|
||||
-- by Yauhen Kirylau --
|
||||
---------------------------------------------
|
||||
|
||||
local theme_assets = require("beautiful.theme_assets")
|
||||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
@@ -14,7 +9,7 @@ local themes_path = gfs.get_themes_dir()
|
||||
local theme = dofile(themes_path.."default/theme.lua")
|
||||
-- load vector assets' generators for this theme
|
||||
|
||||
theme.font = "sans 8"
|
||||
theme.font = "Ubuntu Nerd Font 11"
|
||||
|
||||
theme.bg_normal = xrdb.background
|
||||
theme.bg_focus = xrdb.color12
|
||||
@@ -27,11 +22,12 @@ theme.fg_focus = theme.bg_normal
|
||||
theme.fg_urgent = theme.bg_normal
|
||||
theme.fg_minimize = theme.bg_normal
|
||||
|
||||
theme.useless_gap = dpi(3)
|
||||
theme.useless_gap = dpi(10)
|
||||
theme.border_width = dpi(2)
|
||||
theme.border_normal = xrdb.color0
|
||||
theme.border_focus = theme.bg_focus
|
||||
theme.border_marked = xrdb.color10
|
||||
theme.gap_single_client = true
|
||||
|
||||
-- There are other variable sets
|
||||
-- overriding the default one when
|
||||
|
Reference in New Issue
Block a user