separate color table from properties
This commit is contained in:
parent
76f56be701
commit
6dcdf57328
109
awesome/rc.lua
109
awesome/rc.lua
@ -61,7 +61,8 @@ end
|
|||||||
-- Autostart programs
|
-- Autostart programs
|
||||||
run_once({
|
run_once({
|
||||||
"xcompmgr",
|
"xcompmgr",
|
||||||
"sleep 0.25 && xrandr --output DP-1 --primary --auto --pos 0x0 --output HDMI-0 --auto --pos 2560x180"
|
"sleep 0.25 && xrandr --output DP-1 --primary --auto --pos 0x0 --output HDMI-0 --auto --pos 2560x180",
|
||||||
|
"keepassxc"
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Choose the theme
|
-- Choose the theme
|
||||||
@ -83,13 +84,13 @@ naughty.config.defaults.position = "top_right"
|
|||||||
naughty.config.defaults.margin = 8
|
naughty.config.defaults.margin = 8
|
||||||
naughty.config.defaults.gap = 1
|
naughty.config.defaults.gap = 1
|
||||||
naughty.config.defaults.ontop = true
|
naughty.config.defaults.ontop = true
|
||||||
naughty.config.defaults.font = "Fira Code 10"
|
naughty.config.defaults.font = "Fira Sans 10"
|
||||||
naughty.config.defaults.icon = nil
|
naughty.config.defaults.icon = nil
|
||||||
naughty.config.defaults.icon_size = 32
|
naughty.config.defaults.icon_size = 32
|
||||||
naughty.config.defaults.fg = beautiful.fg_tooltip
|
naughty.config.defaults.fg = beautiful.fg_tooltip
|
||||||
naughty.config.defaults.bg = beautiful.bg_tooltip
|
naughty.config.defaults.bg = beautiful.bg_tooltip
|
||||||
naughty.config.defaults.border_color = beautiful.border_tooltip
|
naughty.config.defaults.border_color = beautiful.notification_border_color
|
||||||
naughty.config.defaults.border_width = 2
|
naughty.config.defaults.border_width = 0
|
||||||
naughty.config.defaults.hover_timeout = nil
|
naughty.config.defaults.hover_timeout = nil
|
||||||
|
|
||||||
awful.util.terminal = terminal
|
awful.util.terminal = terminal
|
||||||
@ -104,9 +105,9 @@ awful.layout.layouts = {
|
|||||||
awful.layout.suit.spiral,
|
awful.layout.suit.spiral,
|
||||||
awful.layout.suit.max,
|
awful.layout.suit.max,
|
||||||
awful.layout.suit.max.fullscreen,
|
awful.layout.suit.max.fullscreen,
|
||||||
-- awful.layout.suit.magnifier,
|
--awful.layout.suit.magnifier,
|
||||||
awful.layout.suit.fair,
|
--awful.layout.suit.fair,
|
||||||
awful.layout.suit.fair.horizontal,
|
--awful.layout.suit.fair.horizontal,
|
||||||
--awful.layout.suit.spiral.dwindle,
|
--awful.layout.suit.spiral.dwindle,
|
||||||
--awful.layout.suit.corner.nw,
|
--awful.layout.suit.corner.nw,
|
||||||
--awful.layout.suit.corner.ne,
|
--awful.layout.suit.corner.ne,
|
||||||
@ -223,9 +224,7 @@ awful.screen.connect_for_each_screen(function(s) beautiful.connect(s) end)
|
|||||||
|
|
||||||
-- Mouse bindings
|
-- Mouse bindings
|
||||||
root.buttons(awful.util.table.join(
|
root.buttons(awful.util.table.join(
|
||||||
awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end),
|
awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end)
|
||||||
awful.button({ }, 4, awful.tag.viewnext),
|
|
||||||
awful.button({ }, 5, awful.tag.viewprev)
|
|
||||||
))
|
))
|
||||||
|
|
||||||
-- {{{ Key bindings
|
-- {{{ Key bindings
|
||||||
@ -287,14 +286,21 @@ globalkeys = awful.util.table.join(
|
|||||||
{description = "jump to urgent client", group = "client"}),
|
{description = "jump to urgent client", group = "client"}),
|
||||||
|
|
||||||
-- Window changing
|
-- Window changing
|
||||||
awful.key({ altkey, }, "Tab",
|
awful.key({ altkey }, "Tab", function ()
|
||||||
function ()
|
awful.client.focus.byidx(-1)
|
||||||
awful.client.focus.history.previous()
|
|
||||||
if client.focus then
|
if client.focus then
|
||||||
client.focus:raise()
|
client.focus:raise()
|
||||||
end
|
end
|
||||||
end,
|
end),
|
||||||
{description = "go back", group = "client"}),
|
|
||||||
|
awful.key({ altkey, "Shift" }, "Tab", function ()
|
||||||
|
awful.client.focus.byidx(1)
|
||||||
|
|
||||||
|
if client.focus then
|
||||||
|
client.focus:raise()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
|
||||||
awful.key({ modkey, }, "Tab", function () awful.spawn("rofi -show window") end,
|
awful.key({ modkey, }, "Tab", function () awful.spawn("rofi -show window") end,
|
||||||
{description = "go back", group = "client"}),
|
{description = "go back", group = "client"}),
|
||||||
@ -314,11 +320,11 @@ globalkeys = awful.util.table.join(
|
|||||||
awful.key({ altkey, "Control" }, "]", function () lain.util.useless_gaps_resize(-1) end),
|
awful.key({ altkey, "Control" }, "]", function () lain.util.useless_gaps_resize(-1) end),
|
||||||
|
|
||||||
-- Dynamic tagging
|
-- Dynamic tagging
|
||||||
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end, { group = "Tagging", description = "Add tag" }),
|
-- awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end, { group = "Tagging", description = "Add tag" }),
|
||||||
awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end, { group = "Tagging", description = "Rename current tag" }),
|
-- awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end, { group = "Tagging", description = "Rename current tag" }),
|
||||||
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end, { group = "Tagging", description = "Move tag to left" }), -- move to previous tag
|
-- awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end, { group = "Tagging", description = "Move tag to left" }), -- move to previous tag
|
||||||
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end, { group = "Tagging", description = "Move tag to right" }), -- move to next tag
|
-- awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end, { group = "Tagging", description = "Move tag to right" }), -- move to next tag
|
||||||
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end, { group = "Tagging", description = "Remove crrent tag" }),
|
-- awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end, { group = "Tagging", description = "Remove crrent tag" }),
|
||||||
|
|
||||||
-- Standard program
|
-- Standard program
|
||||||
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
||||||
@ -476,6 +482,13 @@ clientbuttons = awful.util.table.join(
|
|||||||
root.keys(globalkeys)
|
root.keys(globalkeys)
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
local client_colors = {
|
||||||
|
{ rule = { class = "Firefox" }, color = "#0c0c0d" },
|
||||||
|
{ rule = { class = "jetbrains-toolbox" }, color = "#111314" },
|
||||||
|
{ rule = { class = "TelegramDesktop" }, color = "#17212B" },
|
||||||
|
{ rule_any = { class = { "jetbrains-phpstorm", "jetbrains-idea", "jetbrains-pycharm" } }, color = "#3c3f41" },
|
||||||
|
}
|
||||||
|
|
||||||
-- Rules to apply to new clients (through the "manage" signal).
|
-- Rules to apply to new clients (through the "manage" signal).
|
||||||
awful.rules.rules = {
|
awful.rules.rules = {
|
||||||
-- All clients will match this rule.
|
-- All clients will match this rule.
|
||||||
@ -501,11 +514,11 @@ awful.rules.rules = {
|
|||||||
|
|
||||||
-- Set Firefox to always map on the first tag on screen 1.
|
-- Set Firefox to always map on the first tag on screen 1.
|
||||||
{ rule = { class = "Firefox" },
|
{ rule = { class = "Firefox" },
|
||||||
properties = { maximized = true, tag = awful.util.tagnames[3], titlebar_color = "#0c0c0d" } },
|
properties = { maximized = true, tag = awful.util.tagnames[3] } },
|
||||||
|
|
||||||
-- Jetbrains stuff
|
-- Jetbrains stuff
|
||||||
{ rule_any = { class = { "jetbrains-phpstorm", "jetbrains-idea", "jetbrains-pycharm" } },
|
{ rule_any = { class = { "jetbrains-phpstorm", "jetbrains-idea", "jetbrains-pycharm" } },
|
||||||
properties = { titlebars_enabled = false, tag = awful.util.tagnames[1], maximized = false, titlebar_color = "#3c3f41" } },
|
properties = { titlebars_enabled = false, tag = awful.util.tagnames[1], maximized = false } },
|
||||||
|
|
||||||
-- flameshot
|
-- flameshot
|
||||||
{ rule = { class = "flameshot" },
|
{ rule = { class = "flameshot" },
|
||||||
@ -513,15 +526,17 @@ awful.rules.rules = {
|
|||||||
|
|
||||||
-- keepassxc
|
-- keepassxc
|
||||||
{ rule = { class = "keepassxc" },
|
{ rule = { class = "keepassxc" },
|
||||||
properties = { titlebars_enabled = true, floating = true } },
|
properties = { titlebars_enabled = true, floating = true, sticky = true } },
|
||||||
|
|
||||||
|
{ rule = { class = "Gcolor2" },
|
||||||
|
properties = { titlebars_enabled = true, floating = true, focus = true } },
|
||||||
|
|
||||||
-- messaging
|
-- messaging
|
||||||
{ rule_any = { class = { "telegram-desktop", "Thunderbird", "jetbrains-toolbox" } },
|
{ rule_any = { class = { "TelegramDesktop", "Thunderbird" } },
|
||||||
properties = { screen = 2, tag = awful.util.tagnames[4] } },
|
properties = { screen = 2, tag = awful.util.tagnames[4] } },
|
||||||
|
|
||||||
-- quake
|
{ rule = { class = "jetbrains-toolbox" },
|
||||||
{ rule = { class = "QuakeDD" },
|
properties = { screen = 2, tag = awful.util.tagnames[5] } },
|
||||||
properties = { allow_titlebars = false } },
|
|
||||||
|
|
||||||
-- dialogs
|
-- dialogs
|
||||||
{ rule = { type = "dialog" },
|
{ rule = { type = "dialog" },
|
||||||
@ -529,7 +544,11 @@ awful.rules.rules = {
|
|||||||
|
|
||||||
-- jetbrains bugs
|
-- jetbrains bugs
|
||||||
{ rule = { class = "jetbrains-.*", name = "win.*" },
|
{ rule = { class = "jetbrains-.*", name = "win.*" },
|
||||||
properties = { titlebars_enabled = false, allow_titlebars = false, focusable = false, floating = true, titlebar_color = "#ff0000" } },
|
properties = { titlebars_enabled = false, allow_titlebars = false, focusable = false, floating = true } },
|
||||||
|
|
||||||
|
-- quake
|
||||||
|
{ rule = { class = "QuakeDD" },
|
||||||
|
properties = { allow_titlebars = false } },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Signals
|
-- Signals
|
||||||
@ -539,6 +558,10 @@ client.connect_signal("manage", function (c)
|
|||||||
-- i.e. put it at the end of others instead of setting it master.
|
-- i.e. put it at the end of others instead of setting it master.
|
||||||
if not awesome.startup then awful.client.setslave(c) end
|
if not awesome.startup then awful.client.setslave(c) end
|
||||||
|
|
||||||
|
if c.floating then
|
||||||
|
c.border_width = 1
|
||||||
|
end
|
||||||
|
|
||||||
if awesome.startup and
|
if awesome.startup and
|
||||||
not c.size_hints.user_position
|
not c.size_hints.user_position
|
||||||
and not c.size_hints.program_position then
|
and not c.size_hints.program_position then
|
||||||
@ -571,7 +594,14 @@ client.connect_signal("request::titlebars", function(c)
|
|||||||
)
|
)
|
||||||
|
|
||||||
local title = awful.titlebar.widget.titlewidget(c)
|
local title = awful.titlebar.widget.titlewidget(c)
|
||||||
title.font = "Fira Code Regular 7"
|
title.font = "Fira Sans Medium 8"
|
||||||
|
|
||||||
|
for index, rule in pairs(client_colors) do
|
||||||
|
if awful.rules.matches(c, rule) then
|
||||||
|
c.titlebar_color = rule.color
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
awful.titlebar(c, { size = 20, fg_focus = "#ffffff", bg_focus = c.titlebar_color or beautiful.titlebar_bg_focus }) : setup {
|
awful.titlebar(c, { size = 20, fg_focus = "#ffffff", bg_focus = c.titlebar_color or beautiful.titlebar_bg_focus }) : setup {
|
||||||
{ -- Left
|
{ -- Left
|
||||||
@ -586,7 +616,7 @@ client.connect_signal("request::titlebars", function(c)
|
|||||||
},
|
},
|
||||||
{ -- Middle
|
{ -- Middle
|
||||||
{
|
{
|
||||||
align = "left",
|
align = "center",
|
||||||
widget = title,
|
widget = title,
|
||||||
},
|
},
|
||||||
buttons = buttons,
|
buttons = buttons,
|
||||||
@ -622,16 +652,3 @@ client.connect_signal("property::floating", function (c)
|
|||||||
c.border_width = 0
|
c.border_width = 0
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- No border for maximized clients
|
|
||||||
client.connect_signal("focus",
|
|
||||||
function(c)
|
|
||||||
if c.maximized then
|
|
||||||
c.border_width_old = c.border_width
|
|
||||||
c.border_width = 0
|
|
||||||
elseif #awful.screen.focused().clients > 1 then
|
|
||||||
c.border_width = c.border_width_old
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
|
||||||
|
@ -77,8 +77,8 @@ theme.menu_width = 140
|
|||||||
theme.notification_font = fonts.mono_regular
|
theme.notification_font = fonts.mono_regular
|
||||||
theme.notification_bg = colors.dark .. "dd"
|
theme.notification_bg = colors.dark .. "dd"
|
||||||
theme.notification_fg = theme.fg_normal
|
theme.notification_fg = theme.fg_normal
|
||||||
theme.notification_border_width = 1
|
theme.notification_border_width = 0
|
||||||
theme.notification_border_color = colors.dark
|
theme.notification_border_color = colors.accent
|
||||||
theme.notification_shape = gears.shape.rectangle
|
theme.notification_shape = gears.shape.rectangle
|
||||||
theme.notification_opacity = 1
|
theme.notification_opacity = 1
|
||||||
theme.notification_margin = 30
|
theme.notification_margin = 30
|
||||||
@ -110,7 +110,8 @@ theme.layout_cornerne = theme.dir .. "/icons/layout/cp
|
|||||||
theme.layout_cornernw = theme.dir .. "/icons/layout/cornernw.png"
|
theme.layout_cornernw = theme.dir .. "/icons/layout/cornernw.png"
|
||||||
|
|
||||||
theme.tasklist_disable_icon = true
|
theme.tasklist_disable_icon = true
|
||||||
theme.useless_gap = 4
|
theme.useless_gap = 3
|
||||||
|
theme.master_width_factor = 0.66
|
||||||
|
|
||||||
-- titlebar
|
-- titlebar
|
||||||
theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close.png"
|
theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close.png"
|
||||||
@ -167,10 +168,13 @@ local clock_widget = wibox.container.background(wibox.container.margin(wibox.wid
|
|||||||
local calendar = lain.widget.calendar({
|
local calendar = lain.widget.calendar({
|
||||||
cal = "cal --color=always",
|
cal = "cal --color=always",
|
||||||
attach_to = { clock_widget },
|
attach_to = { clock_widget },
|
||||||
|
followtag = true,
|
||||||
notification_preset = {
|
notification_preset = {
|
||||||
font = fonts.mono_regular,
|
font = fonts.mono_regular,
|
||||||
fg = theme.fg_normal,
|
fg = theme.fg_normal,
|
||||||
bg = theme.bg_normal
|
bg = theme.bg_normal,
|
||||||
|
position = "top_middle",
|
||||||
|
screen = awful.mouse.screen,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -206,6 +210,7 @@ local temp_widget = wibox.widget { image.icons.temp, temp.widget, layout = wibox
|
|||||||
local fs_icon = wibox.widget.imagebox(theme.widget_hdd)
|
local fs_icon = wibox.widget.imagebox(theme.widget_hdd)
|
||||||
local fs = lain.widget.fs({
|
local fs = lain.widget.fs({
|
||||||
notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = fonts.widget },
|
notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = fonts.widget },
|
||||||
|
followtag = true,
|
||||||
settings = function()
|
settings = function()
|
||||||
local fsp = string.format(" %3.2f %s ", fs_now["/home"].free, fs_now["/home"].units)
|
local fsp = string.format(" %3.2f %s ", fs_now["/home"].free, fs_now["/home"].units)
|
||||||
widget:set_markup(markup.font(fonts.widget, markup.fg.color(theme.fg_widget, fsp)))
|
widget:set_markup(markup.font(fonts.widget, markup.fg.color(theme.fg_widget, fsp)))
|
||||||
@ -233,12 +238,12 @@ function theme.connect(s)
|
|||||||
-- Tags
|
-- Tags
|
||||||
--awful.tag(awful.util.tagnames, s, awful.layout.layouts[1])
|
--awful.tag(awful.util.tagnames, s, awful.layout.layouts[1])
|
||||||
layout = {
|
layout = {
|
||||||
awful.layout.layouts[3],
|
awful.layout.layouts[1],
|
||||||
awful.layout.layouts[10],
|
awful.layout.layouts[1],
|
||||||
awful.layout.layouts[8],
|
awful.layout.layouts[8],
|
||||||
awful.layout.layouts[7],
|
awful.layout.layouts[7],
|
||||||
awful.layout.layouts[10],
|
awful.layout.layouts[6],
|
||||||
awful.layout.layouts[10],
|
awful.layout.layouts[1],
|
||||||
}
|
}
|
||||||
awful.tag({ " </> ", " >_ ", " web ", " & ", " etc ", " # " }, s, layout)
|
awful.tag({ " </> ", " >_ ", " web ", " & ", " etc ", " # " }, s, layout)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user