a lot of stuff
7
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"Lua.diagnostics.globals": [
|
||||
"user_vars",
|
||||
"modkey",
|
||||
"root"
|
||||
]
|
||||
}
|
||||
@@ -12,203 +12,203 @@ return function()
|
||||
{ modkey },
|
||||
"s",
|
||||
hotkeys_popup.show_help,
|
||||
{description="Cheat sheet", group="Awesome"}
|
||||
{ description = "Cheat sheet", group = "Awesome" }
|
||||
),
|
||||
-- Tag browsing
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Left",
|
||||
awful.tag.viewprev,
|
||||
{description = "View previous tag", group = "Tag"}
|
||||
{ description = "View previous tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Right",
|
||||
awful.tag.viewnext,
|
||||
{description = "View next tag", group = "Tag"}
|
||||
{ description = "View next tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Escape",
|
||||
awful.tag.history.restore,
|
||||
{description = "Go back to last tag", group = "Tag"}
|
||||
{ description = "Go back to last tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"j",
|
||||
function ()
|
||||
function()
|
||||
awful.client.focus.byidx(1)
|
||||
end,
|
||||
{description = "Focus next client by index", group = "Client"}
|
||||
{ description = "Focus next client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"k",
|
||||
function ()
|
||||
function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
{description = "Focus previous client by index", group = "Client"}
|
||||
{ description = "Focus previous client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"w",
|
||||
function ()
|
||||
function()
|
||||
user_vars.main_menu:show()
|
||||
end,
|
||||
{description = "Show context menu", group = "Awesome"}
|
||||
{ description = "Show context menu", group = "Awesome" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"j",
|
||||
function ()
|
||||
function()
|
||||
awful.client.swap.byidx(1)
|
||||
end,
|
||||
{description = "Swap with next client by index", group = "Client"}
|
||||
{ description = "Swap with next client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"k",
|
||||
function ()
|
||||
function()
|
||||
awful.client.swap.byidx(-1)
|
||||
end,
|
||||
{description = "Swap with previous client by index", group = "Client"}
|
||||
{ description = "Swap with previous client by index", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"j",
|
||||
function ()
|
||||
function()
|
||||
awful.screen.focus_relative(1)
|
||||
end,
|
||||
{description = "Focus the next screen", group = "Screen"}
|
||||
{ description = "Focus the next screen", group = "Screen" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"k",
|
||||
function ()
|
||||
function()
|
||||
awful.screen.focus_relative(-1)
|
||||
end,
|
||||
{description = "Focus the previous screen", group = "Screen"}
|
||||
{ description = "Focus the previous screen", group = "Screen" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"u",
|
||||
awful.client.urgent.jumpto,
|
||||
{description = "Jump to urgent client", group = "Client"}
|
||||
{ description = "Jump to urgent client", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Return",
|
||||
function ()
|
||||
function()
|
||||
awful.spawn(user_vars.vars.terminal)
|
||||
end,
|
||||
{description = "Open terminal", group = "Applications"}
|
||||
{ description = "Open terminal", group = "Applications" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"r",
|
||||
awesome.restart,
|
||||
{description = "Reload awesome", group = "Awesome"}
|
||||
{ description = "Reload awesome", group = "Awesome" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"l",
|
||||
function ()
|
||||
awful.tag.incmwfact( 0.05)
|
||||
function()
|
||||
awful.tag.incmwfact(0.05)
|
||||
end,
|
||||
{description = "Increase client width", group = "Layout"}
|
||||
{ description = "Increase client width", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"h",
|
||||
function ()
|
||||
function()
|
||||
awful.tag.incmwfact(-0.05)
|
||||
end,
|
||||
{description = "Decrease client width", group = "Layout"}
|
||||
{ description = "Decrease client width", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"h",
|
||||
function ()
|
||||
function()
|
||||
awful.tag.incncol(1, nil, true)
|
||||
end,
|
||||
{description = "Increase the number of columns", group = "Layout"}
|
||||
{ description = "Increase the number of columns", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"l",
|
||||
function ()
|
||||
function()
|
||||
awful.tag.incncol(-1, nil, true)
|
||||
end,
|
||||
{description = "Decrease the number of columns", group = "Layout"}
|
||||
{ description = "Decrease the number of columns", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"space",
|
||||
function ()
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end,
|
||||
{description = "Select previous layout", group = "Layout"}
|
||||
{ description = "Select previous layout", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"Return",
|
||||
function ()
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end,
|
||||
{description = "Select next layout", group = "Layout"}
|
||||
{ description = "Select next layout", group = "Layout" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"d",
|
||||
function ()
|
||||
awful.spawn("/home/crylia/.local/bin/rofi -show drun -theme ~/.config/rofi/rofi.rasi")
|
||||
end,
|
||||
{ descripton = "Application launcher", group = "Application" }
|
||||
),
|
||||
{ modkey },
|
||||
"d",
|
||||
function()
|
||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi")
|
||||
end,
|
||||
{ descripton = "Application launcher", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Tab",
|
||||
function ()
|
||||
awful.spawn("/home/crylia/.local/bin/rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
{ modkey },
|
||||
"Tab",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ "Mod1" },
|
||||
"Tab",
|
||||
function ()
|
||||
awful.spawn("/home/crylia/.local/bin/rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
{ "Mod1" },
|
||||
"Tab",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"e",
|
||||
function ()
|
||||
awful.spawn(user_vars.vars.file_manager)
|
||||
function()
|
||||
awful.spawn(user_vars.vars.file_manager)
|
||||
end,
|
||||
{ descripton = "Open file manager", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"e",
|
||||
function ()
|
||||
function()
|
||||
awesome.emit_signal("module::powermenu:show")
|
||||
end,
|
||||
{ descripton = "Session options", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ },
|
||||
{},
|
||||
"Print",
|
||||
function ()
|
||||
function()
|
||||
awful.spawn(user_vars.vars.screenshot_program)
|
||||
end,
|
||||
{ description = "Screenshot", group = "Applications" }
|
||||
),
|
||||
awful.key(
|
||||
{ },
|
||||
{},
|
||||
"XF86AudioLowerVolume",
|
||||
function (c)
|
||||
function(c)
|
||||
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ -2%")
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
@@ -218,18 +218,18 @@ return function()
|
||||
{ description = "Lower volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ },
|
||||
{},
|
||||
"XF86AudioRaiseVolume",
|
||||
function (c)
|
||||
function(c)
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
|
||||
function (stdout)
|
||||
stdout = stdout:gsub("%%", "")
|
||||
local volume = tonumber(stdout) or 0
|
||||
if volume <= 98 then
|
||||
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +2%")
|
||||
end
|
||||
end)
|
||||
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
|
||||
function(stdout)
|
||||
stdout = stdout:gsub("%%", "")
|
||||
local volume = tonumber(stdout) or 0
|
||||
if volume <= 98 then
|
||||
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +2%")
|
||||
end
|
||||
end)
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
@@ -238,9 +238,9 @@ return function()
|
||||
{ description = "Increase volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ },
|
||||
{},
|
||||
"XF86AudioMute",
|
||||
function (c)
|
||||
function(c)
|
||||
awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
@@ -250,9 +250,9 @@ return function()
|
||||
{ description = "Mute volume", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ },
|
||||
{},
|
||||
"XF86MonBrightnessUp",
|
||||
function (c)
|
||||
function(c)
|
||||
awful.spawn("xbacklight -time 100 -inc 10%+")
|
||||
awesome.emit_signal("module::brightness_osd:show", true)
|
||||
awesome.emit_signal("module::brightness_slider:update")
|
||||
@@ -261,9 +261,9 @@ return function()
|
||||
{ description = "Raise backlight brightness", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ },
|
||||
{},
|
||||
"XF86MonBrightnessDown",
|
||||
function (c)
|
||||
function(c)
|
||||
awful.spawn("xbacklight -time 100 -dec 10%-")
|
||||
awesome.emit_signal("widget::brightness_osd:rerun")
|
||||
awesome.emit_signal("module::brightness_osd:show", true)
|
||||
@@ -272,14 +272,38 @@ return function()
|
||||
{ description = "Lower backlight brightness", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
{},
|
||||
"XF86AudioPlay",
|
||||
function(c)
|
||||
awful.spawn("playerctl play-pause")
|
||||
end,
|
||||
{ description = "Play / Pause audio", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioNext",
|
||||
function(c)
|
||||
awful.spawn("playerctl next")
|
||||
end,
|
||||
{ description = "Play / Pause audio", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"XF86AudioPrev",
|
||||
function(c)
|
||||
awful.spawn("playerctl previous")
|
||||
end,
|
||||
{ description = "Play / Pause audio", group = "System" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"space",
|
||||
function ()
|
||||
function()
|
||||
awesome.emit_signal("kblayout::toggle")
|
||||
end,
|
||||
{ description = "Toggle keyboard layout", group = "System" }
|
||||
)
|
||||
)
|
||||
|
||||
return globalkeys
|
||||
return globalkeys
|
||||
end
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local colors = require ("theme.crylia.colors")
|
||||
local colors = require("theme.crylia.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
return function(s, programs)
|
||||
return function(screen, programs)
|
||||
|
||||
local function create_dock_element (program, name, is_steam, size)
|
||||
local function create_dock_element(program, name, is_steam, size)
|
||||
is_steam = is_steam or false
|
||||
|
||||
local dock_element = wibox.widget{
|
||||
local dock_element = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -21,7 +21,7 @@ return function(s, programs)
|
||||
resize = true,
|
||||
forced_width = size,
|
||||
forced_height = size,
|
||||
image = Get_icon("Papirus-Dark",program, is_steam),
|
||||
image = Get_icon("Papirus-Dark", program, is_steam),
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
{
|
||||
@@ -36,7 +36,7 @@ return function(s, programs)
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
end,
|
||||
bg = colors.color["Grey900"],
|
||||
@@ -47,11 +47,11 @@ return function(s, programs)
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
hover_signal(dock_element.background, colors.color["Grey800"], colors.color["White"])
|
||||
Hover_signal(dock_element.background, colors.color["Grey800"], colors.color["White"])
|
||||
|
||||
dock_element:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
if is_steam then
|
||||
awful.spawn("steam steam://rungameid/" .. program)
|
||||
else
|
||||
@@ -61,7 +61,7 @@ return function(s, programs)
|
||||
)
|
||||
|
||||
awful.tooltip {
|
||||
objects = {dock_element},
|
||||
objects = { dock_element },
|
||||
text = name,
|
||||
mode = "outside",
|
||||
preferred_alignments = "middle",
|
||||
@@ -72,8 +72,8 @@ return function(s, programs)
|
||||
local color = ""
|
||||
local indicators
|
||||
local t = 1
|
||||
for indicator_screen in screen do
|
||||
for j,indicator_client in ipairs(indicator_screen.get_clients()) do
|
||||
--[[ for indicator_screen in screen do
|
||||
for j, indicator_client in ipairs(indicator_screen.get_clients()) do
|
||||
if indicator_client.class == program then
|
||||
if indicator_client.maximized then
|
||||
color = colors.color["Green200"]
|
||||
@@ -87,7 +87,7 @@ return function(s, programs)
|
||||
color = colors.color["White"]
|
||||
end
|
||||
|
||||
local indicator = wibox.widget{
|
||||
local indicator = wibox.widget {
|
||||
widget = wibox.container.background,
|
||||
shape = gears.shape.circle,
|
||||
forced_height = dpi(50),
|
||||
@@ -97,7 +97,7 @@ return function(s, programs)
|
||||
t = t + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end ]]
|
||||
return indicators
|
||||
end
|
||||
|
||||
@@ -106,22 +106,34 @@ return function(s, programs)
|
||||
return dock_element
|
||||
end
|
||||
|
||||
local dock = awful.popup{
|
||||
local dock = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = colors.color["Grey900"],
|
||||
visible = true,
|
||||
screen = s,
|
||||
screen = screen,
|
||||
type = "dock",
|
||||
height = user_vars.vars.dock_icon_size + 10,
|
||||
placement = function(c) awful.placement.bottom(c, {margins = dpi(10)}) end,
|
||||
placement = function(c) awful.placement.bottom(c, { margins = dpi(10) }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 15)
|
||||
end
|
||||
}
|
||||
|
||||
local fakedock = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = '#00000000',
|
||||
visible = true,
|
||||
screen = screen,
|
||||
type = "dock",
|
||||
id = "fakedock",
|
||||
height = dpi(10),
|
||||
placement = function(c) awful.placement.bottom(c, { margins = dpi(0) }) end,
|
||||
}
|
||||
|
||||
local function get_dock_elements(pr)
|
||||
local dock_elements = {layout = wibox.layout.fixed.horizontal}
|
||||
local dock_elements = { layout = wibox.layout.fixed.horizontal }
|
||||
|
||||
for i, p in ipairs(pr) do
|
||||
dock_elements[i] = create_dock_element(p[1], p[2], p[3], user_vars.vars.dock_icon_size)
|
||||
@@ -130,60 +142,83 @@ return function(s, programs)
|
||||
return dock_elements
|
||||
end
|
||||
|
||||
local function get_fake_elements(amount)
|
||||
local fake_elements = { layout = wibox.layout.fixed.horizontal }
|
||||
|
||||
for i = 0, amount, 1 do
|
||||
fake_elements[i] = wibox.widget {
|
||||
bg = '00000000',
|
||||
forced_width = user_vars.vars.dock_icon_size + dpi(20),
|
||||
forced_height = dpi(10),
|
||||
widget = wibox.container.background
|
||||
}
|
||||
end
|
||||
return fake_elements
|
||||
end
|
||||
|
||||
dock:setup {
|
||||
get_dock_elements(programs),
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
|
||||
--TODO: Replace with fake elements
|
||||
fakedock:setup {
|
||||
get_fake_elements(#programs),
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
local naughty = require("naughty")
|
||||
--[[ TODO: This function runs every 0.1 second, it can be optimized by
|
||||
calling it every time the mouse is over the dock, a client changes it states ...
|
||||
but im too lazy rn ]]
|
||||
local function check_for_dock_hide()
|
||||
for s in screen do
|
||||
local mx, my = mouse.coords().x * 100 / s.geometry.width, mouse.coords().y * 100 / s.geometry.height
|
||||
if ((mx > 30) and (mx < 70)) and (my > 99) then
|
||||
-- TODO: draw a invisible non clickable fake dock and check of mouse if over that
|
||||
local function check_for_dock_hide(s)
|
||||
if s == mouse.screen then
|
||||
--local mx, my = mouse.coords().x * 100 / screen.geometry.width, mouse.coords().y * 100 / screen.geometry.height
|
||||
|
||||
if mouse.current_widget then
|
||||
dock.visible = true
|
||||
break;
|
||||
return
|
||||
end
|
||||
for j,c in ipairs(s.get_clients()) do
|
||||
for j, c in ipairs(screen.get_clients()) do
|
||||
local y = c:geometry().y
|
||||
local h = c.height
|
||||
if (y + h) >= s.geometry.height - user_vars.vars.dock_icon_size - 35 then
|
||||
if (y + h) >= screen.geometry.height - user_vars.vars.dock_icon_size - 35 then
|
||||
dock.visible = false
|
||||
break;
|
||||
else
|
||||
dock.visible = true
|
||||
end
|
||||
end
|
||||
else
|
||||
dock.visible = false
|
||||
end
|
||||
end
|
||||
|
||||
client.connect_signal(
|
||||
"manage",
|
||||
function ()
|
||||
check_for_dock_hide()
|
||||
function()
|
||||
check_for_dock_hide(screen)
|
||||
end
|
||||
)
|
||||
|
||||
local dock_intelligent_hide = gears.timer{
|
||||
local dock_intelligent_hide = gears.timer {
|
||||
timeout = 1,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function ()
|
||||
check_for_dock_hide()
|
||||
callback = function()
|
||||
check_for_dock_hide(screen)
|
||||
end
|
||||
}
|
||||
|
||||
dock:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
dock_intelligent_hide:stop()
|
||||
end
|
||||
)
|
||||
|
||||
dock:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
dock_intelligent_hide:again()
|
||||
end
|
||||
)
|
||||
|
||||
@@ -3,27 +3,27 @@
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local colors = require ("theme.crylia.colors")
|
||||
local colors = require("theme.crylia.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
return function (s, widgets)
|
||||
return function(s, widgets)
|
||||
|
||||
local top_left = awful.popup{
|
||||
local top_left = awful.popup {
|
||||
screen = s,
|
||||
widget = wibox.container.background,
|
||||
ontop = false,
|
||||
bg = colors.color["Grey900"],
|
||||
visible = true,
|
||||
maximum_width = dpi(650),
|
||||
placement = function(c) awful.placement.top_left(c, {margins = dpi(10)}) end,
|
||||
shape = function (cr, width, height)
|
||||
maximum_width = dpi(650),
|
||||
placement = function(c) awful.placement.top_left(c, { margins = dpi(10) }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
|
||||
top_left:struts{
|
||||
top_left:struts {
|
||||
top = 55
|
||||
}
|
||||
|
||||
|
||||
@@ -4,21 +4,21 @@ local beautiful = require("beautiful")
|
||||
|
||||
screen.connect_signal(
|
||||
"added",
|
||||
function ()
|
||||
function()
|
||||
awesome.restart()
|
||||
end
|
||||
)
|
||||
|
||||
screen.connect_signal(
|
||||
"removed",
|
||||
function ()
|
||||
function()
|
||||
awesome.restart()
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
"manage",
|
||||
function (c)
|
||||
function(c)
|
||||
if awesome.startup and not c.size_hints.user_porition and not c.size_hints.program_position then
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
@@ -58,24 +58,24 @@ client.connect_signal(
|
||||
|
||||
-- Sloppy focus
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||
c:emit_signal("request::activate", "mouse_enter", { raise = false })
|
||||
end)
|
||||
|
||||
-- Workaround for focused border color, why in the love of god doesnt it work with
|
||||
-- beautiful.border_focus
|
||||
client.connect_signal("focus", function (c)
|
||||
client.connect_signal("focus", function(c)
|
||||
c.border_color = "#616161"
|
||||
end)
|
||||
|
||||
client.connect_signal("unfocus", function (c)
|
||||
client.connect_signal("unfocus", function(c)
|
||||
c.border_color = beautiful.border_normal
|
||||
end)
|
||||
|
||||
function hover_signal (widget, bg, fg)
|
||||
function Hover_signal(widget, bg, fg)
|
||||
local old_wibox, old_cursor, old_bg, old_fg
|
||||
widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
if bg then
|
||||
old_bg = widget.bg
|
||||
if string.len(bg) == 7 then
|
||||
@@ -98,7 +98,7 @@ function hover_signal (widget, bg, fg)
|
||||
|
||||
widget:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
if bg then
|
||||
if bg then
|
||||
if string.len(bg) == 7 then
|
||||
@@ -116,7 +116,7 @@ function hover_signal (widget, bg, fg)
|
||||
|
||||
widget:connect_signal(
|
||||
"button::release",
|
||||
function ()
|
||||
function()
|
||||
if bg then
|
||||
if bg then
|
||||
if string.len(bg) == 7 then
|
||||
@@ -134,7 +134,7 @@ function hover_signal (widget, bg, fg)
|
||||
|
||||
widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
if bg then
|
||||
widget.bg = old_bg
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ local awful = require("awful")
|
||||
return function()
|
||||
local tags = {}
|
||||
awful.screen.connect_for_each_screen(
|
||||
function (s)
|
||||
function(s)
|
||||
tags[s] = awful.tag(
|
||||
{
|
||||
"1", "2", "3", "4", "5", "6", "7", "8", "9"
|
||||
@@ -20,4 +20,4 @@ return function()
|
||||
)
|
||||
|
||||
return tags
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ local home = os.getenv("HOME")
|
||||
local function get_screen()
|
||||
local screen = {}
|
||||
for i, s in ipairs(screen) do
|
||||
screen[i] = {screen.x, screen.y}
|
||||
screen[i] = { screen.x, screen.y }
|
||||
end
|
||||
return screen
|
||||
end
|
||||
@@ -15,20 +15,32 @@ end
|
||||
-- If you want different default programs, wallpaper path or modkey; edit this file.
|
||||
local _M = {
|
||||
|
||||
network = {
|
||||
wlan = "",
|
||||
ethernet = "eno1"
|
||||
},
|
||||
|
||||
-- Set your font with this format:
|
||||
font = {
|
||||
regular = "JetBrainsMono Nerd Font, 14",
|
||||
bold = "JetBrainsMono Nerd Font, bold 14",
|
||||
extrabold = "JetBrainsMono Nerd Font, ExtraBold 14"
|
||||
},
|
||||
|
||||
-- This is your default Terminal
|
||||
terminal = "alacritty -o font.size=8",
|
||||
terminal = "alacritty -o font.size=14",
|
||||
|
||||
-- This is the modkey 'mod4' = Super/Mod/WindowsKey, 'mod3' = alt...
|
||||
modkey = "Mod4",
|
||||
|
||||
-- place your wallpaper at this path with this name, you could also try to change the path
|
||||
wallpaper = home .. "/.config/awesome/theme/crylia/assets/space.jpg",
|
||||
wallpaper = home .. "/.config/awesome/theme/crylia/assets/fuji.jpg",
|
||||
|
||||
-- Naming scheme for the powermenu, userhost = "user@hostname", fullname = "Firstname Surname", something else ...
|
||||
namestyle = "userhost",
|
||||
|
||||
-- List every Keyboard layout you use here comma seperated. (run localectl list-keymaps to list all averiable keymaps)
|
||||
kblayout = {"de", "ru"},
|
||||
kblayout = { "de", "ru" },
|
||||
|
||||
-- Set to false if you dont have a controller
|
||||
bluetooth = true,
|
||||
@@ -47,15 +59,15 @@ local _M = {
|
||||
-- Second can be what ever the fuck you want it to be (will be the displayed name if you hover over it)
|
||||
-- For steam games please use this format {"394360", "Name", true} true will tell the func that it's a steam game
|
||||
dock_programs = {
|
||||
{"firefox", "Firefox"},
|
||||
{"discord", "Discord"},
|
||||
{"spotify", "Spotify"},
|
||||
{"code", "Visual Studio Code"},
|
||||
{"arduino", "Arduino IDE"},
|
||||
{"zoom", "Zoom"},
|
||||
{"thunderbird", "Thunderbird"},
|
||||
{"mattermost-desktop", "Mattermost"},
|
||||
{"blender", "Blender"}
|
||||
{ "firefox", "Firefox" },
|
||||
{ "discord", "Discord" },
|
||||
{ "spotify", "Spotify" },
|
||||
{ "code", "Visual Studio Code" },
|
||||
{ "arduino", "Arduino IDE" },
|
||||
{ "zoom", "Zoom" },
|
||||
{ "thunderbird", "Thunderbird" },
|
||||
{ "mattermost-desktop", "Mattermost" },
|
||||
{ "blender", "Blender" }
|
||||
},
|
||||
|
||||
screens_size = get_screen()
|
||||
|
||||
@@ -57,11 +57,11 @@ user_vars.main_menu = awful.menu({
|
||||
items = main.menu()
|
||||
})
|
||||
|
||||
-- A Variable needed in Statusbar (helper)
|
||||
--[[ -- A Variable needed in Statusbar (helper)
|
||||
user_vars.launcher = awful.widget.launcher({
|
||||
image = beautiful.awesome_icon,
|
||||
menu = user_vars.main_menu
|
||||
})
|
||||
}) ]]
|
||||
|
||||
-- Menubar configuration
|
||||
menubar.utils.terminal = user_vars.vars.terminal
|
||||
@@ -70,7 +70,7 @@ menubar.utils.terminal = user_vars.vars.terminal
|
||||
root.buttons(bindings.global_buttons())
|
||||
root.keys(bindings.bind_to_tags(bindings.global_keys()))
|
||||
|
||||
-- Default statusbar, comment if you want use a third party tool like polybar
|
||||
-- Default statusbar
|
||||
require("crylia_bar.init")
|
||||
|
||||
-- Rules to apply to new clients
|
||||
@@ -81,9 +81,4 @@ awful.rules.rules = main.rules(
|
||||
|
||||
-- Signals
|
||||
require("main.signals")
|
||||
|
||||
-- Autostart programs
|
||||
--awful.spawn.with_shell("~/.screenlayout/single_screen.sh")
|
||||
awful.spawn.with_shell("picom --experimental-backends")
|
||||
awful.spawn.with_shell("xfce4-power-manager")
|
||||
awful.spawn.with_shell("light-locker --lock-on-suspend --lock-on-lid &")
|
||||
require("theme.crylia.tools.auto_starter")
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
awmtt -c rc.lua -S 1800x900
|
||||
|
Before Width: | Height: | Size: 1008 KiB |
BIN
awesome/theme/crylia/assets/fuji.jpg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
awesome/theme/crylia/assets/fuji.png
Normal file
|
After Width: | Height: | Size: 4.3 MiB |
|
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 292 KiB |
|
Before Width: | Height: | Size: 364 KiB |
|
Before Width: | Height: | Size: 1008 KiB |
@@ -10,28 +10,28 @@ local gears = require("gears")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local color = require("theme.crylia.colors")
|
||||
|
||||
return function (s)
|
||||
return function(s)
|
||||
local styles = {}
|
||||
|
||||
styles.month = {
|
||||
styles.month = {
|
||||
padding = 15,
|
||||
bg_color = color.color["Grey900"],
|
||||
border_width = 1,
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
styles.normal = {
|
||||
fg_color = color.color["Grey900"],
|
||||
font = "JetBrainsMonoExtraBold NF",
|
||||
shape = function (cr, width, height)
|
||||
font = user_vars.vars.font.extrabold,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
styles.focus = {
|
||||
styles.focus = {
|
||||
fg_color = color.color["Grey900"],
|
||||
bg_color = color.color["Purple200"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
@@ -39,7 +39,7 @@ return function (s)
|
||||
fg_color = color.color["Grey900"],
|
||||
bg_color = color.color["Teal200"],
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
@@ -48,12 +48,12 @@ return function (s)
|
||||
fg_color = color.color["Grey900"],
|
||||
bg_color = color.color["Teal200"],
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
local function decorate_cell(widget, flag, date)
|
||||
if flag=='monthheader' and not styles.monthheader then
|
||||
if flag == 'monthheader' and not styles.monthheader then
|
||||
flag = 'header'
|
||||
end
|
||||
local props = styles[flag] or {}
|
||||
@@ -61,19 +61,19 @@ return function (s)
|
||||
widget:set_markup(props.markup(widget:get_text()))
|
||||
end
|
||||
-- Change bg color for weekends
|
||||
local d = {year=date.year, month=(date.month or 1), day=(date.day or 1)}
|
||||
local d = { year = date.year, month = (date.month or 1), day = (date.day or 1) }
|
||||
local weekday = tonumber(os.date('%w', os.time(d)))
|
||||
local default_bg = (weekday == 0 or weekday == 6) and color.color["Red200"] or color.color["White"]
|
||||
local ret = wibox.widget {
|
||||
{
|
||||
widget,
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
top = dpi(4),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
top = dpi(4),
|
||||
bottom = dpi(4),
|
||||
widget = wibox.container.margin
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
fg = props.fg_color or '#999999',
|
||||
@@ -82,15 +82,16 @@ return function (s)
|
||||
}
|
||||
return ret
|
||||
end
|
||||
|
||||
local calendar = wibox.widget {
|
||||
date = os.date('*t'),
|
||||
fn_embed = decorate_cell,
|
||||
widget = wibox.widget.calendar.month,
|
||||
font = "JetBrainsMonoExtraBold NF",
|
||||
font = user_vars.vars.font.extrabold,
|
||||
spacing = dpi(10)
|
||||
}
|
||||
|
||||
local calendar_osd_widget = wibox.widget{
|
||||
local calendar_osd_widget = wibox.widget {
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
fg = "#ffffff",
|
||||
@@ -106,7 +107,7 @@ return function (s)
|
||||
layout = wibox.layout.fixed.vertical
|
||||
}
|
||||
|
||||
local set_clock = function ()
|
||||
local set_clock = function()
|
||||
calendar_osd_widget.digital_clock:set_text(os.date("%H:%M"))
|
||||
end
|
||||
|
||||
@@ -114,40 +115,40 @@ return function (s)
|
||||
timeout = 5,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function ()
|
||||
callback = function()
|
||||
set_clock()
|
||||
end
|
||||
}
|
||||
|
||||
local calendar_osd_container = awful.popup{
|
||||
local calendar_osd_container = awful.popup {
|
||||
screen = s,
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = color.color["Grey900"],
|
||||
stretch = false,
|
||||
visible = false,
|
||||
placement = function (c)awful.placement.top_right(c, {margins = {right = dpi(100),top = dpi(60)}})end,
|
||||
shape = function (cr, width, height)
|
||||
placement = function(c) awful.placement.top_right(c, { margins = { right = dpi(100), top = dpi(60) } }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end
|
||||
}
|
||||
|
||||
local hide_osd = gears.timer{
|
||||
local hide_osd = gears.timer {
|
||||
timeout = 0.25,
|
||||
autostart = true,
|
||||
callback = function ()
|
||||
callback = function()
|
||||
calendar_osd_container.visible = false
|
||||
end
|
||||
}
|
||||
|
||||
calendar_osd_container:setup{
|
||||
calendar_osd_container:setup {
|
||||
calendar_osd_widget,
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
|
||||
calendar_osd_container:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
calendar_osd_container.visible = true
|
||||
hide_osd:stop()
|
||||
end
|
||||
@@ -155,7 +156,7 @@ return function (s)
|
||||
|
||||
calendar_osd_container:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
calendar_osd_container.visible = false
|
||||
hide_osd:stop()
|
||||
end
|
||||
@@ -163,7 +164,7 @@ return function (s)
|
||||
|
||||
awesome.connect_signal(
|
||||
"widget::calendar_osd:stop",
|
||||
function ()
|
||||
function()
|
||||
calendar_osd_container.visible = true
|
||||
hide_osd:stop()
|
||||
end
|
||||
@@ -171,7 +172,7 @@ return function (s)
|
||||
|
||||
awesome.connect_signal(
|
||||
"widget::calendar_osd:rerun",
|
||||
function ()
|
||||
function()
|
||||
if hide_osd.started then
|
||||
hide_osd:again()
|
||||
else
|
||||
|
||||
@@ -13,15 +13,15 @@ require("main.signals")
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/powermenu/"
|
||||
|
||||
return function (s)
|
||||
return function(s)
|
||||
|
||||
-- Profile picture imagebox
|
||||
local profile_picture = wibox.widget {
|
||||
image = icondir .. "defaultpfp.svg",
|
||||
resize = true,
|
||||
forced_height = dpi(200),
|
||||
clip_shape = function (cr, width, height)
|
||||
gears.shape.rounded_rect(cr, dpi(width), dpi(height), 30)
|
||||
clip_shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 30)
|
||||
end,
|
||||
widget = wibox.widget.imagebox
|
||||
}
|
||||
@@ -38,7 +38,7 @@ return function (s)
|
||||
-- Get the profile script from /var/lib/AccountsService/icons/${USER}
|
||||
-- and copy it to the assets folder
|
||||
-- TODO: If the user doesnt have AccountsService look into $HOME/.faces
|
||||
local update_profile_picture = function ()
|
||||
local update_profile_picture = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[=[
|
||||
iconPath="/var/lib/AccountsService/icons/${USER}"
|
||||
@@ -65,7 +65,7 @@ return function (s)
|
||||
fi
|
||||
fi
|
||||
]=],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
if stdout then
|
||||
profile_picture:set_image(stdout:gsub("\n", ""))
|
||||
else
|
||||
@@ -107,7 +107,7 @@ return function (s)
|
||||
|
||||
-- Universal Button widget
|
||||
local button = function(name, icon, bg_color, callback)
|
||||
local item = wibox.widget{
|
||||
local item = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -141,7 +141,7 @@ return function (s)
|
||||
},
|
||||
fg = color.color["Grey900"],
|
||||
bg = bg_color,
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
end,
|
||||
widget = wibox.container.background,
|
||||
@@ -194,11 +194,11 @@ return function (s)
|
||||
local lock_button = button("Lock", icondir .. "lock.svg", color.color["Orange200"], lock_command)
|
||||
|
||||
-- Signals to change color on hover
|
||||
hover_signal(shutdown_button.background, color.color["Blue200"])
|
||||
hover_signal(reboot_button.background, color.color["Red200"])
|
||||
hover_signal(suspend_button.background, color.color["Yellow200"])
|
||||
hover_signal(logout_button.background, color.color["Green200"])
|
||||
hover_signal(lock_button.background, color.color["Orange200"])
|
||||
Hover_signal(shutdown_button.background, color.color["Blue200"])
|
||||
Hover_signal(reboot_button.background, color.color["Red200"])
|
||||
Hover_signal(suspend_button.background, color.color["Yellow200"])
|
||||
Hover_signal(logout_button.background, color.color["Green200"])
|
||||
Hover_signal(lock_button.background, color.color["Orange200"])
|
||||
|
||||
-- The powermenu widget
|
||||
local powermenu = wibox.widget {
|
||||
@@ -263,7 +263,7 @@ return function (s)
|
||||
}
|
||||
|
||||
-- Container for the widget, covers the entire screen
|
||||
local powermenu_container = wibox{
|
||||
local powermenu_container = wibox {
|
||||
widget = powermenu,
|
||||
screen = s,
|
||||
type = "splash",
|
||||
@@ -282,7 +282,7 @@ return function (s)
|
||||
awful.button(
|
||||
{},
|
||||
3,
|
||||
function ()
|
||||
function()
|
||||
awesome.emit_signal("module::powermenu:hide")
|
||||
end
|
||||
)
|
||||
@@ -290,10 +290,10 @@ return function (s)
|
||||
)
|
||||
|
||||
-- Close on Escape
|
||||
local powermenu_keygrabber = awful.keygrabber{
|
||||
local powermenu_keygrabber = awful.keygrabber {
|
||||
autostart = false,
|
||||
stop_event = 'release',
|
||||
keypressed_callback = function (self, mod, key, command)
|
||||
keypressed_callback = function(self, mod, key, command)
|
||||
if key == 'Escape' then
|
||||
awesome.emit_signal("module::powermenu:hide")
|
||||
end
|
||||
@@ -317,4 +317,4 @@ return function (s)
|
||||
powermenu_container.visible = false
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,28 +17,28 @@ awful.titlebar.enable_tooltip = true
|
||||
awful.titlebar.fallback_name = 'Client'
|
||||
|
||||
local double_click_event_handler = function(double_click_event)
|
||||
if double_click_timer then
|
||||
double_click_timer:stop()
|
||||
double_click_timer = nil
|
||||
double_click_event()
|
||||
return
|
||||
end
|
||||
double_click_timer = gears.timer.start_new(
|
||||
0.20,
|
||||
function()
|
||||
double_click_timer = nil
|
||||
return false
|
||||
end
|
||||
)
|
||||
if double_click_timer then
|
||||
double_click_timer:stop()
|
||||
double_click_timer = nil
|
||||
double_click_event()
|
||||
return
|
||||
end
|
||||
double_click_timer = gears.timer.start_new(
|
||||
0.20,
|
||||
function()
|
||||
double_click_timer = nil
|
||||
return false
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
local create_click_events = function (c)
|
||||
local create_click_events = function(c)
|
||||
local buttons = gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function ()
|
||||
double_click_event_handler(function ()
|
||||
function()
|
||||
double_click_event_handler(function()
|
||||
if c.floating then
|
||||
c.float = false
|
||||
return
|
||||
@@ -52,7 +52,7 @@ local create_click_events = function (c)
|
||||
awful.button(
|
||||
{},
|
||||
3,
|
||||
function ()
|
||||
function()
|
||||
c:activate { context = 'titlebar', action = 'mouse_resize' }
|
||||
end
|
||||
)
|
||||
@@ -60,12 +60,12 @@ local create_click_events = function (c)
|
||||
return buttons
|
||||
end
|
||||
|
||||
local createresize_click_events = function (c)
|
||||
local createresize_click_events = function(c)
|
||||
local buttons = gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function ()
|
||||
function()
|
||||
c:activate { context = 'titlebar', action = 'mouse_resize' }
|
||||
end
|
||||
)
|
||||
@@ -73,21 +73,21 @@ local createresize_click_events = function (c)
|
||||
return buttons
|
||||
end
|
||||
|
||||
local create_titlebar = function (c, bg, size)
|
||||
local create_titlebar = function(c, bg, size)
|
||||
local titlebar = awful.titlebar(c, {
|
||||
position = "left",
|
||||
bg = bg,
|
||||
size = size
|
||||
})
|
||||
|
||||
titlebar : setup {
|
||||
titlebar:setup {
|
||||
{
|
||||
{
|
||||
{
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Red200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "closebutton"
|
||||
@@ -96,7 +96,7 @@ local create_titlebar = function (c, bg, size)
|
||||
awful.titlebar.widget.maximizedbutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Yellow200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "maximizebutton"
|
||||
@@ -105,22 +105,22 @@ local create_titlebar = function (c, bg, size)
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Green200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "minimizebutton"
|
||||
},
|
||||
spacing = dpi(10),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
},
|
||||
margins = dpi(8),
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
{
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
{
|
||||
{
|
||||
@@ -132,26 +132,26 @@ local create_titlebar = function (c, bg, size)
|
||||
layout = wibox.layout.align.vertical,
|
||||
id = "main"
|
||||
}
|
||||
hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
hover_signal(titlebar.main.margin.spacing.maximizebutton, color.color["Yellow200"])
|
||||
hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.maximizebutton, color.color["Yellow200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
end
|
||||
|
||||
local create_titlebar_dialog = function(c, bg, size)
|
||||
local titlebar = awful.titlebar(c, {
|
||||
local titlebar = awful.titlebar(c, {
|
||||
position = "left",
|
||||
bg = bg,
|
||||
size = size
|
||||
})
|
||||
|
||||
titlebar : setup {
|
||||
titlebar:setup {
|
||||
{
|
||||
{
|
||||
{
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Red200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "closebutton"
|
||||
@@ -160,22 +160,22 @@ local create_titlebar_dialog = function(c, bg, size)
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Green200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "minimizebutton"
|
||||
},
|
||||
spacing = dpi(10),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
},
|
||||
margins = dpi(8),
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
{
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
{
|
||||
{
|
||||
@@ -187,33 +187,33 @@ local create_titlebar_dialog = function(c, bg, size)
|
||||
layout = wibox.layout.align.vertical,
|
||||
id = "main"
|
||||
}
|
||||
hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
end
|
||||
|
||||
local create_titlebar_borderhack = function (c, bg, position)
|
||||
local create_titlebar_borderhack = function(c, bg, position)
|
||||
local borderhack = awful.titlebar(c, {
|
||||
position = position,
|
||||
bg = bg,
|
||||
size = "2"
|
||||
})
|
||||
borderhack : setup {
|
||||
borderhack:setup {
|
||||
{
|
||||
bg = bg,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
buttons = createresize_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
nil,
|
||||
layout = wibox.layout.align.vertical
|
||||
}
|
||||
{
|
||||
buttons = createresize_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
nil,
|
||||
layout = wibox.layout.align.vertical
|
||||
}
|
||||
|
||||
local old_wibox, old_cursor
|
||||
borderhack:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
local w = mouse.current_client
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
@@ -224,7 +224,7 @@ local create_titlebar_borderhack = function (c, bg, position)
|
||||
|
||||
borderhack:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
@@ -234,8 +234,8 @@ local create_titlebar_borderhack = function (c, bg, position)
|
||||
|
||||
end
|
||||
|
||||
local draw_titlebar = function (c)
|
||||
if c.type == 'normal' and not c.requests_no_titlebar then
|
||||
local draw_titlebar = function(c)
|
||||
if c.type == 'normal' and not c.requests_no_titlebar then
|
||||
create_titlebar_borderhack(c, "#121212AA", "right")
|
||||
create_titlebar_borderhack(c, "#121212AA", "top")
|
||||
create_titlebar_borderhack(c, "#121212AA", "bottom")
|
||||
@@ -267,7 +267,7 @@ end
|
||||
|
||||
client.connect_signal(
|
||||
"property::maximized",
|
||||
function (c)
|
||||
function(c)
|
||||
if c.maximized then
|
||||
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
||||
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
||||
@@ -282,7 +282,7 @@ client.connect_signal(
|
||||
|
||||
client.connect_signal(
|
||||
"request::titlebars",
|
||||
function (c)
|
||||
function(c)
|
||||
if c.maximized then
|
||||
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
||||
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
||||
@@ -304,7 +304,7 @@ client.connect_signal(
|
||||
|
||||
client.connect_signal(
|
||||
'property::floating',
|
||||
function (c)
|
||||
function(c)
|
||||
if c.floating and not c.maximized then
|
||||
if c.class == "Steam" then
|
||||
awful.titlebar.hide(c, 'left')
|
||||
|
||||
@@ -13,9 +13,9 @@ local wibox = require("wibox")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
|
||||
|
||||
-- Returns the volume_osd
|
||||
return function (s)
|
||||
return function(s)
|
||||
|
||||
local volume_osd_widget = wibox.widget{
|
||||
local volume_osd_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -101,8 +101,6 @@ return function (s)
|
||||
|
||||
local function update_osd()
|
||||
local volume_level = volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:get_value()
|
||||
|
||||
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ ".. volume_level .. "%", false)
|
||||
awesome.emit_signal("widget::volume")
|
||||
volume_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text(volume_level .. "%")
|
||||
|
||||
@@ -133,22 +131,26 @@ return function (s)
|
||||
|
||||
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:connect_signal(
|
||||
"property::value",
|
||||
function ()
|
||||
function()
|
||||
update_osd()
|
||||
end
|
||||
)
|
||||
|
||||
local update_slider = function ()
|
||||
local update_slider = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ pacmd list-sinks | grep "muted" ]],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
if stdout:match("yes") then
|
||||
volume_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text("0%")
|
||||
volume_osd_widget.container.osd_layout.icon_slider_layout.icon_margin1.icon_margin2.icon:set_image(icondir .. "volume-mute" .. ".svg")
|
||||
else
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
|
||||
function (stdout2)
|
||||
[[
|
||||
SINK="$(pacmd stat | awk -F": " '/^Default sink name: /{print $2}')"
|
||||
|
||||
echo $(pacmd list-sinks | awk '/^\s+name: /{indefault = $2 == "<'$SINK'>"} /^\s+volume: / && indefault {print $5; exit}')
|
||||
]],
|
||||
function(stdout2)
|
||||
stdout2 = stdout2:sub(1, -3)
|
||||
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:set_value(tonumber(stdout2))
|
||||
update_osd()
|
||||
@@ -162,55 +164,55 @@ return function (s)
|
||||
-- Signals
|
||||
awesome.connect_signal(
|
||||
"module::slider:update",
|
||||
function ()
|
||||
function()
|
||||
update_slider()
|
||||
end
|
||||
)
|
||||
|
||||
awesome.connect_signal(
|
||||
"widget::volume:update",
|
||||
function (value)
|
||||
function(value)
|
||||
volume_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.volume_slider:set_value(tonumber(value))
|
||||
end
|
||||
)
|
||||
|
||||
update_slider()
|
||||
|
||||
local volume_container = awful.popup{
|
||||
local volume_container = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = color.color["Grey900"] .. "00",
|
||||
stretch = false,
|
||||
visible = false,
|
||||
placement = function (c) awful.placement.centered(c, {margins = {top = dpi(200)}}) end,
|
||||
shape = function (cr, width, height)
|
||||
placement = function(c) awful.placement.centered(c, { margins = { top = dpi(200) } }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 15)
|
||||
end
|
||||
}
|
||||
|
||||
local hide_volume_osd = gears.timer{
|
||||
local hide_volume_osd = gears.timer {
|
||||
timeout = 2,
|
||||
autostart = true,
|
||||
callback = function ()
|
||||
callback = function()
|
||||
volume_container.visible = false
|
||||
end
|
||||
}
|
||||
|
||||
volume_container:setup{
|
||||
volume_container:setup {
|
||||
volume_osd_widget,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
|
||||
awesome.connect_signal(
|
||||
"module::volume_osd:show",
|
||||
function ()
|
||||
function()
|
||||
volume_container.visible = true
|
||||
end
|
||||
)
|
||||
|
||||
volume_container:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
volume_container.visible = true
|
||||
hide_volume_osd:stop()
|
||||
end
|
||||
@@ -218,7 +220,7 @@ return function (s)
|
||||
|
||||
volume_container:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
volume_container.visible = true
|
||||
hide_volume_osd:again()
|
||||
end
|
||||
@@ -226,7 +228,7 @@ return function (s)
|
||||
|
||||
awesome.connect_signal(
|
||||
"widget::volume_osd:rerun",
|
||||
function ()
|
||||
function()
|
||||
if hide_volume_osd.started then
|
||||
hide_volume_osd:again()
|
||||
else
|
||||
@@ -234,4 +236,4 @@ return function (s)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,13 +9,12 @@
|
||||
local awful = require("awful")
|
||||
|
||||
Theme_path = awful.util.getdir("config") .. "/theme/crylia/"
|
||||
Theme = { }
|
||||
Theme = {}
|
||||
|
||||
dofile(Theme_path .. "theme_variables.lua")
|
||||
dofile(Theme_path .. "layouts.lua")
|
||||
|
||||
--Theme.wallpaper = Theme_path .. "assets/space.jpg"
|
||||
Theme.awesome_icon = Theme_path .. "assets/icons/icon.png"
|
||||
Theme.awesome_subicon = Theme_path .. "assets/icons/icon.png"
|
||||
Theme.awesome_icon = Theme_path .. "assets/icons/ArchLogo.png"
|
||||
Theme.awesome_subicon = Theme_path .. "assets/icons/ArchLogo.png"
|
||||
|
||||
return Theme
|
||||
|
||||
@@ -12,7 +12,7 @@ local awful = require("awful")
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/titlebar/"
|
||||
|
||||
Theme.font = "JetBrains Mono, Bold"
|
||||
Theme.font = user_vars.vars.font.bold
|
||||
|
||||
Theme.bg_normal = colors.color["Grey900"]
|
||||
Theme.bg_focus = colors.color["Grey900"]
|
||||
@@ -31,7 +31,7 @@ Theme.border_normal = colors.color["Grey800"]
|
||||
--Theme.border_focus = colors.color["Red"] -- Doesnt work, no idea why; workaround is in signals.lua
|
||||
Theme.border_marked = colors.color["Red400"]
|
||||
|
||||
Theme.menu_submenu_icon = Theme_path .. "assets.ArchLogo.png"
|
||||
--Theme.menu_submenu_icon = Theme_path .. "assets.ArchLogo.png"
|
||||
Theme.menu_height = dpi(30)
|
||||
Theme.menu_width = dpi(200)
|
||||
Theme.menu_bg_normal = colors.color["Grey900"]
|
||||
@@ -47,7 +47,7 @@ Theme.tooltip_border_color = colors.color["Grey700"]
|
||||
Theme.tooltip_bg = colors.color["Grey800"]
|
||||
Theme.tooltip_fg = colors.color["White"]
|
||||
Theme.tooltip_border_width = dpi(0)
|
||||
Theme.tooltip_shape = function (cr, width, heigth)
|
||||
Theme.tooltip_shape = function(cr, width, heigth)
|
||||
gears.shape.rounded_rect(cr, width, heigth, 10)
|
||||
end
|
||||
|
||||
@@ -55,7 +55,7 @@ Theme.notification_bg = colors.color["Grey900"]
|
||||
Theme.notification_fg = colors.color["White"]
|
||||
Theme.notification_border_width = dpi(0)
|
||||
Theme.notification_border_color = colors.color["Grey900"]
|
||||
Theme.notification_shape = function (cr, width, heigth)
|
||||
Theme.notification_shape = function(cr, width, heigth)
|
||||
gears.shape.rounded_rect(cr, width, heigth, 10)
|
||||
end
|
||||
Theme.notification_margin = dpi(10)
|
||||
@@ -75,8 +75,7 @@ Theme.systray_icon_spacing = dpi(10)
|
||||
Theme.hotkeys_bg = colors.color["Grey900"]
|
||||
Theme.hotkeys_fg = colors.color["White"]
|
||||
Theme.hotkeys_border_width = 0
|
||||
Theme.hotkeys_shape = function (cr, width, height)
|
||||
Theme.hotkeys_shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
end
|
||||
Theme.hotkeys_description_font = "JetBrains Mono, Bold 14"
|
||||
|
||||
Theme.hotkeys_description_font = user_vars.vars.font.bold
|
||||
|
||||
7
awesome/theme/crylia/tools/auto_starter.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
local awful = require("awful")
|
||||
|
||||
-- Autostart programs
|
||||
--awful.spawn.with_shell("~/.screenlayout/single_screen.sh")
|
||||
awful.spawn.with_shell("picom --experimental-backends")
|
||||
awful.spawn.with_shell("xfce4-power-manager")
|
||||
awful.spawn.with_shell("light-locker --lock-on-suspend --lock-on-lid &")
|
||||
@@ -2,6 +2,8 @@
|
||||
-- This is a button widget to add a new tag to the taglist --
|
||||
-------------------------------------------------------------
|
||||
|
||||
-- !!! THIS WIDGET IS OBSCOLETE !!!
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
@@ -15,10 +17,10 @@ local color = require("theme.crylia.colors")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/addtag/"
|
||||
|
||||
-- Returns the add tag button widget
|
||||
return function ()
|
||||
return function()
|
||||
|
||||
-- This is the widget that gets dispayed
|
||||
local add_tag_button = wibox.widget{
|
||||
local add_tag_button = wibox.widget {
|
||||
{
|
||||
{
|
||||
image = gears.color.recolor_image(icondir .. "plus.svg", color.color["White"]),
|
||||
@@ -29,7 +31,7 @@ return function ()
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
@@ -38,12 +40,12 @@ return function ()
|
||||
-- Keybindings and Mouse click bindings
|
||||
add_tag_button:buttons(
|
||||
gears.table.join(
|
||||
-- Add a new tag
|
||||
-- Add a new tag
|
||||
awful.button(
|
||||
{ },
|
||||
{},
|
||||
1,
|
||||
nil,
|
||||
function ()
|
||||
function()
|
||||
awful.tag.add()
|
||||
end
|
||||
)
|
||||
@@ -54,7 +56,7 @@ return function ()
|
||||
local old_wibox, old_cursor, old_bg
|
||||
add_tag_button:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
old_bg = add_tag_button.bg
|
||||
add_tag_button.bg = "#ffffff" .. "12"
|
||||
local w = mouse.current_wibox
|
||||
@@ -66,19 +68,19 @@ return function ()
|
||||
)
|
||||
add_tag_button:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
add_tag_button.bg = "#ffffff" .. "24"
|
||||
end
|
||||
)
|
||||
add_tag_button:connect_signal(
|
||||
"button::release",
|
||||
function ()
|
||||
function()
|
||||
add_tag_button.bg = "#ffffff" .. "12"
|
||||
end
|
||||
)
|
||||
add_tag_button:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
add_tag_button.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
@@ -88,4 +90,4 @@ return function ()
|
||||
)
|
||||
|
||||
return add_tag_button
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,9 +14,9 @@ require("main.signals")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
|
||||
|
||||
-- Returns the audio widget
|
||||
return function ()
|
||||
return function()
|
||||
|
||||
local audio_widget = wibox.widget{
|
||||
local audio_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -33,7 +33,7 @@ return function ()
|
||||
widget = wibox.container.margin,
|
||||
id = "icon_margin"
|
||||
},
|
||||
spacing = dpi(6),
|
||||
spacing = dpi(10),
|
||||
{
|
||||
id = "label",
|
||||
align = "center",
|
||||
@@ -44,22 +44,26 @@ return function ()
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(5),
|
||||
right = dpi(10),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Yellow200"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local get_volume = function ()
|
||||
local get_volume = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
|
||||
function (stdout)
|
||||
[[
|
||||
SINK="$(pacmd stat | awk -F": " '/^Default sink name: /{print $2}')"
|
||||
|
||||
echo $(pacmd list-sinks | awk '/^\s+name: /{indefault = $2 == "<'$SINK'>"} /^\s+volume: / && indefault {print $5; exit}')
|
||||
]],
|
||||
function(stdout)
|
||||
local icon = icondir .. "volume"
|
||||
stdout = stdout:gsub("%%", "")
|
||||
local volume = tonumber(stdout) or 0
|
||||
@@ -82,10 +86,10 @@ return function ()
|
||||
)
|
||||
end
|
||||
|
||||
local check_muted = function ()
|
||||
local check_muted = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ pacmd list-sinks | grep "muted" ]],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
if stdout:match("yes") then
|
||||
audio_widget.container.audio_layout.label.visible = false
|
||||
audio_widget.container:set_right(0)
|
||||
@@ -99,11 +103,11 @@ return function ()
|
||||
end
|
||||
|
||||
-- Signals
|
||||
hover_signal(audio_widget, color.color["Yellow200"])
|
||||
Hover_signal(audio_widget, color.color["Yellow200"])
|
||||
|
||||
audio_widget:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
awesome.emit_signal("widget::volume")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
awesome.emit_signal("module::slider:update")
|
||||
@@ -113,7 +117,7 @@ return function ()
|
||||
|
||||
awesome.connect_signal(
|
||||
"widget::volume",
|
||||
function (c)
|
||||
function(c)
|
||||
check_muted()
|
||||
end
|
||||
)
|
||||
|
||||
@@ -16,8 +16,8 @@ require("main.signals")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/battery/"
|
||||
|
||||
-- Returns the battery widget
|
||||
return function ()
|
||||
local battery_widget = wibox.widget{
|
||||
return function()
|
||||
local battery_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -35,7 +35,7 @@ return function ()
|
||||
top = dpi(2),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
spacing = dpi(8),
|
||||
spacing = dpi(10),
|
||||
{
|
||||
visible = false,
|
||||
align = 'center',
|
||||
@@ -47,30 +47,30 @@ return function ()
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(5),
|
||||
right = dpi(10),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Purple200"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local battery_tooltip = awful.tooltip{
|
||||
objects = {battery_widget},
|
||||
local battery_tooltip = awful.tooltip {
|
||||
objects = { battery_widget },
|
||||
text = "",
|
||||
mode = "outside",
|
||||
mode = "inside",
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
|
||||
local get_battery_info = function ()
|
||||
local get_battery_info = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ upower -i $(upower -e | grep BAT) | grep "time to " ]],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
if stdout == nil or stdout == '' then
|
||||
battery_tooltip:set_text('No Battery Found')
|
||||
return
|
||||
@@ -95,7 +95,7 @@ return function ()
|
||||
local last_battery_check = os.time()
|
||||
local notify_critical_battery = true
|
||||
|
||||
local battery_warning = function ()
|
||||
local battery_warning = function()
|
||||
naughty.notify({
|
||||
icon = gears.color.recolor_image(icondir .. "battery-alert.svg", color.color["White"]),
|
||||
app_name = "System notification",
|
||||
@@ -105,10 +105,10 @@ return function ()
|
||||
})
|
||||
end
|
||||
|
||||
local update_battery = function (status)
|
||||
local update_battery = function(status)
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[sh -c "upower -i $(upower -e | grep BAT) | grep percentage | awk '{print \$2}' |tr -d '\n%'"]],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
local battery_percentage = tonumber(stdout)
|
||||
|
||||
if not battery_percentage then
|
||||
@@ -129,7 +129,7 @@ return function ()
|
||||
|
||||
if battery_percentage > 0 and battery_percentage < 10 and status == 'discharging' then
|
||||
icon = icon .. '-' .. 'alert'
|
||||
if(os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
|
||||
if (os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
|
||||
last_battery_check = os.time()
|
||||
notify_critical_battery = false
|
||||
battery_warning()
|
||||
@@ -156,7 +156,7 @@ return function ()
|
||||
icon = icon .. '-' .. status .. '-' .. '70'
|
||||
elseif battery_percentage >= 80 and battery_percentage < 90 then
|
||||
icon = icon .. '-' .. status .. '-' .. '80'
|
||||
elseif battery_percentage >=90 and battery_percentage < 100 then
|
||||
elseif battery_percentage >= 90 and battery_percentage < 100 then
|
||||
icon = icon .. '-' .. status .. '-' .. '90'
|
||||
end
|
||||
|
||||
@@ -166,18 +166,18 @@ return function ()
|
||||
)
|
||||
end
|
||||
|
||||
hover_signal(battery_widget, color.color["Purple200"])
|
||||
Hover_signal(battery_widget, color.color["Purple200"])
|
||||
|
||||
battery_widget:connect_signal(
|
||||
'button::press',
|
||||
function ()
|
||||
function()
|
||||
awful.spawn("xfce4-power-manager-settings")
|
||||
end
|
||||
)
|
||||
|
||||
battery_widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
get_battery_info()
|
||||
end
|
||||
)
|
||||
@@ -185,7 +185,7 @@ return function ()
|
||||
watch(
|
||||
[[sh -c "upower -i $(upower -e | grep BAT) | grep state | awk '{print \$2}' | tr -d '\n'"]],
|
||||
5,
|
||||
function (widget, stdout)
|
||||
function(widget, stdout)
|
||||
local status = stdout:gsub('%\n', '')
|
||||
if status == nil or status == '' then
|
||||
battery_widget.container.battery_layout.spacing = dpi(0)
|
||||
|
||||
@@ -14,8 +14,8 @@ require("main.signals")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/bluetooth/"
|
||||
|
||||
-- Returns the bluetooth widget
|
||||
return function ()
|
||||
local bluetooth_widget = wibox.widget{
|
||||
return function()
|
||||
local bluetooth_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -28,22 +28,22 @@ return function ()
|
||||
widget = wibox.container.place
|
||||
},
|
||||
id = "icon_margin",
|
||||
left = dpi(5),
|
||||
right = dpi(5),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Blue200"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local bluetooth_tooltip = awful.tooltip{
|
||||
objects = {bluetooth_widget},
|
||||
local bluetooth_tooltip = awful.tooltip {
|
||||
objects = { bluetooth_widget },
|
||||
text = "",
|
||||
mode = "outside",
|
||||
mode = "inside",
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
@@ -51,69 +51,72 @@ return function ()
|
||||
local bluetooth_state = "off"
|
||||
local connected_device = "nothing"
|
||||
|
||||
local get_bluetooth_information = function ()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ bluetoothctl show | grep Powered | awk '{print $2}' ]],
|
||||
function (stdout)
|
||||
local icon = icondir .. "bluetooth"
|
||||
stdout = stdout:gsub("\n", "")
|
||||
if stdout == "yes" then
|
||||
icon = icon .. "-on"
|
||||
bluetooth_state = "on"
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
|
||||
function (stdout2)
|
||||
if stdout2 == nil or stdout2:gsub("\n", "") == "" then
|
||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
|
||||
else
|
||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
|
||||
connected_device = stdout2
|
||||
end
|
||||
end
|
||||
)
|
||||
else
|
||||
icon = icon .. "-off"
|
||||
bluetooth_state = "off"
|
||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
|
||||
end
|
||||
bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
|
||||
end
|
||||
)
|
||||
-- ! if you don't have a bluetooth device then this function will
|
||||
-- ! spawn hundereds of processes of bluetoothctl, this will be bad
|
||||
-- TODO: Check for a bluetooth controller first, maybe use a different program
|
||||
local get_bluetooth_information = function()
|
||||
-- awful.spawn.easy_async_with_shell(
|
||||
-- [[ bluetoothctl show | grep Powered | awk '{print $2}' ]],
|
||||
-- function(stdout)
|
||||
-- local icon = icondir .. "bluetooth"
|
||||
-- stdout = stdout:gsub("\n", "")
|
||||
-- if stdout == "yes" then
|
||||
-- icon = icon .. "-on"
|
||||
-- bluetooth_state = "on"
|
||||
-- awful.spawn.easy_async_with_shell(
|
||||
-- [[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
|
||||
-- function(stdout2)
|
||||
-- if stdout2 == nil or stdout2:gsub("\n", "") == "" then
|
||||
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
|
||||
-- else
|
||||
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
|
||||
-- connected_device = stdout2
|
||||
-- end
|
||||
-- end
|
||||
-- )
|
||||
-- else
|
||||
-- icon = icon .. "-off"
|
||||
-- bluetooth_state = "off"
|
||||
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
|
||||
-- end
|
||||
-- bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
|
||||
-- end
|
||||
-- )
|
||||
end
|
||||
|
||||
local bluetooth_update = gears.timer{
|
||||
local bluetooth_update = gears.timer {
|
||||
timeout = 5,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function ()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
callback = function()
|
||||
--[[ awful.spawn.easy_async_with_shell(
|
||||
"bluetoothctl list",
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
if stdout ~= nil or stdout:gsub("\n", ""):match("") then
|
||||
get_bluetooth_information()
|
||||
end
|
||||
end
|
||||
)
|
||||
) ]]
|
||||
end
|
||||
}
|
||||
|
||||
-- Signals
|
||||
hover_signal(bluetooth_widget, color.color["Blue200"])
|
||||
Hover_signal(bluetooth_widget, color.color["Blue200"])
|
||||
|
||||
bluetooth_widget:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
if bluetooth_state == "on" then
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"bluetoothctl power off",
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
get_bluetooth_information()
|
||||
end
|
||||
)
|
||||
else
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"bluetoothctl power on",
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
get_bluetooth_information()
|
||||
end
|
||||
)
|
||||
|
||||
@@ -14,9 +14,9 @@ require("main.signals")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/clock/"
|
||||
|
||||
-- Returns the clock widget
|
||||
return function ()
|
||||
return function()
|
||||
|
||||
local clock_widget = wibox.widget{
|
||||
local clock_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -45,19 +45,19 @@ return function ()
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(10),
|
||||
right = dpi(10),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Orange200"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local set_clock = function ()
|
||||
local set_clock = function()
|
||||
clock_widget.container.clock_layout.label:set_text(os.date("%H:%M"))
|
||||
end
|
||||
|
||||
@@ -67,12 +67,12 @@ return function ()
|
||||
timeout = 5,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function ()
|
||||
callback = function()
|
||||
set_clock()
|
||||
end
|
||||
}
|
||||
|
||||
hover_signal(clock_widget, color.color["Orange200"])
|
||||
Hover_signal(clock_widget, color.color["Orange200"])
|
||||
|
||||
return clock_widget
|
||||
end
|
||||
|
||||
@@ -14,9 +14,9 @@ require("main.signals")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/date/"
|
||||
|
||||
-- Returns the date widget
|
||||
return function ()
|
||||
return function()
|
||||
|
||||
local date_widget = wibox.widget{
|
||||
local date_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -45,19 +45,19 @@ return function ()
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(10),
|
||||
right = dpi(10),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Teal200"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local set_date = function ()
|
||||
local set_date = function()
|
||||
date_widget.container.date_layout.label:set_text(os.date("%a, %b %d"))
|
||||
end
|
||||
|
||||
@@ -66,24 +66,24 @@ return function ()
|
||||
timeout = 60,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function ()
|
||||
callback = function()
|
||||
set_date()
|
||||
end
|
||||
}
|
||||
|
||||
-- Signals
|
||||
hover_signal(date_widget, color.color["Teal200"])
|
||||
Hover_signal(date_widget, color.color["Teal200"])
|
||||
|
||||
date_widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
awesome.emit_signal("widget::calendar_osd:stop", true)
|
||||
end
|
||||
)
|
||||
|
||||
date_widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
awesome.emit_signal("widget::calendar_osd:rerun", true)
|
||||
end
|
||||
)
|
||||
|
||||
@@ -13,8 +13,8 @@ require("main.signals")
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/kblayout/"
|
||||
|
||||
return function (s)
|
||||
local kblayout_widget = wibox.widget{
|
||||
return function(s)
|
||||
local kblayout_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -32,7 +32,7 @@ return function (s)
|
||||
widget = wibox.container.margin,
|
||||
id = "icon_margin"
|
||||
},
|
||||
spacing = dpi(6),
|
||||
spacing = dpi(10),
|
||||
{
|
||||
id = "label",
|
||||
align = "center",
|
||||
@@ -43,129 +43,129 @@ return function (s)
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(5),
|
||||
right = dpi(10),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Green200"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local layout = "";
|
||||
local get_kblayout = function ()
|
||||
local get_kblayout = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ setxkbmap -query | grep layout | awk '{print $2}' ]],
|
||||
function (stdout)
|
||||
layout = stdout
|
||||
kblayout_widget.container.kblayout_layout.label.text = stdout
|
||||
return stdout
|
||||
function(stdout)
|
||||
layout = stdout:gsub("\n", "")
|
||||
kblayout_widget.container.kblayout_layout.label.text = layout
|
||||
return layout
|
||||
end
|
||||
)
|
||||
return layout
|
||||
end
|
||||
|
||||
|
||||
local function create_kb_layout_item (keymap)
|
||||
local function create_kb_layout_item(keymap)
|
||||
-- TODO: Add more, too lazy rn
|
||||
local longname, shortname
|
||||
|
||||
local xkeyboard_country_code = {
|
||||
{"ad", "", "AND"}, -- Andorra
|
||||
{"af", "", "AFG"}, -- Afghanistan
|
||||
{"al", "", "ALB"}, -- Albania
|
||||
{"am", "", "ARM"}, -- Armenia
|
||||
{"ara", "", "ARB"}, -- Arabic
|
||||
{"at", "", "AUT"}, -- Austria
|
||||
{"az", "", "AZE"}, -- Azerbaijan
|
||||
{"ba", "", "BIH"}, -- Bosnia and Herzegovina
|
||||
{"bd", "", "BGD"}, -- Bangladesh
|
||||
{"be", "", "BEL"}, -- Belgium
|
||||
{"bg", "", "BGR"}, -- Bulgaria
|
||||
{"br", "", "BRA"}, -- Brazil
|
||||
{"bt", "", "BTN"}, -- Bhutan
|
||||
{"bw", "", "BWA"}, -- Botswana
|
||||
{"by", "", "BLR"}, -- Belarus
|
||||
{"ca", "", "CAN"}, -- Canada
|
||||
{"cd", "", "COD"}, -- Congo
|
||||
{"ch", "", "CHE"}, -- Switzerland
|
||||
{"cm", "", "CMR"}, -- Cameroon
|
||||
{"cn", "", "CHN"}, -- China
|
||||
{"cz", "", "CZE"}, -- Czechia
|
||||
{"de", "Deutsch (Germany)", "GER"}, -- Germany
|
||||
{"dk", "", "DNK"}, -- Denmark
|
||||
{"ee", "", "EST"}, -- Estonia
|
||||
{"es", "", "ESP"}, -- Spain
|
||||
{"et", "", "ETH"}, -- Ethiopia
|
||||
{"eu", "?", "?"}, -- EurKey
|
||||
{"fi", "", "FIN"}, -- Finland
|
||||
{"fo", "", "FRO"}, -- Faroe Islands
|
||||
{"fr", "", "FRA"}, -- France
|
||||
{"gb", "English (Bri'ish)", "ENG"}, -- United Kingdom
|
||||
{"ge", "", "GEO"}, -- Georgia
|
||||
{"gh", "", "GHA"}, -- Ghana
|
||||
{"gn", "", "GIN"}, -- Guinea
|
||||
{"gr", "", "GRC"}, -- Greece
|
||||
{"hr", "", "HRV"}, -- Croatia
|
||||
{"hu", "", "HUN"}, -- Hungary
|
||||
{"ie", "", "IRL"}, -- Ireland
|
||||
{"il", "", "ISR"}, -- Israel
|
||||
{"in", "", "IND"}, -- India
|
||||
{"iq", "", "IRQ"}, -- Iraq
|
||||
{"ir", "", "IRN"}, -- Iran
|
||||
{"is", "", "ISL"}, -- Iceland
|
||||
{"it", "", "ITA"}, -- Italy
|
||||
{"jp", "", "JPN"}, -- Japan
|
||||
{"ke", "", "KEN"}, -- Kenya
|
||||
{"kg", "", "KGZ"}, -- Kyrgyzstan
|
||||
{"kh", "", "KHM"}, -- Cambodia
|
||||
{"kr", "", "KOR"}, -- Korea
|
||||
{"kz", "", "KAZ"}, -- Kazakhstan
|
||||
{"la", "", "LAO"}, -- Laos
|
||||
{"latam", "?", "?"}, -- Latin America
|
||||
{"latin", "?", "?"}, -- Latin
|
||||
{"lk", "", "LKA"}, -- Sri Lanka
|
||||
{"lt", "", "LTU"}, -- Lithuania
|
||||
{"lv", "", "LVA"}, -- Latvia
|
||||
{"ma", "", "MAR"}, -- Morocco
|
||||
{"mao", "?", "?"}, -- Maori
|
||||
{"me", "", "MNE"}, -- Montenegro
|
||||
{"mk", "", "MKD"}, -- Macedonia
|
||||
{"ml", "", "MLI"}, -- Mali
|
||||
{"mm", "", "MMR"}, -- Myanmar
|
||||
{"mn", "", "MNG"}, -- Mongolia
|
||||
{"mt", "", "MLT"}, -- Malta
|
||||
{"mv", "", "MDV"}, -- Maldives
|
||||
{"ng", "", "NGA"}, -- Nigeria
|
||||
{"nl", "", "NLD"}, -- Netherlands
|
||||
{"no", "", "NOR"}, -- Norway
|
||||
{"np", "", "NRL"}, -- Nepal
|
||||
{"ph", "", "PHL"}, -- Philippines
|
||||
{"pk", "", "PAK"}, -- Pakistan
|
||||
{"pl", "", "POL"}, -- Poland
|
||||
{"pt", "", "PRT"}, -- Portugal
|
||||
{"ro", "", "ROU"}, -- Romania
|
||||
{"rs", "", "SRB"}, -- Serbia
|
||||
{"ru", "Русски (Russia)", "RUS"}, -- Russia
|
||||
{"se", "", "SWE"}, -- Sweden
|
||||
{"si", "", "SVN"}, -- Slovenia
|
||||
{"sk", "", "SVK"}, -- Slovakia
|
||||
{"sn", "", "SEN"}, -- Senegal
|
||||
{"sy", "", "SYR"}, -- Syria
|
||||
{"th", "", "THA"}, -- Thailand
|
||||
{"tj", "", "TJK"}, -- Tajikistan
|
||||
{"tm", "", "TKM"}, -- Turkmenistan
|
||||
{"tr", "", "TUR"}, -- Turkey
|
||||
{"tw", "", "TWN"}, -- Taiwan
|
||||
{"tz", "", "TZA"}, -- Tanzania
|
||||
{"ua", "", "UKR"}, -- Ukraine
|
||||
{"us", "English (United States)", "USA"}, -- USA
|
||||
{"uz", "", "UZB"}, -- Uzbekistan
|
||||
{"vn", "", "VNM"}, -- Vietnam
|
||||
{"za", "", "ZAF"} -- South Africa
|
||||
{ "ad", "", "AND" }, -- Andorra
|
||||
{ "af", "", "AFG" }, -- Afghanistan
|
||||
{ "al", "", "ALB" }, -- Albania
|
||||
{ "am", "", "ARM" }, -- Armenia
|
||||
{ "ara", "", "ARB" }, -- Arabic
|
||||
{ "at", "", "AUT" }, -- Austria
|
||||
{ "az", "", "AZE" }, -- Azerbaijan
|
||||
{ "ba", "", "BIH" }, -- Bosnia and Herzegovina
|
||||
{ "bd", "", "BGD" }, -- Bangladesh
|
||||
{ "be", "", "BEL" }, -- Belgium
|
||||
{ "bg", "", "BGR" }, -- Bulgaria
|
||||
{ "br", "", "BRA" }, -- Brazil
|
||||
{ "bt", "", "BTN" }, -- Bhutan
|
||||
{ "bw", "", "BWA" }, -- Botswana
|
||||
{ "by", "", "BLR" }, -- Belarus
|
||||
{ "ca", "", "CAN" }, -- Canada
|
||||
{ "cd", "", "COD" }, -- Congo
|
||||
{ "ch", "", "CHE" }, -- Switzerland
|
||||
{ "cm", "", "CMR" }, -- Cameroon
|
||||
{ "cn", "", "CHN" }, -- China
|
||||
{ "cz", "", "CZE" }, -- Czechia
|
||||
{ "de", "Deutsch (Germany)", "GER" }, -- Germany
|
||||
{ "dk", "", "DNK" }, -- Denmark
|
||||
{ "ee", "", "EST" }, -- Estonia
|
||||
{ "es", "", "ESP" }, -- Spain
|
||||
{ "et", "", "ETH" }, -- Ethiopia
|
||||
{ "eu", "?", "?" }, -- EurKey
|
||||
{ "fi", "", "FIN" }, -- Finland
|
||||
{ "fo", "", "FRO" }, -- Faroe Islands
|
||||
{ "fr", "", "FRA" }, -- France
|
||||
{ "gb", "English (Bri'ish)", "ENG" }, -- United Kingdom
|
||||
{ "ge", "", "GEO" }, -- Georgia
|
||||
{ "gh", "", "GHA" }, -- Ghana
|
||||
{ "gn", "", "GIN" }, -- Guinea
|
||||
{ "gr", "", "GRC" }, -- Greece
|
||||
{ "hr", "", "HRV" }, -- Croatia
|
||||
{ "hu", "", "HUN" }, -- Hungary
|
||||
{ "ie", "", "IRL" }, -- Ireland
|
||||
{ "il", "", "ISR" }, -- Israel
|
||||
{ "in", "", "IND" }, -- India
|
||||
{ "iq", "", "IRQ" }, -- Iraq
|
||||
{ "ir", "", "IRN" }, -- Iran
|
||||
{ "is", "", "ISL" }, -- Iceland
|
||||
{ "it", "", "ITA" }, -- Italy
|
||||
{ "jp", "", "JPN" }, -- Japan
|
||||
{ "ke", "", "KEN" }, -- Kenya
|
||||
{ "kg", "", "KGZ" }, -- Kyrgyzstan
|
||||
{ "kh", "", "KHM" }, -- Cambodia
|
||||
{ "kr", "", "KOR" }, -- Korea
|
||||
{ "kz", "", "KAZ" }, -- Kazakhstan
|
||||
{ "la", "", "LAO" }, -- Laos
|
||||
{ "latam", "?", "?" }, -- Latin America
|
||||
{ "latin", "?", "?" }, -- Latin
|
||||
{ "lk", "", "LKA" }, -- Sri Lanka
|
||||
{ "lt", "", "LTU" }, -- Lithuania
|
||||
{ "lv", "", "LVA" }, -- Latvia
|
||||
{ "ma", "", "MAR" }, -- Morocco
|
||||
{ "mao", "?", "?" }, -- Maori
|
||||
{ "me", "", "MNE" }, -- Montenegro
|
||||
{ "mk", "", "MKD" }, -- Macedonia
|
||||
{ "ml", "", "MLI" }, -- Mali
|
||||
{ "mm", "", "MMR" }, -- Myanmar
|
||||
{ "mn", "", "MNG" }, -- Mongolia
|
||||
{ "mt", "", "MLT" }, -- Malta
|
||||
{ "mv", "", "MDV" }, -- Maldives
|
||||
{ "ng", "", "NGA" }, -- Nigeria
|
||||
{ "nl", "", "NLD" }, -- Netherlands
|
||||
{ "no", "", "NOR" }, -- Norway
|
||||
{ "np", "", "NRL" }, -- Nepal
|
||||
{ "ph", "", "PHL" }, -- Philippines
|
||||
{ "pk", "", "PAK" }, -- Pakistan
|
||||
{ "pl", "", "POL" }, -- Poland
|
||||
{ "pt", "", "PRT" }, -- Portugal
|
||||
{ "ro", "", "ROU" }, -- Romania
|
||||
{ "rs", "", "SRB" }, -- Serbia
|
||||
{ "ru", "Русски (Russia)", "RUS" }, -- Russia
|
||||
{ "se", "", "SWE" }, -- Sweden
|
||||
{ "si", "", "SVN" }, -- Slovenia
|
||||
{ "sk", "", "SVK" }, -- Slovakia
|
||||
{ "sn", "", "SEN" }, -- Senegal
|
||||
{ "sy", "", "SYR" }, -- Syria
|
||||
{ "th", "", "THA" }, -- Thailand
|
||||
{ "tj", "", "TJK" }, -- Tajikistan
|
||||
{ "tm", "", "TKM" }, -- Turkmenistan
|
||||
{ "tr", "", "TUR" }, -- Turkey
|
||||
{ "tw", "", "TWN" }, -- Taiwan
|
||||
{ "tz", "", "TZA" }, -- Tanzania
|
||||
{ "ua", "", "UKR" }, -- Ukraine
|
||||
{ "us", "English (United States)", "USA" }, -- USA
|
||||
{ "uz", "", "UZB" }, -- Uzbekistan
|
||||
{ "vn", "", "VNM" }, -- Vietnam
|
||||
{ "za", "", "ZAF" } -- South Africa
|
||||
}
|
||||
|
||||
for i, c in ipairs(xkeyboard_country_code) do
|
||||
@@ -175,7 +175,7 @@ return function (s)
|
||||
end
|
||||
end
|
||||
|
||||
local kb_layout_item = wibox.widget{
|
||||
local kb_layout_item = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -184,7 +184,7 @@ return function (s)
|
||||
{
|
||||
text = shortname,
|
||||
widget = wibox.widget.textbox,
|
||||
font = "JetBrains Mono ExtraBold, 12",
|
||||
font = user_vars.vars.font.extrabold,
|
||||
id = "kbmapname"
|
||||
},
|
||||
widget = wibox.container.margin,
|
||||
@@ -195,7 +195,7 @@ return function (s)
|
||||
{
|
||||
text = longname,
|
||||
widget = wibox.widget.textbox,
|
||||
font = "JetBrains Mono Bold, 12",
|
||||
font = user_vars.vars.font.bold,
|
||||
|
||||
},
|
||||
widget = wibox.container.margin
|
||||
@@ -208,7 +208,7 @@ return function (s)
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
end,
|
||||
bg = color.color["Grey800"],
|
||||
@@ -219,13 +219,13 @@ return function (s)
|
||||
margins = dpi(5),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
hover_signal(kb_layout_item.background, color.color["White"], color.color["Grey900"])
|
||||
Hover_signal(kb_layout_item.background, color.color["White"], color.color["Grey900"])
|
||||
kb_layout_item:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"setxkbmap " .. keymap,
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
awesome.emit_signal("kblayout::hide:kbmenu")
|
||||
get_kblayout()
|
||||
end
|
||||
@@ -245,9 +245,9 @@ return function (s)
|
||||
return kb_layout_items
|
||||
end
|
||||
|
||||
local kb_menu_widget = awful.popup{
|
||||
local kb_menu_widget = awful.popup {
|
||||
screen = s,
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background,
|
||||
@@ -257,7 +257,7 @@ return function (s)
|
||||
max_height = dpi(600),
|
||||
visible = false,
|
||||
ontop = true,
|
||||
placement = function (c) awful.placement.align(c, {position = "top_right", margins = {right = dpi(255), top = dpi(60)}}) end
|
||||
placement = function(c) awful.placement.align(c, { position = "top_right", margins = { right = dpi(255), top = dpi(60) } }) end
|
||||
}
|
||||
|
||||
kb_menu_widget:setup(
|
||||
@@ -267,20 +267,20 @@ return function (s)
|
||||
local function toggle_kb_layout()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"setxkbmap -query | grep layout: | awk '{print $2}'",
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
for j, n in ipairs(user_vars.vars.kblayout) do
|
||||
if stdout:match(n) then
|
||||
if j == #user_vars.vars.kblayout then
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"setxkbmap " .. user_vars.vars.kblayout[1],
|
||||
function ()
|
||||
function()
|
||||
get_kblayout()
|
||||
end
|
||||
)
|
||||
else
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"setxkbmap " .. user_vars.vars.kblayout[j + 1],
|
||||
function ()
|
||||
function()
|
||||
get_kblayout()
|
||||
end
|
||||
)
|
||||
@@ -293,19 +293,19 @@ return function (s)
|
||||
|
||||
awesome.connect_signal(
|
||||
"kblayout::toggle",
|
||||
function ()
|
||||
function()
|
||||
toggle_kb_layout()
|
||||
end
|
||||
)
|
||||
|
||||
--kb_menu_widget:move_next_to(mouse.current_widget_geometry)
|
||||
-- Signals
|
||||
hover_signal(kblayout_widget, color.color["Green200"])
|
||||
Hover_signal(kblayout_widget, color.color["Green200"])
|
||||
|
||||
local kblayout_keygrabber = awful.keygrabber{
|
||||
local kblayout_keygrabber = awful.keygrabber {
|
||||
autostart = false,
|
||||
stop_event = 'release',
|
||||
keypressed_callback = function (self, mod, key, command)
|
||||
keypressed_callback = function(self, mod, key, command)
|
||||
if key == 'Escape' then
|
||||
awesome.emit_signal("kblayout::hide:kbmenu")
|
||||
end
|
||||
@@ -314,7 +314,7 @@ return function (s)
|
||||
|
||||
kblayout_widget:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
if kb_menu_widget.visible then
|
||||
kb_menu_widget.visible = false
|
||||
kblayout_keygrabber:stop()
|
||||
@@ -327,7 +327,7 @@ return function (s)
|
||||
|
||||
awesome.connect_signal(
|
||||
"kblayout::hide:kbmenu",
|
||||
function ()
|
||||
function()
|
||||
kb_menu_widget.visible = false
|
||||
kblayout_keygrabber:stop()
|
||||
end
|
||||
|
||||
@@ -11,30 +11,36 @@ local wibox = require("wibox")
|
||||
require("main.signals")
|
||||
|
||||
-- Returns the layoutbox widget
|
||||
return function ()
|
||||
local layout = wibox.widget{
|
||||
return function()
|
||||
local layout = wibox.widget {
|
||||
{
|
||||
awful.widget.layoutbox(),
|
||||
margins = dpi(3),
|
||||
forced_width = dpi(33),
|
||||
{
|
||||
awful.widget.layoutbox(),
|
||||
id = "icon_layout",
|
||||
widget = wibox.container.place
|
||||
},
|
||||
id = "icon_margin",
|
||||
left = dpi(5),
|
||||
right = dpi(5),
|
||||
forced_width = dpi(40),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["LightBlue200"],
|
||||
shape = function (cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
-- Signals
|
||||
hover_signal(layout, color.color["LightBlue200"])
|
||||
Hover_signal(layout, color.color["LightBlue200"])
|
||||
|
||||
layout:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end
|
||||
)
|
||||
|
||||
return layout
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,18 +16,18 @@ local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/networ
|
||||
|
||||
-- Insert your interfaces here, get the from ip a
|
||||
local interfaces = {
|
||||
wlan_interface = "wlo1",
|
||||
lan_interface = "enx00e04c89ce6f"
|
||||
wlan_interface = user_vars.vars.network.wlan,
|
||||
lan_interface = user_vars.vars.network.ethernet
|
||||
}
|
||||
|
||||
local network_mode = nil
|
||||
|
||||
-- Returns the network widget
|
||||
return function ()
|
||||
return function()
|
||||
local startup = true
|
||||
local reconnect_startup = true
|
||||
|
||||
local network_widget = wibox.widget{
|
||||
local wifi_strength
|
||||
local network_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -45,7 +45,7 @@ return function ()
|
||||
top = dpi(2),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
spacing = dpi(8),
|
||||
spacing = dpi(10),
|
||||
{
|
||||
id = "label",
|
||||
visible = false,
|
||||
@@ -57,22 +57,22 @@ return function ()
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(10),
|
||||
right = dpi(10),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Red200"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local network_tooltip = awful.tooltip{
|
||||
local network_tooltip = awful.tooltip {
|
||||
text = "Loading",
|
||||
objects = {network_widget},
|
||||
mode = "outside",
|
||||
objects = { network_widget },
|
||||
mode = "inside",
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
@@ -92,21 +92,21 @@ return function ()
|
||||
fi
|
||||
]=]
|
||||
|
||||
local update_startup = function ()
|
||||
local update_startup = function()
|
||||
if startup then
|
||||
startup = false
|
||||
end
|
||||
end
|
||||
|
||||
local update_reconnect_startup = function (status)
|
||||
local update_reconnect_startup = function(status)
|
||||
reconnect_startup = status
|
||||
end
|
||||
|
||||
local update_tooltip = function (message)
|
||||
local update_tooltip = function(message)
|
||||
network_tooltip:set_markup(message)
|
||||
end
|
||||
|
||||
local network_notify = function (message, title, app_name, icon)
|
||||
local network_notify = function(message, title, app_name, icon)
|
||||
naughty.notify({
|
||||
text = message,
|
||||
title = title,
|
||||
@@ -116,21 +116,21 @@ return function ()
|
||||
})
|
||||
end
|
||||
|
||||
local update_wireless = function ()
|
||||
local update_wireless = function()
|
||||
network_mode = "wireless"
|
||||
|
||||
local notify_connected = function (essid)
|
||||
local message = "You are now connected to ".. essid
|
||||
local notify_connected = function(essid)
|
||||
local message = "You are now connected to " .. essid
|
||||
local title = "Connection successfull"
|
||||
local app_name = "System Notification"
|
||||
local icon = icondir .. "wifi-strength-4.svg"
|
||||
network_notify(message, title, app_name, icon)
|
||||
end
|
||||
|
||||
local update_wireless_data = function (healthy)
|
||||
local update_wireless_data = function(healthy)
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ iw dev ]] .. interfaces.wlan_interface .. [[ link ]],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
local essid = stdout:match("SSID: (.-)\n") or "N/A"
|
||||
local bitrate = stdout:match("tx bitrate: (.+/s)") or "N/A"
|
||||
local message = "Connected to <b>" .. essid .. "</b>\nSignal strength <b>" .. tostring(wifi_strength) .. "%</b>\n" .. "Bit rate <b>" .. tostring(bitrate) .. "</b>"
|
||||
@@ -149,10 +149,10 @@ return function ()
|
||||
)
|
||||
end
|
||||
|
||||
local update_wireless_icon = function (strength)
|
||||
local update_wireless_icon = function(strength)
|
||||
awful.spawn.easy_async_with_shell(
|
||||
check_for_internet,
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
local icon = "wifi-strength"
|
||||
if not stdout:match("Connected but no internet") then
|
||||
if startup or reconnect_startup then
|
||||
@@ -170,10 +170,10 @@ return function ()
|
||||
)
|
||||
end
|
||||
|
||||
local update_wireless_strength = function ()
|
||||
local update_wireless_strength = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ awk 'NR==3 {printf "%3.0f", ($3/70)*100}' /proc/net/wireless ]],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
if not tonumber(stdout) then
|
||||
return
|
||||
end
|
||||
@@ -191,11 +191,11 @@ return function ()
|
||||
update_startup()
|
||||
end
|
||||
|
||||
local update_wired = function ()
|
||||
local update_wired = function()
|
||||
network_mode = "wired"
|
||||
|
||||
local notify_connected = function ()
|
||||
local message = "You are now connected to ".. interfaces.lan_interface
|
||||
local notify_connected = function()
|
||||
local message = "You are now connected to " .. interfaces.lan_interface
|
||||
local title = "Connection successfull"
|
||||
local app_name = "System Notification"
|
||||
local icon = icondir .. "ethernet.svg"
|
||||
@@ -204,7 +204,7 @@ return function ()
|
||||
|
||||
awful.spawn.easy_async_with_shell(
|
||||
check_for_internet,
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
local icon = "ethernet"
|
||||
|
||||
if stdout:match("Connected but no internet") then
|
||||
@@ -229,15 +229,15 @@ return function ()
|
||||
|
||||
end
|
||||
|
||||
local update_disconnected = function ()
|
||||
local notify_wireless_disconnected = function (essid)
|
||||
local update_disconnected = function()
|
||||
local notify_wireless_disconnected = function(essid)
|
||||
local message = "WiFi has been disconnected"
|
||||
local title = "Connection lost"
|
||||
local app_name = "System Notification"
|
||||
local icon = icondir .. "wifi-strength-off-outline.svg"
|
||||
network_notify(message, title, app_name, icon)
|
||||
end
|
||||
local notify_wired_disconnected = function (essid)
|
||||
local notify_wired_disconnected = function(essid)
|
||||
local message = "Ethernet has been unplugged"
|
||||
local title = "Connection lost"
|
||||
local app_name = "System Notification"
|
||||
@@ -264,7 +264,7 @@ return function ()
|
||||
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color.color["Grey900"]))
|
||||
end
|
||||
|
||||
local check_network_mode = function ()
|
||||
local check_network_mode = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[=[
|
||||
wireless="]=] .. tostring(interfaces.wlan_interface) .. [=["
|
||||
@@ -301,7 +301,7 @@ return function ()
|
||||
}
|
||||
print_network_mode
|
||||
]=],
|
||||
function (stdout)
|
||||
function(stdout)
|
||||
local mode = stdout:gsub("%\n", "")
|
||||
if stdout:match("No internet connected") then
|
||||
update_disconnected()
|
||||
@@ -314,21 +314,21 @@ return function ()
|
||||
)
|
||||
end
|
||||
|
||||
local network_updater = gears.timer{
|
||||
local network_updater = gears.timer {
|
||||
timeout = 5,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function ()
|
||||
callback = function()
|
||||
check_network_mode()
|
||||
end
|
||||
}
|
||||
|
||||
-- Signals
|
||||
hover_signal(network_widget, color.color["Red200"])
|
||||
Hover_signal(network_widget, color.color["Red200"])
|
||||
|
||||
network_widget:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
awful.spawn("gnome-control-center wlan")
|
||||
end
|
||||
)
|
||||
|
||||
@@ -14,9 +14,9 @@ require("main.signals")
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/power/"
|
||||
|
||||
return function ()
|
||||
return function()
|
||||
|
||||
local power_widget = wibox.widget{
|
||||
local power_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -38,24 +38,24 @@ return function ()
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(5),
|
||||
right = dpi(5),
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Red200"],
|
||||
fg = color.color["Grey800"],
|
||||
shape = function (cr, width, height)
|
||||
gears.shape.rounded_rect(cr, height, width, 5)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
-- Signals
|
||||
hover_signal(power_widget, color.color["Red200"])
|
||||
Hover_signal(power_widget, color.color["Red200"])
|
||||
|
||||
power_widget:connect_signal(
|
||||
"button::release",
|
||||
function ()
|
||||
function()
|
||||
awesome.emit_signal("module::powermenu:show")
|
||||
end
|
||||
)
|
||||
|
||||
@@ -11,16 +11,13 @@ local wibox = require("wibox")
|
||||
require("main.signals")
|
||||
|
||||
|
||||
return function (s)
|
||||
return function(s)
|
||||
|
||||
local systray = wibox.widget{
|
||||
local systray = wibox.widget {
|
||||
{
|
||||
{
|
||||
wibox.widget.systray(),
|
||||
top = dpi(6),
|
||||
bottom = dpi(6),
|
||||
left = dpi(6),
|
||||
right = dpi(6),
|
||||
margins = dpi(6),
|
||||
widget = wibox.container.margin,
|
||||
id = 'st'
|
||||
},
|
||||
@@ -29,13 +26,15 @@ return function (s)
|
||||
id = "container"
|
||||
},
|
||||
widget = wibox.container.background,
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
bg = color.color["BlueGrey800"]
|
||||
}
|
||||
-- Signals
|
||||
hover_signal(systray.container, color.color["Red200"])
|
||||
Hover_signal(systray.container, color.color["Red200"])
|
||||
|
||||
systray.container.st.widget:set_base_size(dpi(20))
|
||||
|
||||
return systray
|
||||
end
|
||||
|
||||
@@ -5,87 +5,81 @@ local dpi = require("beautiful").xresources.apply_dpi
|
||||
local color = require("theme.crylia.colors")
|
||||
require("theme.crylia.tools.icon_handler")
|
||||
|
||||
local list_update = function (widget, buttons, label, data, objects)
|
||||
local list_update = function(widget, buttons, label, data, objects)
|
||||
widget:reset()
|
||||
|
||||
for i, object in ipairs(objects) do
|
||||
|
||||
local tag_icon = wibox.widget{
|
||||
nil,
|
||||
{
|
||||
id = "icon",
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
nil,
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
local tag_icon = wibox.widget {
|
||||
nil,
|
||||
{
|
||||
id = "icon",
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
nil,
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
|
||||
local tag_icon_margin = wibox.widget{
|
||||
tag_icon,
|
||||
forced_width = dpi(33),
|
||||
margins = dpi(3),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
local tag_icon_margin = wibox.widget {
|
||||
tag_icon,
|
||||
forced_width = dpi(33),
|
||||
margins = dpi(3),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
local tag_label = wibox.widget{
|
||||
text = "",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
visible = true,
|
||||
font = "JetBrains Mono ExtraBold, 14",
|
||||
local tag_label = wibox.widget {
|
||||
text = "",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
visible = true,
|
||||
font = user_vars.vars.font.extrabold,
|
||||
forced_width = dpi(25),
|
||||
widget = wibox.widget.textbox
|
||||
}
|
||||
widget = wibox.widget.textbox
|
||||
}
|
||||
|
||||
local tag_label_margin = wibox.widget{
|
||||
tag_label,
|
||||
left = dpi(5),
|
||||
local tag_label_margin = wibox.widget {
|
||||
tag_label,
|
||||
left = dpi(5),
|
||||
right = dpi(5),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
local tag_widget = wibox.widget {
|
||||
|
||||
id = "widget_margin",
|
||||
{
|
||||
id = "widget_margin",
|
||||
{
|
||||
id = "container",
|
||||
tag_label_margin,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
margins = dpi(0),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
id = "container",
|
||||
tag_label_margin,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
|
||||
fg = color.color["White"],
|
||||
shape = function (cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local function create_buttons(buttons, object)
|
||||
if buttons then
|
||||
local btns = {}
|
||||
for _, b in ipairs(buttons) do
|
||||
-- Create a proxy button object: it will receive the real
|
||||
-- press and release events, and will propagate them to the
|
||||
-- button object the user provided, but with the object as
|
||||
-- argument.
|
||||
local btn = awful.button {
|
||||
modifiers = b.modifiers,
|
||||
button = b.button,
|
||||
on_press = function()
|
||||
b:emit_signal('press', object)
|
||||
end,
|
||||
on_release = function()
|
||||
b:emit_signal('release', object)
|
||||
end
|
||||
}
|
||||
btns[#btns + 1] = btn
|
||||
end
|
||||
return btns
|
||||
end
|
||||
end
|
||||
if buttons then
|
||||
local btns = {}
|
||||
for _, b in ipairs(buttons) do
|
||||
local btn = awful.button {
|
||||
modifiers = b.modifiers,
|
||||
button = b.button,
|
||||
on_press = function()
|
||||
b:emit_signal('press', object)
|
||||
end,
|
||||
on_release = function()
|
||||
b:emit_signal('release', object)
|
||||
end
|
||||
}
|
||||
btns[#btns + 1] = btn
|
||||
end
|
||||
return btns
|
||||
end
|
||||
end
|
||||
|
||||
tag_widget:buttons(create_buttons(buttons, object))
|
||||
|
||||
@@ -102,9 +96,10 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
tag_widget:set_bg("#3A475C")
|
||||
end
|
||||
|
||||
-- Set the icon for each client
|
||||
for _, client in ipairs(object:clients()) do
|
||||
tag_label_margin:set_right(0)
|
||||
local icon = wibox.widget{
|
||||
local icon = wibox.widget {
|
||||
{
|
||||
id = "icon_container",
|
||||
{
|
||||
@@ -115,21 +110,22 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
widget = wibox.container.place
|
||||
},
|
||||
tag_icon_margin,
|
||||
forced_width = dpi(33),
|
||||
margins = dpi(6),
|
||||
widget = wibox.container.margin
|
||||
forced_width = dpi(33),
|
||||
margins = dpi(6),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
icon.icon_container.icon:set_image(Get_icon("Papirus-Dark", client))
|
||||
tag_widget.widget_margin.container:setup({
|
||||
tag_widget.container:setup({
|
||||
icon,
|
||||
layout = wibox.layout.align.horizontal
|
||||
strategy = "exact",
|
||||
layout = wibox.container.constraint,
|
||||
})
|
||||
end
|
||||
|
||||
local old_wibox, old_cursor, old_bg
|
||||
tag_widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
old_bg = tag_widget.bg
|
||||
if object == awful.screen.focused().selected_tag then
|
||||
tag_widget.bg = '#dddddd' .. 'dd'
|
||||
@@ -146,7 +142,7 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
|
||||
tag_widget:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
function()
|
||||
if object == awful.screen.focused().selected_tag then
|
||||
tag_widget.bg = '#bbbbbb' .. 'dd'
|
||||
else
|
||||
@@ -157,7 +153,7 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
|
||||
tag_widget:connect_signal(
|
||||
"button::release",
|
||||
function ()
|
||||
function()
|
||||
if object == awful.screen.focused().selected_tag then
|
||||
tag_widget.bg = '#dddddd' .. 'dd'
|
||||
else
|
||||
@@ -168,7 +164,7 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
|
||||
tag_widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
tag_widget.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
@@ -182,31 +178,31 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
end
|
||||
end
|
||||
|
||||
local tag_list = function (s)
|
||||
local tag_list = function(s)
|
||||
return awful.widget.taglist(
|
||||
s,
|
||||
awful.widget.taglist.filter.noempty,
|
||||
gears.table.join(
|
||||
awful.button(
|
||||
{ },
|
||||
{},
|
||||
1,
|
||||
function (t)
|
||||
function(t)
|
||||
t:view_only()
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{ modkey },
|
||||
1,
|
||||
function (t)
|
||||
function(t)
|
||||
if client.focus then
|
||||
client.focus:move_to_tag(t)
|
||||
end
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{ },
|
||||
{},
|
||||
3,
|
||||
function (t)
|
||||
function(t)
|
||||
if client.focus then
|
||||
client.focus:toggle_tag(t)
|
||||
end
|
||||
@@ -215,23 +211,23 @@ local tag_list = function (s)
|
||||
awful.button(
|
||||
{ modkey },
|
||||
3,
|
||||
function (t)
|
||||
function(t)
|
||||
if client.focus then
|
||||
client.focus:toggle_tag(t)
|
||||
end
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{ },
|
||||
{},
|
||||
4,
|
||||
function (t)
|
||||
function(t)
|
||||
awful.tag.viewnext(t.screen)
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{ },
|
||||
{},
|
||||
5,
|
||||
function (t)
|
||||
function(t)
|
||||
awful.tag.viewprev(t.screen)
|
||||
end
|
||||
)
|
||||
|
||||
@@ -4,12 +4,12 @@ local dpi = require('beautiful').xresources.apply_dpi
|
||||
local gears = require('gears')
|
||||
local color = require('theme.crylia.colors')
|
||||
|
||||
local list_update = function (widget, buttons, label, data, objects)
|
||||
local list_update = function(widget, buttons, label, data, objects)
|
||||
widget:reset()
|
||||
local count
|
||||
for i, object in ipairs(objects) do
|
||||
count = i
|
||||
local task_widget = wibox.widget{
|
||||
local task_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -47,14 +47,14 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
},
|
||||
bg = color.color["White"],
|
||||
fg = color.color["Grey900"],
|
||||
shape = function (cr, width, height)
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
local task_tool_tip = awful.tooltip{
|
||||
objects = {task_widget},
|
||||
local task_tool_tip = awful.tooltip {
|
||||
objects = { task_widget },
|
||||
mode = "inside",
|
||||
align = "right",
|
||||
delay_show = 1
|
||||
@@ -83,6 +83,7 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
return btns
|
||||
end
|
||||
end
|
||||
|
||||
task_widget:buttons(create_buttons(buttons, object))
|
||||
|
||||
local text, bg, bg_image, icon, args = label(object, task_widget.container.layout_it.title)
|
||||
@@ -92,7 +93,7 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
else
|
||||
local text_full = text:match('>(.-)<')
|
||||
if text_full then
|
||||
text = object.class:sub(1,20)
|
||||
text = object.class:sub(1, 20)
|
||||
task_tool_tip:set_text(text_full)
|
||||
task_tool_tip:add_to_object(task_widget)
|
||||
else
|
||||
@@ -110,55 +111,55 @@ local list_update = function (widget, buttons, label, data, objects)
|
||||
widget:add(task_widget)
|
||||
widget:set_spacing(dpi(6))
|
||||
local old_wibox, old_cursor, old_bg
|
||||
task_widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
old_bg = task_widget.bg
|
||||
task_widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function()
|
||||
old_bg = task_widget.bg
|
||||
if object == client.focus then
|
||||
task_widget.bg = '#dddddddd'
|
||||
task_widget.bg = '#dddddddd'
|
||||
else
|
||||
task_widget.bg = '#3A475Cdd'
|
||||
end
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
w.cursor = "hand1"
|
||||
end
|
||||
end
|
||||
)
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
w.cursor = "hand1"
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
task_widget:connect_signal(
|
||||
"button::press",
|
||||
function ()
|
||||
if object == client.focus then
|
||||
task_widget:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
if object == client.focus then
|
||||
task_widget.bg = "#ffffffaa"
|
||||
else
|
||||
task_widget.bg = '#3A475Caa'
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
|
||||
task_widget:connect_signal(
|
||||
"button::release",
|
||||
function ()
|
||||
if object == client.focus then
|
||||
task_widget:connect_signal(
|
||||
"button::release",
|
||||
function()
|
||||
if object == client.focus then
|
||||
task_widget.bg = "#ffffffdd"
|
||||
else
|
||||
task_widget.bg = '#3A475Cdd'
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
|
||||
task_widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
task_widget.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
)
|
||||
task_widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function()
|
||||
task_widget.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
return widget
|
||||
end
|
||||
|
||||
12
nvim/init.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local chad_modules = {
|
||||
"options",
|
||||
"mappings",
|
||||
}
|
||||
|
||||
for i = 1, #chad_modules, 1 do
|
||||
if not pcall(require, chad_modules[i]) then
|
||||
error("Error loading " .. chad_modules[i] .. "\n")
|
||||
end
|
||||
end
|
||||
|
||||
require("mappings").misc()
|
||||
158
nvim/lua/chadrc.lua
Normal file
@@ -0,0 +1,158 @@
|
||||
-- IMPORTANT NOTE : This is user config
|
||||
|
||||
local M = {}
|
||||
|
||||
M.ui = {
|
||||
theme = "onedark",
|
||||
|
||||
-- theme toggle
|
||||
theme_toggler = false,
|
||||
fav_themes = {
|
||||
"onedark",
|
||||
"gruvchad",
|
||||
},
|
||||
italic_comments = false,
|
||||
|
||||
-- Enable this only if your terminal has the colorscheme set which nvchad uses
|
||||
-- For Ex : if you have onedark set in nvchad , set onedark's bg color on your terminal
|
||||
transparency = false,
|
||||
|
||||
hidden_statusline = {
|
||||
-- these are filetypes, not pattern matched
|
||||
"NvimTree",
|
||||
-- "terminal",
|
||||
},
|
||||
statusline_style = "default", -- default, round , slant , block , arrow
|
||||
}
|
||||
|
||||
M.options = {
|
||||
permanent_undo = true,
|
||||
ruler = false,
|
||||
hidden = true,
|
||||
ignorecase = true,
|
||||
mouse = "a",
|
||||
cmdheight = 1,
|
||||
updatetime = 250,
|
||||
timeoutlen = 400,
|
||||
clipboard = "unnamedplus",
|
||||
number = true,
|
||||
-- relative numbers in normal mode tool at the bottom of options.lua
|
||||
relativenumber = false,
|
||||
numberwidth = 2,
|
||||
expandtab = true,
|
||||
shiftwidth = 2,
|
||||
smartindent = true,
|
||||
mapleader = " ",
|
||||
autosave = false,
|
||||
enable_insertNav = true, -- navigation in insertmode
|
||||
-- used for updater
|
||||
update_url = "https://github.com/NvChad/NvChad",
|
||||
update_branch = "main",
|
||||
}
|
||||
|
||||
-- enable and disable plugins (false for disable)
|
||||
M.plugin_status = {
|
||||
-- UI
|
||||
nvim_bufferline = true,
|
||||
galaxyline = true,
|
||||
nvim_colorizer = true,
|
||||
dashboard_nvim = true,
|
||||
blankline = true,
|
||||
truezen_nvim = true,
|
||||
better_esc = true,
|
||||
-- lsp stuff
|
||||
lspkind = true,
|
||||
lspsignature = true,
|
||||
-- git stuff
|
||||
gitsigns = true,
|
||||
vim_fugitive = true,
|
||||
-- misc
|
||||
neoformat = true,
|
||||
vim_matchup = true,
|
||||
autosave_nvim = true,
|
||||
nvim_comment = true,
|
||||
neoscroll_nvim = true,
|
||||
telescope_media = true,
|
||||
cheatsheet = true,
|
||||
}
|
||||
|
||||
-- make sure you dont use same keys twice
|
||||
M.mappings = {
|
||||
-- plugin specific
|
||||
truezen = {
|
||||
ataraxisMode = "<leader>zz",
|
||||
minimalisticmode = "<leader>zm",
|
||||
focusmode = "<leader>zf",
|
||||
},
|
||||
comment_nvim = {
|
||||
comment_toggle = "<leader>/",
|
||||
},
|
||||
nvimtree = {
|
||||
treetoggle = "<C-n>", -- file manager
|
||||
},
|
||||
neoformat = {
|
||||
format = "<leader>fm",
|
||||
},
|
||||
dashboard = {
|
||||
open = "<leader>db",
|
||||
newfile = "<leader>fn",
|
||||
bookmarks = "<leader>bm",
|
||||
sessionload = "<leader>l",
|
||||
sessionsave = "<leader>s",
|
||||
},
|
||||
telescope = {
|
||||
live_grep = "<leader>fw",
|
||||
git_status = "<leader>gt",
|
||||
git_commits = "<leader>cm",
|
||||
find_files = "<leader>ff",
|
||||
buffers = "<leader>fb",
|
||||
help_tags = "<leader>fh",
|
||||
oldfiles = "<leader>fo",
|
||||
themes = "<leader>th",
|
||||
},
|
||||
telescope_media = {
|
||||
media_files = "<leader>fp",
|
||||
},
|
||||
chadsheet = {
|
||||
default_keys = "<leader>dk",
|
||||
user_keys = "<leader>uk",
|
||||
},
|
||||
bufferline = {
|
||||
new_buffer = "<S-t>",
|
||||
newtab = "<C-t>b",
|
||||
close = "<S-x>", -- close a buffer with custom func in utils.lua
|
||||
cycleNext = "<TAB>", -- next buffer
|
||||
cyclePrev = "<S-Tab>", -- previous buffer
|
||||
},
|
||||
fugitive = {
|
||||
Git = "<leader>gs",
|
||||
diffget_2 = "<leader>gh",
|
||||
diffget_3 = "<leader>gl",
|
||||
git_blame = "<leader>gb",
|
||||
},
|
||||
terms = { -- below are NvChad mappings, not plugin mappings
|
||||
esc_termmode = "jk",
|
||||
esc_hide_termmode = "JK",
|
||||
pick_term = "<leader>W", -- note: this is a telescope extension
|
||||
new_wind = "<leader>w",
|
||||
new_vert = "<leader>v",
|
||||
new_hori = "<leader>h",
|
||||
},
|
||||
-- navigation in insert mode
|
||||
insert_nav = {
|
||||
forward = "<C-l>",
|
||||
backward = "<C-h>",
|
||||
top_of_line = "<C-a>",
|
||||
end_of_line = "<C-e>",
|
||||
prev_line = "<C-j>",
|
||||
next_line = "<C-k>",
|
||||
},
|
||||
misc = {
|
||||
copywhole_file = "<C-a>",
|
||||
toggle_linenr = "<leader>n", -- show or hide line number
|
||||
theme_toggle = "<leader>x",
|
||||
update_nvchad = "<leader>uu",
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
159
nvim/lua/default_config.lua
Normal file
@@ -0,0 +1,159 @@
|
||||
-- IMPORTANT NOTE : This is default config, so dont change anything here. (check chadrc.lua instead)
|
||||
|
||||
local M = {}
|
||||
|
||||
M.ui = {
|
||||
theme = "onedark",
|
||||
|
||||
-- theme toggle
|
||||
theme_toggler = false,
|
||||
fav_themes = {
|
||||
"onedark",
|
||||
"gruvchad",
|
||||
},
|
||||
italic_comments = false,
|
||||
|
||||
-- Enable this only if your terminal has the colorscheme set which nvchad uses
|
||||
-- For Ex : if you have onedark set in nvchad , set onedark's bg color on your terminal
|
||||
transparency = false,
|
||||
|
||||
hidden_statusline = {
|
||||
-- these are filetypes, not pattern matched
|
||||
"NvimTree",
|
||||
"terminal",
|
||||
},
|
||||
statusline_style = "default", -- default, round , slant , block , arrow
|
||||
}
|
||||
|
||||
M.options = {
|
||||
permanent_undo = true,
|
||||
ruler = false,
|
||||
hidden = true,
|
||||
ignorecase = true,
|
||||
mouse = "a",
|
||||
cmdheight = 1,
|
||||
updatetime = 250,
|
||||
timeoutlen = 400,
|
||||
clipboard = "unnamedplus",
|
||||
number = true,
|
||||
relativenumber = false,
|
||||
numberwidth = 2,
|
||||
expandtab = true,
|
||||
shiftwidth = 2,
|
||||
smartindent = true,
|
||||
mapleader = " ",
|
||||
autosave = false,
|
||||
enable_insertNav = true, -- navigation in insertmode
|
||||
-- used for updater
|
||||
update_url = "https://github.com/NvChad/NvChad",
|
||||
update_branch = "main",
|
||||
}
|
||||
|
||||
-- enable and disable plugins (false for disable)
|
||||
M.plugin_status = {
|
||||
-- UI
|
||||
nvim_bufferline = true,
|
||||
galaxyline = true,
|
||||
nvim_colorizer = true,
|
||||
dashboard_nvim = true,
|
||||
blankline = true,
|
||||
truezen_nvim = true,
|
||||
better_esc = true,
|
||||
-- lsp stuff
|
||||
lspkind = true,
|
||||
lspsignature = true,
|
||||
-- git stuff
|
||||
gitsigns = true,
|
||||
vim_fugitive = true,
|
||||
-- misc
|
||||
neoformat = true,
|
||||
vim_matchup = true,
|
||||
autosave_nvim = true,
|
||||
nvim_comment = true,
|
||||
neoscroll_nvim = true,
|
||||
telescope_media = true,
|
||||
cheatsheet = true,
|
||||
}
|
||||
|
||||
-- make sure you dont use same keys twice
|
||||
M.mappings = {
|
||||
-- plugin specific
|
||||
truezen = {
|
||||
ataraxisMode = "<leader>zz",
|
||||
minimalisticmode = "<leader>zm",
|
||||
focusmode = "<leader>zf",
|
||||
},
|
||||
comment_nvim = {
|
||||
comment_toggle = "<leader>/",
|
||||
},
|
||||
nvimtree = {
|
||||
treetoggle = "<C-n>", -- file manager
|
||||
},
|
||||
neoformat = {
|
||||
format = "<leader>fm",
|
||||
},
|
||||
dashboard = {
|
||||
open = "<leader>db",
|
||||
newfile = "<leader>fn",
|
||||
bookmarks = "<leader>bm",
|
||||
sessionload = "<leader>l",
|
||||
sessionsave = "<leader>s",
|
||||
},
|
||||
telescope = {
|
||||
live_grep = "<leader>fw",
|
||||
git_status = "<leader>gt",
|
||||
git_commits = "<leader>cm",
|
||||
find_files = "<leader>ff",
|
||||
buffers = "<leader>fb",
|
||||
help_tags = "<leader>fh",
|
||||
oldfiles = "<leader>fo",
|
||||
themes = "<leader>th",
|
||||
},
|
||||
telescope_media = {
|
||||
media_files = "<leader>fp",
|
||||
},
|
||||
chadsheet = {
|
||||
default_keys = "<leader>dk",
|
||||
user_keys = "<leader>uk",
|
||||
},
|
||||
bufferline = {
|
||||
new_buffer = "<S-t>",
|
||||
newtab = "<C-t>b",
|
||||
close = "<S-x>", -- close a buffer with custom func in utils.lua
|
||||
cycleNext = "<TAB>", -- next buffer
|
||||
cyclePrev = "<S-Tab>", -- previous buffer
|
||||
},
|
||||
fugitive = {
|
||||
Git = "<leader>gs",
|
||||
diffget_2 = "<leader>gh",
|
||||
diffget_3 = "<leader>gl",
|
||||
git_blame = "<leader>gb",
|
||||
},
|
||||
terms = { -- below are NvChad mappings, not plugin mappings
|
||||
esc_termmode = "jk",
|
||||
esc_hide_termmode = "JK",
|
||||
pick_term = "<leader>W", -- note: this is a telescope extension
|
||||
new_wind = "<leader>w",
|
||||
new_vert = "<leader>v",
|
||||
new_hori = "<leader>h",
|
||||
}, -- navigation in insert mode
|
||||
insert_nav = {
|
||||
forward = "<C-l>",
|
||||
backward = "<C-h>",
|
||||
top_of_line = "<C-a>",
|
||||
end_of_line = "<C-e>",
|
||||
prev_line = "<C-j>",
|
||||
next_line = "<C-k>",
|
||||
},
|
||||
-- non plugin
|
||||
misc = {
|
||||
esc_Termmode = "jk", -- get out of terminal mode
|
||||
close_buffer = "<S-x>", -- close current focused buffer
|
||||
copywhole_file = "<C-a>",
|
||||
toggle_linenr = "<leader>n", -- show or hide line number
|
||||
theme_toggle = "<leader>x",
|
||||
update_nvchad = "<leader>uu",
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
135
nvim/lua/highlights.lua
Normal file
@@ -0,0 +1,135 @@
|
||||
local cmd = vim.cmd
|
||||
|
||||
local global_theme = "themes/" .. vim.g.nvchad_theme
|
||||
local colors = require(global_theme)
|
||||
|
||||
local white = colors.white
|
||||
local darker_black = colors.darker_black
|
||||
local black = colors.black
|
||||
local black2 = colors.black2
|
||||
local one_bg = colors.one_bg
|
||||
local one_bg2 = colors.one_bg2
|
||||
local grey = colors.grey
|
||||
local grey_fg = colors.grey_fg
|
||||
local red = colors.red
|
||||
local line = colors.line
|
||||
local green = colors.green
|
||||
local nord_blue = colors.nord_blue
|
||||
local blue = colors.blue
|
||||
local yellow = colors.yellow
|
||||
local purple = colors.purple
|
||||
local pmenu_bg = colors.pmenu_bg
|
||||
local folder_bg = colors.folder_bg
|
||||
|
||||
-- for guifg , bg
|
||||
|
||||
local function fg(group, color)
|
||||
cmd("hi " .. group .. " guifg=" .. color)
|
||||
end
|
||||
|
||||
local function bg(group, color)
|
||||
cmd("hi " .. group .. " guibg=" .. color)
|
||||
end
|
||||
|
||||
local function fg_bg(group, fgcol, bgcol)
|
||||
cmd("hi " .. group .. " guifg=" .. fgcol .. " guibg=" .. bgcol)
|
||||
end
|
||||
|
||||
-- blankline
|
||||
|
||||
fg("IndentBlanklineChar", line)
|
||||
|
||||
-- misc --
|
||||
fg("LineNr", grey)
|
||||
|
||||
-- Comments
|
||||
local ui = require("utils").load_config().ui
|
||||
|
||||
if ui.italic_comments then
|
||||
cmd("hi Comment gui=italic guifg=" .. grey_fg)
|
||||
else
|
||||
fg("Comment", grey_fg)
|
||||
end
|
||||
|
||||
fg("NvimInternalError", red)
|
||||
fg("VertSplit", line)
|
||||
fg("EndOfBuffer", black)
|
||||
-- fg_bg("Visual",light_grey, colors.lightbg)
|
||||
|
||||
-- Pmenu
|
||||
bg("Pmenu", one_bg)
|
||||
bg("PmenuSbar", one_bg2)
|
||||
bg("PmenuSel", pmenu_bg)
|
||||
bg("PmenuThumb", nord_blue)
|
||||
|
||||
-- inactive statuslines as thin splitlines
|
||||
cmd("hi! StatusLineNC gui=underline guifg=" .. line)
|
||||
|
||||
-- line n.o
|
||||
cmd "hi clear CursorLine"
|
||||
fg("cursorlinenr", white)
|
||||
|
||||
-- git signs ---
|
||||
fg_bg("DiffAdd", nord_blue, "none")
|
||||
fg_bg("DiffChange", grey_fg, "none")
|
||||
fg_bg("DiffModified", nord_blue, "none")
|
||||
|
||||
-- NvimTree
|
||||
fg("NvimTreeFolderIcon", folder_bg)
|
||||
fg("NvimTreeFolderName", folder_bg)
|
||||
fg("NvimTreeGitDirty", red)
|
||||
fg("NvimTreeOpenedFolderName", blue)
|
||||
fg("NvimTreeEmptyFolderName", blue)
|
||||
fg("NvimTreeIndentMarker", one_bg2)
|
||||
fg("NvimTreeVertSplit", darker_black)
|
||||
bg("NvimTreeVertSplit", darker_black)
|
||||
fg("NvimTreeEndOfBuffer", darker_black)
|
||||
|
||||
cmd("hi NvimTreeRootFolder gui=underline guifg=" .. red)
|
||||
bg("NvimTreeNormal", darker_black)
|
||||
fg_bg("NvimTreeStatuslineNc", darker_black, darker_black)
|
||||
fg_bg("NvimTreeWindowPicker", red, black2)
|
||||
|
||||
-- telescope
|
||||
fg("TelescopeBorder", line)
|
||||
fg("TelescopePromptBorder", line)
|
||||
fg("TelescopeResultsBorder", line)
|
||||
fg("TelescopePreviewBorder", grey)
|
||||
|
||||
-- LspDiagnostics ---
|
||||
|
||||
-- error / warnings
|
||||
fg("LspDiagnosticsSignError", red)
|
||||
fg("LspDiagnosticsVirtualTextError", red)
|
||||
fg("LspDiagnosticsSignWarning", yellow)
|
||||
fg("LspDiagnosticsVirtualTextWarning", yellow)
|
||||
|
||||
-- info
|
||||
fg("LspDiagnosticsSignInformation", green)
|
||||
fg("LspDiagnosticsVirtualTextInformation", green)
|
||||
|
||||
-- hint
|
||||
fg("LspDiagnosticsSignHint", purple)
|
||||
fg("LspDiagnosticsVirtualTextHint", purple)
|
||||
|
||||
-- dashboard
|
||||
|
||||
fg("DashboardHeader", grey_fg)
|
||||
fg("DashboardCenter", grey_fg)
|
||||
fg("DashboardShortcut", grey_fg)
|
||||
fg("DashboardFooter", grey_fg)
|
||||
|
||||
if require("utils").load_config().ui.transparency then
|
||||
bg("Normal", "NONE")
|
||||
bg("Folded", "NONE")
|
||||
fg("Folded", "NONE")
|
||||
bg("NvimTreeNormal", "NONE")
|
||||
bg("NvimTreeVertSplit", "NONE")
|
||||
fg("NvimTreeVertSplit", grey)
|
||||
bg("NvimTreeStatusLineNC", "NONE")
|
||||
fg("Comment", grey)
|
||||
end
|
||||
|
||||
-- For floating windows
|
||||
bg("NormalFloat", one_bg)
|
||||
fg("FloatBorder", blue)
|
||||
188
nvim/lua/mappings.lua
Normal file
@@ -0,0 +1,188 @@
|
||||
local user_map = require("utils").load_config().mappings
|
||||
local miscMap = user_map.misc
|
||||
|
||||
local cmd = vim.cmd
|
||||
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local options = { noremap = true, silent = true }
|
||||
if opts then
|
||||
options = vim.tbl_extend("force", options, opts)
|
||||
end
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
local M = {}
|
||||
local opt = {}
|
||||
|
||||
-- these mappings will only be called during initialization
|
||||
M.misc = function()
|
||||
-- dont copy any deleted text , this is disabled by default so uncomment the below mappings if you want them
|
||||
-- map("n", "dd", [=[ "_dd ]=], opt)
|
||||
-- map("v", "dd", [=[ "_dd ]=], opt)
|
||||
-- map("v", "x", [=[ "_x ]=], opt)
|
||||
-- todo: this should be configurable via chadrc
|
||||
|
||||
-- Don't copy the replaced text after pasting in visual mode
|
||||
map("v", "p", '"_dP', opt)
|
||||
|
||||
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
|
||||
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
|
||||
-- empty mode is same as using :map
|
||||
map("", "j", 'v:count ? "j" : "gj"', { expr = true })
|
||||
map("", "k", 'v:count ? "k" : "gk"', { expr = true })
|
||||
map("", "<Down>", 'v:count ? "j" : "gj"', { expr = true })
|
||||
map("", "<Up>", 'v:count ? "k" : "gk"', { expr = true })
|
||||
|
||||
-- copy whole file content
|
||||
map("n", miscMap.copywhole_file, ":%y+<CR>", opt)
|
||||
|
||||
-- toggle numbers
|
||||
map("n", miscMap.toggle_linenr, ":set nu!<CR>", opt)
|
||||
|
||||
-- terminals
|
||||
local function terms()
|
||||
local m = user_map.terms
|
||||
|
||||
-- get out of terminal mode
|
||||
map("t", m.esc_termmode, "<C-\\><C-n>", opt)
|
||||
-- hide a term from within terminal mode
|
||||
map("t", m.esc_hide_termmode, "<C-\\><C-n> :lua require('utils').close_buffer() <CR>", opt)
|
||||
-- pick a hidden term
|
||||
map("n", m.pick_term, ":Telescope terms <CR>", opt)
|
||||
|
||||
-- Open terminals
|
||||
-- TODO this opens on top of an existing vert/hori term, fixme
|
||||
map("n", m.new_wind, ":execute 'terminal' | let b:term_type = 'wind' | startinsert <CR>", opt)
|
||||
map("n", m.new_vert, ":execute 'vnew +terminal' | let b:term_type = 'vert' | startinsert <CR>", opt)
|
||||
map("n", m.new_hori, ":execute 15 .. 'new +terminal' | let b:term_type = 'hori' | startinsert <CR>", opt)
|
||||
end
|
||||
terms()
|
||||
|
||||
-- ctrl + s to save file
|
||||
map("n", "<C-s>", ":w <CR>", opt)
|
||||
|
||||
-- use ESC to turn off search highlighting
|
||||
map("n", "<Esc>", ":noh<CR>", opt)
|
||||
|
||||
-- navigation within insert mode
|
||||
local check_insertNav = require("utils").load_config().options.enable_insertNav
|
||||
|
||||
if check_insertNav == true then
|
||||
local m = user_map.insert_nav
|
||||
|
||||
map("i", m.forward, "<Right>", opt)
|
||||
map("i", m.backward, "<Left>", opt)
|
||||
map("i", m.top_of_line, "<ESC>^i", opt)
|
||||
map("i", m.end_of_line, "<End>", opt)
|
||||
map("i", m.next_line, "<Up>", opt)
|
||||
map("i", m.prev_line, "<Down>", opt)
|
||||
end
|
||||
|
||||
-- check the theme toggler
|
||||
local theme_toggler = require("utils").load_config().ui.theme_toggler
|
||||
if theme_toggler == true then
|
||||
local m = user_map.misc.theme_toggle
|
||||
|
||||
map("n", m, ":lua require('utils').toggle_theme(require('utils').load_config().ui.fav_themes)<CR>", opt)
|
||||
end
|
||||
|
||||
-- Packer commands till because we are not loading it at startup
|
||||
cmd "silent! command PackerCompile lua require 'pluginList' require('packer').compile()"
|
||||
cmd "silent! command PackerInstall lua require 'pluginList' require('packer').install()"
|
||||
cmd "silent! command PackerStatus lua require 'pluginList' require('packer').status()"
|
||||
cmd "silent! command PackerSync lua require 'pluginList' require('packer').sync()"
|
||||
cmd "silent! command PackerUpdate lua require 'pluginList' require('packer').update()"
|
||||
|
||||
-- add NvChadUpdate command and mapping
|
||||
cmd "silent! command! NvChadUpdate lua require('utils').update_nvchad()"
|
||||
map("n", user_map.misc.update_nvchad, ":NvChadUpdate<CR>", opt)
|
||||
end
|
||||
|
||||
M.bufferline = function()
|
||||
local m = user_map.bufferline
|
||||
|
||||
map("n", m.new_buffer, ":enew<CR>", opt) -- new buffer
|
||||
map("n", m.newtab, ":tabnew<CR>", opt) -- new tab
|
||||
map("n", m.close, ":lua require('utils').close_buffer() <CR>", opt) -- close buffer
|
||||
|
||||
-- move between tabs
|
||||
|
||||
map("n", m.cycleNext, ":BufferLineCycleNext<CR>", opt)
|
||||
map("n", m.cyclePrev, ":BufferLineCyclePrev<CR>", opt)
|
||||
end
|
||||
|
||||
M.chadsheet = function()
|
||||
local m = user_map.chadsheet
|
||||
|
||||
map("n", m.default_keys, ":lua require('cheatsheet').show_cheatsheet_telescope()<CR>", opt)
|
||||
map(
|
||||
"n",
|
||||
m.user_keys,
|
||||
":lua require('cheatsheet').show_cheatsheet_telescope{bundled_cheatsheets = false, bundled_plugin_cheatsheets = false }<CR>",
|
||||
opt
|
||||
)
|
||||
end
|
||||
|
||||
M.comment_nvim = function()
|
||||
local m = user_map.comment_nvim.comment_toggle
|
||||
map("n", m, ":CommentToggle<CR>", opt)
|
||||
map("v", m, ":CommentToggle<CR>", opt)
|
||||
end
|
||||
|
||||
M.dashboard = function()
|
||||
local m = user_map.dashboard
|
||||
|
||||
map("n", m.open, ":Dashboard<CR>", opt)
|
||||
map("n", m.newfile, ":DashboardNewFile<CR>", opt)
|
||||
map("n", m.bookmarks, ":DashboardJumpMarks<CR>", opt)
|
||||
map("n", m.sessionload, ":SessionLoad<CR>", opt)
|
||||
map("n", m.sessionsave, ":SessionSave<CR>", opt)
|
||||
end
|
||||
|
||||
M.fugitive = function()
|
||||
local m = user_map.fugitive
|
||||
|
||||
map("n", m.Git, ":Git<CR>", opt)
|
||||
map("n", m.diffget_2, ":diffget //2<CR>", opt)
|
||||
map("n", m.diffget_3, ":diffget //3<CR>", opt)
|
||||
map("n", m.git_blame, ":Git blame<CR>", opt)
|
||||
end
|
||||
|
||||
M.nvimtree = function()
|
||||
local m = user_map.nvimtree.treetoggle
|
||||
|
||||
map("n", m, ":NvimTreeToggle<CR>", opt)
|
||||
end
|
||||
|
||||
M.neoformat = function()
|
||||
local m = user_map.neoformat.format
|
||||
map("n", m, ":Neoformat<CR>", opt)
|
||||
end
|
||||
|
||||
M.truezen = function()
|
||||
local m = user_map.truezen
|
||||
|
||||
map("n", m.ataraxisMode, ":TZAtaraxis<CR>", opt)
|
||||
map("n", m.minimalisticmode, ":TZMinimalist<CR>", opt)
|
||||
map("n", m.focusmode, ":TZFocus<CR>", opt)
|
||||
end
|
||||
|
||||
M.telescope = function()
|
||||
local m = user_map.telescope
|
||||
|
||||
map("n", m.live_grep, ":Telescope live_grep<CR>", opt)
|
||||
map("n", m.git_status, ":Telescope git_status <CR>", opt)
|
||||
map("n", m.git_commits, ":Telescope git_commits <CR>", opt)
|
||||
map("n", m.find_files, ":Telescope find_files <CR>", opt)
|
||||
map("n", m.buffers, ":Telescope buffers<CR>", opt)
|
||||
map("n", m.help_tags, ":Telescope help_tags<CR>", opt)
|
||||
map("n", m.oldfiles, ":Telescope oldfiles<CR>", opt)
|
||||
map("n", m.themes, ":Telescope themes<CR>", opt)
|
||||
end
|
||||
|
||||
M.telescope_media = function()
|
||||
local m = user_map.telescope_media
|
||||
map("n", m.media_files, ":Telescope media_files <CR>", opt)
|
||||
end
|
||||
|
||||
return M
|
||||
88
nvim/lua/options.lua
Normal file
@@ -0,0 +1,88 @@
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
-- export user config as a global varibale
|
||||
g.nvchad_user_config = "chadrc"
|
||||
|
||||
local options = require("utils").load_config().options
|
||||
|
||||
opt.completeopt = { "menuone", "noselect" }
|
||||
opt.undofile = options.permanent_undo
|
||||
opt.ruler = options.ruler
|
||||
opt.hidden = options.hidden
|
||||
opt.ignorecase = options.ignorecase
|
||||
opt.splitbelow = true
|
||||
opt.splitright = true
|
||||
opt.termguicolors = true
|
||||
opt.cul = true
|
||||
opt.mouse = options.mouse
|
||||
opt.signcolumn = "yes"
|
||||
opt.cmdheight = options.cmdheight
|
||||
opt.updatetime = options.updatetime -- update interval for gitsigns
|
||||
opt.timeoutlen = options.timeoutlen
|
||||
opt.clipboard = options.clipboard
|
||||
|
||||
-- disable nvim intro
|
||||
opt.shortmess:append "sI"
|
||||
|
||||
-- disable tilde on end of buffer: https://github.com/ neovim/neovim/pull/8546#issuecomment-643643758
|
||||
opt.fillchars = { eob = " " }
|
||||
|
||||
-- Numbers
|
||||
opt.number = options.number
|
||||
opt.numberwidth = options.numberwidth
|
||||
opt.relativenumber = options.relativenumber
|
||||
|
||||
-- Indenline
|
||||
opt.expandtab = options.expandtab
|
||||
opt.shiftwidth = options.shiftwidth
|
||||
opt.smartindent = options.smartindent
|
||||
|
||||
-- go to previous/next line with h,l,left arrow and right arrow
|
||||
-- when cursor reaches end/beginning of line
|
||||
opt.whichwrap:append "<>hl"
|
||||
|
||||
g.mapleader = options.mapleader
|
||||
g.auto_save = options.autosave
|
||||
|
||||
-- disable builtin vim plugins
|
||||
local disabled_built_ins = {
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"gzip",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"2html_plugin",
|
||||
"logipat",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"matchit",
|
||||
}
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
g["loaded_" .. plugin] = 1
|
||||
end
|
||||
|
||||
-- Use relative & absolute line numbers in 'n' & 'i' modes respectively
|
||||
-- vim.cmd[[ au InsertEnter * set norelativenumber ]]
|
||||
-- vim.cmd[[ au InsertLeave * set relativenumber ]]
|
||||
|
||||
-- Don't show any numbers inside terminals
|
||||
vim.cmd [[ au TermOpen term://* setlocal nonumber norelativenumber ]]
|
||||
|
||||
-- Don't show status line on certain windows
|
||||
vim.cmd [[ au TermOpen term://* setfiletype terminal ]]
|
||||
vim.cmd [[ let hidden_statusline = luaeval('require("utils").load_config().ui.hidden_statusline') | autocmd BufEnter,BufWinEnter,WinEnter,CmdwinEnter,TermEnter * nested if index(hidden_statusline, &ft) >= 0 | set laststatus=0 | else | set laststatus=2 | endif ]]
|
||||
|
||||
-- Open a file from its last left off position
|
||||
-- vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
|
||||
-- File extension specific tabbing
|
||||
-- vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]]
|
||||
45
nvim/lua/packerInit.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
local cmd = vim.cmd
|
||||
|
||||
cmd "packadd packer.nvim"
|
||||
|
||||
local present, packer = pcall(require, "packer")
|
||||
|
||||
if not present then
|
||||
local packer_path = vim.fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
|
||||
|
||||
print "Cloning packer.."
|
||||
-- remove the dir before cloning
|
||||
vim.fn.delete(packer_path, "rf")
|
||||
vim.fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
"--depth",
|
||||
"20",
|
||||
packer_path,
|
||||
}
|
||||
|
||||
cmd "packadd packer.nvim"
|
||||
present, packer = pcall(require, "packer")
|
||||
|
||||
if present then
|
||||
print "Packer cloned successfully."
|
||||
else
|
||||
error("Couldn't clone packer !\nPacker path: " .. packer_path)
|
||||
end
|
||||
end
|
||||
|
||||
return packer.init {
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float { border = "single" }
|
||||
end,
|
||||
prompt_border = "single",
|
||||
},
|
||||
git = {
|
||||
clone_timeout = 600, -- Timeout, in seconds, for git clones
|
||||
},
|
||||
auto_clean = true,
|
||||
compile_on_sync = true,
|
||||
-- auto_reload_compiled = true
|
||||
}
|
||||
317
nvim/lua/pluginList.lua
Normal file
@@ -0,0 +1,317 @@
|
||||
local plugin_status = require("utils").load_config().plugin_status
|
||||
|
||||
local present, _ = pcall(require, "packerInit")
|
||||
local packer
|
||||
|
||||
if present then
|
||||
packer = require "packer"
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
||||
local use = packer.use
|
||||
|
||||
return packer.startup(function()
|
||||
use {
|
||||
"wbthomason/packer.nvim",
|
||||
event = "VimEnter",
|
||||
}
|
||||
|
||||
use {
|
||||
"jdhao/better-escape.vim",
|
||||
disable = not plugin_status.better_esc,
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("plugins.others").escape()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"glepnir/galaxyline.nvim",
|
||||
disable = not plugin_status.galaxyline,
|
||||
after = "nvim-web-devicons",
|
||||
config = function()
|
||||
require "plugins.statusline"
|
||||
end,
|
||||
}
|
||||
use {
|
||||
"akinsho/nvim-bufferline.lua",
|
||||
disable = not plugin_status.nvim_bufferline,
|
||||
after = "galaxyline.nvim",
|
||||
config = function()
|
||||
require "plugins.bufferline"
|
||||
end,
|
||||
setup = function()
|
||||
require("mappings").bufferline()
|
||||
end,
|
||||
}
|
||||
|
||||
-- color related stuff
|
||||
use {
|
||||
"NvChad/nvim-base16.lua",
|
||||
after = "packer.nvim",
|
||||
config = function()
|
||||
require "theme"
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
disable = not plugin_status.nvim_colorizer,
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("plugins.others").colorizer()
|
||||
end,
|
||||
}
|
||||
|
||||
-- lsp stuff
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require "plugins.treesitter"
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"kabouzeid/nvim-lspinstall",
|
||||
event = "BufRead",
|
||||
}
|
||||
|
||||
use {
|
||||
"neovim/nvim-lspconfig",
|
||||
after = "nvim-lspinstall",
|
||||
config = function()
|
||||
require "plugins.lspconfig"
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"onsails/lspkind-nvim",
|
||||
disable = not plugin_status.lspkind,
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("plugins.others").lspkind()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
disable = not plugin_status.lspsignature,
|
||||
after = "nvim-lspconfig",
|
||||
config = function()
|
||||
require("plugins.others").signature()
|
||||
end,
|
||||
}
|
||||
|
||||
-- load compe in insert mode only
|
||||
use {
|
||||
"hrsh7th/nvim-compe",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require "plugins.compe"
|
||||
end,
|
||||
wants = "LuaSnip",
|
||||
requires = {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
wants = "friendly-snippets",
|
||||
event = "InsertCharPre",
|
||||
config = function()
|
||||
require "plugins.luasnip"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
event = "InsertCharPre",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
use {
|
||||
"sbdchd/neoformat",
|
||||
disable = not plugin_status.neoformat,
|
||||
cmd = "Neoformat",
|
||||
setup = function()
|
||||
require("mappings").neoformat()
|
||||
end,
|
||||
}
|
||||
|
||||
-- file managing , picker etc
|
||||
use {
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
cmd = "NvimTreeToggle",
|
||||
config = function()
|
||||
require "plugins.nvimtree"
|
||||
end,
|
||||
setup = function()
|
||||
require("mappings").nvimtree()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
after = "nvim-base16.lua",
|
||||
config = function()
|
||||
require "plugins.icons"
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-lua/plenary.nvim",
|
||||
after = "nvim-bufferline.lua",
|
||||
}
|
||||
use {
|
||||
"nvim-lua/popup.nvim",
|
||||
after = "plenary.nvim",
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
after = "plenary.nvim",
|
||||
requires = {
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
run = "make",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-media-files.nvim",
|
||||
disable = not plugin_status.telescope_media,
|
||||
setup = function()
|
||||
require("mappings").telescope_media()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"sudormrfbin/cheatsheet.nvim",
|
||||
disable = not plugin_status.cheatsheet,
|
||||
event = "VimEnter",
|
||||
after = "telescope.nvim",
|
||||
config = function()
|
||||
require "plugins.chadsheet"
|
||||
end,
|
||||
setup = function()
|
||||
require("mappings").chadsheet()
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require "plugins.telescope"
|
||||
end,
|
||||
setup = function()
|
||||
require("mappings").telescope()
|
||||
end,
|
||||
}
|
||||
|
||||
-- git stuff
|
||||
use {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
disable = not plugin_status.gitsigns,
|
||||
after = "plenary.nvim",
|
||||
config = function()
|
||||
require "plugins.gitsigns"
|
||||
end,
|
||||
}
|
||||
|
||||
-- misc plugins
|
||||
use {
|
||||
"windwp/nvim-autopairs",
|
||||
after = "nvim-compe",
|
||||
config = function()
|
||||
require "plugins.autopairs"
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"andymass/vim-matchup",
|
||||
disable = not plugin_status.vim_matchup,
|
||||
event = "CursorMoved",
|
||||
}
|
||||
|
||||
use {
|
||||
"terrortylor/nvim-comment",
|
||||
disable = not plugin_status.nvim_comment,
|
||||
cmd = "CommentToggle",
|
||||
config = function()
|
||||
require("plugins.others").comment()
|
||||
end,
|
||||
setup = function()
|
||||
require("mappings").comment_nvim()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"glepnir/dashboard-nvim",
|
||||
disable = not plugin_status.dashboard_nvim,
|
||||
cmd = {
|
||||
"Dashboard",
|
||||
"DashboardNewFile",
|
||||
"DashboardJumpMarks",
|
||||
"SessionLoad",
|
||||
"SessionSave",
|
||||
},
|
||||
setup = function()
|
||||
require "plugins.dashboard"
|
||||
require("mappings").dashboard()
|
||||
end,
|
||||
}
|
||||
|
||||
-- load autosave only if its globally enabled
|
||||
use {
|
||||
disable = not plugin_status.autosave_nvim,
|
||||
"Pocco81/AutoSave.nvim",
|
||||
config = function()
|
||||
require "plugins.autosave"
|
||||
end,
|
||||
cond = function()
|
||||
return vim.g.auto_save == true
|
||||
end,
|
||||
}
|
||||
|
||||
-- smooth scroll
|
||||
use {
|
||||
"karb94/neoscroll.nvim",
|
||||
disable = not plugin_status.neoscroll_nvim,
|
||||
event = "WinScrolled",
|
||||
config = function()
|
||||
require("plugins.others").neoscroll()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"Pocco81/TrueZen.nvim",
|
||||
disable = not plugin_status.truezen_nvim,
|
||||
cmd = {
|
||||
"TZAtaraxis",
|
||||
"TZMinimalist",
|
||||
"TZFocus",
|
||||
},
|
||||
config = function()
|
||||
require "plugins.zenmode"
|
||||
end,
|
||||
setup = function()
|
||||
require("mappings").truezen()
|
||||
end,
|
||||
}
|
||||
|
||||
-- use "alvan/vim-closetag" -- for html autoclosing tag
|
||||
|
||||
use {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
disable = not plugin_status.blankline,
|
||||
event = "BufRead",
|
||||
setup = function()
|
||||
require("plugins.others").blankline()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
"tpope/vim-fugitive",
|
||||
disable = not plugin_status.vim_fugitive,
|
||||
cmd = {
|
||||
"Git",
|
||||
},
|
||||
setup = function()
|
||||
require("mappings").fugitive()
|
||||
end,
|
||||
}
|
||||
end)
|
||||
12
nvim/lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local present1, autopairs = pcall(require, "nvim-autopairs")
|
||||
local present2, autopairs_completion = pcall(require, "nvim-autopairs.completion.compe")
|
||||
|
||||
if not (present1 or present2) then
|
||||
return
|
||||
end
|
||||
|
||||
autopairs.setup()
|
||||
autopairs_completion.setup {
|
||||
map_cr = true,
|
||||
map_complete = true, -- insert () func completion
|
||||
}
|
||||
19
nvim/lua/plugins/autosave.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
-- autosave.nvim plugin disabled by default
|
||||
local present, autosave = pcall(require, "autosave")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
autosave.setup {
|
||||
enabled = vim.g.auto_save, -- takes boolean value from init.lua
|
||||
execution_message = "autosaved at : " .. vim.fn.strftime "%H:%M:%S",
|
||||
events = { "InsertLeave", "TextChanged" },
|
||||
conditions = {
|
||||
exists = true,
|
||||
filetype_is_not = {},
|
||||
modifiable = true,
|
||||
},
|
||||
write_all_buffers = false,
|
||||
on_off_commands = true,
|
||||
clean_command_line_interval = 2500,
|
||||
}
|
||||
123
nvim/lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,123 @@
|
||||
local global_theme = "themes/" .. vim.g.nvchad_theme
|
||||
local colors = require(global_theme)
|
||||
|
||||
local present, bufferline = pcall(require, "bufferline")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup {
|
||||
options = {
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "",
|
||||
close_icon = "",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
max_name_length = 14,
|
||||
max_prefix_length = 13,
|
||||
tab_size = 20,
|
||||
show_tab_indicators = true,
|
||||
enforce_regular_tabs = false,
|
||||
view = "multiwindow",
|
||||
show_buffer_close_icons = true,
|
||||
separator_style = "thin",
|
||||
mappings = true,
|
||||
always_show_bufferline = true,
|
||||
custom_filter = function(buf_number)
|
||||
-- Func to filter out our managed/persistent split terms
|
||||
local present_type, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf_number, "term_type")
|
||||
end)
|
||||
|
||||
if present_type then
|
||||
if type == "vert" then
|
||||
return false
|
||||
elseif type == "hori" then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
highlights = {
|
||||
fill = {
|
||||
guifg = colors.grey_fg,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
background = {
|
||||
guifg = colors.grey_fg,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
-- buffers
|
||||
buffer_visible = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
buffer_selected = {
|
||||
guifg = colors.white,
|
||||
guibg = colors.black,
|
||||
gui = "bold",
|
||||
},
|
||||
-- tabs
|
||||
tab = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.one_bg3,
|
||||
},
|
||||
tab_selected = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.nord_blue,
|
||||
},
|
||||
tab_close = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black,
|
||||
},
|
||||
indicator_selected = {
|
||||
guifg = colors.black,
|
||||
guibg = colors.black,
|
||||
},
|
||||
-- separators
|
||||
separator = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
separator_visible = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
separator_selected = {
|
||||
guifg = colors.black2,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
-- modified
|
||||
modified = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
modified_visible = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
modified_selected = {
|
||||
guifg = colors.green,
|
||||
guibg = colors.black,
|
||||
},
|
||||
-- close buttons
|
||||
|
||||
close_button = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
close_button_visible = {
|
||||
guifg = colors.light_grey,
|
||||
guibg = colors.black2,
|
||||
},
|
||||
close_button_selected = {
|
||||
guifg = colors.red,
|
||||
guibg = colors.black,
|
||||
},
|
||||
},
|
||||
}
|
||||
25
nvim/lua/plugins/chadsheet.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local present, chadsheet = pcall(require, "cheatsheet")
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local mappings = require("utils").load_config().mappings
|
||||
|
||||
-- add user mappings to the cheetsheet
|
||||
for section, data in pairs(mappings) do
|
||||
for description, keymap in pairs(data) do
|
||||
chadsheet.add_cheat(description, keymap, section)
|
||||
end
|
||||
end
|
||||
|
||||
require("cheatsheet").setup {
|
||||
|
||||
bundled_cheatsheets = {
|
||||
enabled = { "default" },
|
||||
disabled = { "unicode", "nerd-fonts" },
|
||||
},
|
||||
|
||||
bundled_plugin_cheatsheets = false,
|
||||
include_only_installed_plugins = true,
|
||||
}
|
||||
25
nvim/lua/plugins/compe.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local present, compe = pcall(require, "compe")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
compe.setup {
|
||||
enabled = true,
|
||||
autocomplete = true,
|
||||
debug = false,
|
||||
min_length = 1,
|
||||
preselect = "enable",
|
||||
throttle_time = 80,
|
||||
source_timeout = 200,
|
||||
incomplete_delay = 400,
|
||||
max_abbr_width = 100,
|
||||
max_kind_width = 100,
|
||||
max_menu_width = 100,
|
||||
documentation = true,
|
||||
source = {
|
||||
buffer = { kind = "", true },
|
||||
luasnip = { kind = "", true },
|
||||
nvim_lsp = true,
|
||||
nvim_lua = true,
|
||||
},
|
||||
}
|
||||
40
nvim/lua/plugins/dashboard.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
local g = vim.g
|
||||
local fn = vim.fn
|
||||
|
||||
local plugins_count = fn.len(fn.globpath("~/.local/share/nvim/site/pack/packer/start", "*", 0, 1))
|
||||
|
||||
g.dashboard_disable_at_vimenter = 1 -- dashboard is disabled by default
|
||||
g.dashboard_disable_statusline = 1
|
||||
g.dashboard_default_executive = "telescope"
|
||||
g.dashboard_custom_header = {
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ",
|
||||
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
|
||||
" ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
|
||||
" ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
|
||||
" ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
|
||||
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ",
|
||||
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
|
||||
" ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
|
||||
" ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ",
|
||||
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ",
|
||||
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ",
|
||||
" ",
|
||||
}
|
||||
|
||||
g.dashboard_custom_section = {
|
||||
a = { description = { " Find File SPC f f" }, command = "Telescope find_files" },
|
||||
b = { description = { " Recents SPC f o" }, command = "Telescope oldfiles" },
|
||||
c = { description = { " Find Word SPC f w" }, command = "Telescope live_grep" },
|
||||
d = { description = { "洛 New File SPC f n" }, command = "DashboardNewFile" },
|
||||
e = { description = { " Bookmarks SPC b m" }, command = "Telescope marks" },
|
||||
f = { description = { " Load Last Session SPC s l" }, command = "SessionLoad" },
|
||||
}
|
||||
|
||||
g.dashboard_custom_footer = {
|
||||
" ",
|
||||
-- "NvChad Loaded " .. plugins_count .. " plugins",
|
||||
"NvChad v0.5",
|
||||
}
|
||||
32
nvim/lua/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local present, gitsigns = pcall(require, "gitsigns")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup {
|
||||
signs = {
|
||||
add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" },
|
||||
change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" },
|
||||
delete = { hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr" },
|
||||
topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
||||
changedelete = { hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr" },
|
||||
},
|
||||
numhl = false,
|
||||
keymaps = {
|
||||
-- Default keymap options
|
||||
noremap = true,
|
||||
buffer = true,
|
||||
["n ]c"] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'" },
|
||||
["n [c"] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'" },
|
||||
["n <leader>hs"] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||
["n <leader>hu"] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||
["n <leader>hr"] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||
["n <leader>hp"] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||
["n <leader>hb"] = '<cmd>lua require"gitsigns".blame_line()<CR>',
|
||||
},
|
||||
watch_index = {
|
||||
interval = 100,
|
||||
},
|
||||
sign_priority = 5,
|
||||
status_formatter = nil, -- Use default
|
||||
}
|
||||
122
nvim/lua/plugins/icons.lua
Normal file
@@ -0,0 +1,122 @@
|
||||
local present, icons = pcall(require, "nvim-web-devicons")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local global_theme = "themes/" .. vim.g.nvchad_theme
|
||||
local colors = require(global_theme)
|
||||
|
||||
icons.setup {
|
||||
override = {
|
||||
html = {
|
||||
icon = "",
|
||||
color = colors.baby_pink,
|
||||
name = "html",
|
||||
},
|
||||
css = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "css",
|
||||
},
|
||||
js = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "js",
|
||||
},
|
||||
ts = {
|
||||
icon = "ﯤ",
|
||||
color = colors.teal,
|
||||
name = "ts",
|
||||
},
|
||||
kt = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "kt",
|
||||
},
|
||||
png = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "png",
|
||||
},
|
||||
jpg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpg",
|
||||
},
|
||||
jpeg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpeg",
|
||||
},
|
||||
mp3 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp3",
|
||||
},
|
||||
mp4 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp4",
|
||||
},
|
||||
out = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "out",
|
||||
},
|
||||
Dockerfile = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "Dockerfile",
|
||||
},
|
||||
rb = {
|
||||
icon = "",
|
||||
color = colors.pink,
|
||||
name = "rb",
|
||||
},
|
||||
vue = {
|
||||
icon = "﵂",
|
||||
color = colors.vibrant_green,
|
||||
name = "vue",
|
||||
},
|
||||
py = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "py",
|
||||
},
|
||||
toml = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "toml",
|
||||
},
|
||||
lock = {
|
||||
icon = "",
|
||||
color = colors.red,
|
||||
name = "lock",
|
||||
},
|
||||
zip = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "zip",
|
||||
},
|
||||
xz = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "xz",
|
||||
},
|
||||
deb = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "deb",
|
||||
},
|
||||
rpm = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "rpm",
|
||||
},
|
||||
lua = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "lua",
|
||||
},
|
||||
},
|
||||
}
|
||||
123
nvim/lua/plugins/lspconfig.lua
Normal file
@@ -0,0 +1,123 @@
|
||||
local present1, lspconfig = pcall(require, "lspconfig")
|
||||
local present2, lspinstall = pcall(require, "lspinstall")
|
||||
if not (present1 or present2) then
|
||||
return
|
||||
end
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
|
||||
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
buf_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
|
||||
buf_set_keymap("n", "<space>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
elseif client.resolved_capabilities.document_range_formatting then
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
|
||||
end
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
-- lspInstall + lspconfig stuff
|
||||
|
||||
local function setup_servers()
|
||||
lspinstall.setup()
|
||||
local servers = lspinstall.installed_servers()
|
||||
|
||||
for _, lang in pairs(servers) do
|
||||
if lang ~= "lua" then
|
||||
lspconfig[lang].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = vim.loop.cwd,
|
||||
}
|
||||
elseif lang == "lua" then
|
||||
lspconfig[lang].setup {
|
||||
root_dir = vim.loop.cwd,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
||||
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
|
||||
},
|
||||
maxPreload = 100000,
|
||||
preloadFileSize = 10000,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
setup_servers()
|
||||
|
||||
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
|
||||
lspinstall.post_install_hook = function()
|
||||
setup_servers() -- reload installed servers
|
||||
vim.cmd "bufdo e"
|
||||
end
|
||||
|
||||
-- replace the default lsp diagnostic symbols
|
||||
function lspSymbol(name, icon)
|
||||
vim.fn.sign_define("LspDiagnosticsSign" .. name, { text = icon, numhl = "LspDiagnosticsDefaul" .. name })
|
||||
end
|
||||
|
||||
lspSymbol("Error", "")
|
||||
lspSymbol("Warning", "")
|
||||
lspSymbol("Information", "")
|
||||
lspSymbol("Hint", "")
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = {
|
||||
prefix = "",
|
||||
spacing = 0,
|
||||
},
|
||||
signs = true,
|
||||
underline = true,
|
||||
-- set this to true if you want diagnostics to show in insert mode
|
||||
update_in_insert = false,
|
||||
})
|
||||
|
||||
-- suppress error messages from lang servers
|
||||
vim.notify = function(msg, log_level, _opts)
|
||||
if msg:match "exit code" then
|
||||
return
|
||||
end
|
||||
if log_level == vim.log.levels.ERROR then
|
||||
vim.api.nvim_err_writeln(msg)
|
||||
else
|
||||
vim.api.nvim_echo({ { msg } }, true, {})
|
||||
end
|
||||
end
|
||||
66
nvim/lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,66 @@
|
||||
local present, luasnip = pcall(require, "luasnip")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local t = function(str)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
end
|
||||
|
||||
local check_back_space = function()
|
||||
local col = vim.fn.col "." - 1
|
||||
if col == 0 or vim.fn.getline("."):sub(col, col):match "%s" then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
_G.tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-n>"
|
||||
elseif luasnip and luasnip.expand_or_jumpable() then
|
||||
return t "<Plug>luasnip-expand-or-jump"
|
||||
elseif check_back_space() then
|
||||
return t "<Tab>"
|
||||
else
|
||||
return vim.fn["compe#complete"]()
|
||||
end
|
||||
end
|
||||
_G.s_tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-p>"
|
||||
elseif luasnip and luasnip.jumpable(-1) then
|
||||
return t "<Plug>luasnip-jump-prev"
|
||||
else
|
||||
return t "<S-Tab>"
|
||||
end
|
||||
end
|
||||
|
||||
_G.completions = function()
|
||||
local npairs
|
||||
if not pcall(function()
|
||||
npairs = require "nvim-autopairs"
|
||||
end) then
|
||||
return
|
||||
end
|
||||
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
if vim.fn.complete_info()["selected"] ~= -1 then
|
||||
return vim.fn["compe#confirm"] "<CR>"
|
||||
end
|
||||
end
|
||||
return npairs.check_break_line_char()
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true })
|
||||
vim.api.nvim_set_keymap("i", "<CR>", "v:lua.completions()", { expr = true })
|
||||
|
||||
luasnip.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
}
|
||||
require("luasnip/loaders/from_vscode").load()
|
||||
95
nvim/lua/plugins/nvimtree.lua
Normal file
@@ -0,0 +1,95 @@
|
||||
local present, tree_c = pcall(require, "nvim-tree.config")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local tree_cb = tree_c.nvim_tree_callback
|
||||
local g = vim.g
|
||||
|
||||
vim.o.termguicolors = true
|
||||
|
||||
g.nvim_tree_side = "left"
|
||||
g.nvim_tree_width = 25
|
||||
g.nvim_tree_ignore = { ".git", "node_modules", ".cache" }
|
||||
g.nvim_tree_gitignore = 1
|
||||
g.nvim_tree_auto_ignore_ft = { "dashboard" } -- don't open tree on specific fiypes.
|
||||
g.nvim_tree_auto_open = 0
|
||||
g.nvim_tree_auto_close = 0 -- closes tree when it's the last window
|
||||
g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened
|
||||
g.nvim_tree_follow = 1
|
||||
g.nvim_tree_indent_markers = 1
|
||||
g.nvim_tree_hide_dotfiles = 1
|
||||
g.nvim_tree_git_hl = 1
|
||||
g.nvim_tree_highlight_opened_files = 0
|
||||
g.nvim_tree_root_folder_modifier = table.concat { ":t:gs?$?/..", string.rep(" ", 1000), "?:gs?^??" }
|
||||
g.nvim_tree_tab_open = 0
|
||||
g.nvim_tree_allow_resize = 1
|
||||
g.nvim_tree_add_trailing = 0 -- append a trailing slash to folder names
|
||||
g.nvim_tree_disable_netrw = 1
|
||||
g.nvim_tree_hijack_netrw = 0
|
||||
g.nvim_tree_update_cwd = 1
|
||||
|
||||
g.nvim_tree_show_icons = {
|
||||
git = 1,
|
||||
folders = 1,
|
||||
files = 1,
|
||||
-- folder_arrows= 1
|
||||
}
|
||||
g.nvim_tree_icons = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
folder = {
|
||||
-- disable indent_markers option to get arrows working or if you want both arrows and indent then just add the arrow icons in front ofthe default and opened folders below!
|
||||
-- arrow_open = "",
|
||||
-- arrow_closed = "",
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "", --
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
}
|
||||
|
||||
g.nvim_tree_bindings = {
|
||||
{ key = { "<CR>", "o", "<2-LeftMouse>" }, cb = tree_cb "edit" },
|
||||
{ key = { "<2-RightMouse>", "<C-]>" }, cb = tree_cb "cd" },
|
||||
{ key = "<C-v>", cb = tree_cb "vsplit" },
|
||||
{ key = "<C-x>", cb = tree_cb "split" },
|
||||
{ key = "<C-t>", cb = tree_cb "tabnew" },
|
||||
{ key = "<", cb = tree_cb "prev_sibling" },
|
||||
{ key = ">", cb = tree_cb "next_sibling" },
|
||||
{ key = "P", cb = tree_cb "parent_node" },
|
||||
{ key = "<BS>", cb = tree_cb "close_node" },
|
||||
{ key = "<S-CR>", cb = tree_cb "close_node" },
|
||||
{ key = "<Tab>", cb = tree_cb "preview" },
|
||||
{ key = "K", cb = tree_cb "first_sibling" },
|
||||
{ key = "J", cb = tree_cb "last_sibling" },
|
||||
{ key = "I", cb = tree_cb "toggle_ignored" },
|
||||
{ key = "H", cb = tree_cb "toggle_dotfiles" },
|
||||
{ key = "R", cb = tree_cb "refresh" },
|
||||
{ key = "a", cb = tree_cb "create" },
|
||||
{ key = "d", cb = tree_cb "remove" },
|
||||
{ key = "r", cb = tree_cb "rename" },
|
||||
{ key = "<C->", cb = tree_cb "full_rename" },
|
||||
{ key = "x", cb = tree_cb "cut" },
|
||||
{ key = "c", cb = tree_cb "copy" },
|
||||
{ key = "p", cb = tree_cb "paste" },
|
||||
{ key = "y", cb = tree_cb "copy_name" },
|
||||
{ key = "Y", cb = tree_cb "copy_path" },
|
||||
{ key = "gy", cb = tree_cb "copy_absolute_path" },
|
||||
{ key = "[c", cb = tree_cb "prev_git_item" },
|
||||
{ key = "}c", cb = tree_cb "next_git_item" },
|
||||
{ key = "-", cb = tree_cb "dir_up" },
|
||||
{ key = "q", cb = tree_cb "close" },
|
||||
{ key = "g?", cb = tree_cb "toggle_help" },
|
||||
}
|
||||
71
nvim/lua/plugins/others.lua
Normal file
@@ -0,0 +1,71 @@
|
||||
local M = {}
|
||||
|
||||
M.colorizer = function()
|
||||
local present, colorizer = pcall(require, "colorizer")
|
||||
if present then
|
||||
colorizer.setup()
|
||||
vim.cmd "ColorizerReloadAllBuffers"
|
||||
end
|
||||
end
|
||||
|
||||
M.comment = function()
|
||||
local present, nvim_comment = pcall(require, "nvim_comment")
|
||||
if present then
|
||||
nvim_comment.setup()
|
||||
end
|
||||
end
|
||||
|
||||
M.escape = function()
|
||||
vim.g.better_escape_interval = 300
|
||||
vim.g.better_escape_shortcut = { "jk" }
|
||||
end
|
||||
|
||||
M.lspkind = function()
|
||||
local present, lspkind = pcall(require, "lspkind")
|
||||
if present then
|
||||
lspkind.init()
|
||||
end
|
||||
end
|
||||
|
||||
M.neoscroll = function()
|
||||
pcall(function()
|
||||
require("neoscroll").setup()
|
||||
end)
|
||||
end
|
||||
|
||||
M.blankline = function()
|
||||
vim.g.indentLine_enabled = 1
|
||||
vim.g.indent_blankline_char = "▏"
|
||||
|
||||
vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard", "packer" }
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal" }
|
||||
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = false
|
||||
end
|
||||
|
||||
M.signature = function()
|
||||
local present, lspsignature = pcall(require, "lsp_signature")
|
||||
if present then
|
||||
lspsignature.setup {
|
||||
bind = true,
|
||||
doc_lines = 2,
|
||||
floating_window = true,
|
||||
fix_pos = true,
|
||||
hint_enable = true,
|
||||
hint_prefix = " ",
|
||||
hint_scheme = "String",
|
||||
use_lspsaga = false,
|
||||
hi_parameter = "Search",
|
||||
max_height = 22,
|
||||
max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
||||
handler_opts = {
|
||||
border = "single", -- double, single, shadow, none
|
||||
},
|
||||
zindex = 200, -- by default it will be on top of all floating windows, set to 50 send it to bottom
|
||||
padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
309
nvim/lua/plugins/statusline.lua
Normal file
@@ -0,0 +1,309 @@
|
||||
local global_theme = "themes/" .. require("utils").load_config().ui.theme
|
||||
local colors = require(global_theme)
|
||||
|
||||
local present1, gl = pcall(require, "galaxyline")
|
||||
local present2, condition = pcall(require, "galaxyline.condition")
|
||||
if not (present1 or present2) then
|
||||
return
|
||||
end
|
||||
|
||||
local gls = gl.section
|
||||
|
||||
gl.short_line_list = { " " }
|
||||
|
||||
local icon_styles = {
|
||||
default = {
|
||||
left = "",
|
||||
right = " ",
|
||||
main_icon = " ",
|
||||
vi_mode_icon = " ",
|
||||
position_icon = " ",
|
||||
},
|
||||
|
||||
round = {
|
||||
left = "",
|
||||
right = "",
|
||||
main_icon = " ",
|
||||
vi_mode_icon = " ",
|
||||
position_icon = " ",
|
||||
},
|
||||
|
||||
slant = {
|
||||
left = " ",
|
||||
right = " ",
|
||||
main_icon = " ",
|
||||
vi_mode_icon = " ",
|
||||
position_icon = " ",
|
||||
},
|
||||
|
||||
block = {
|
||||
left = " ",
|
||||
right = " ",
|
||||
main_icon = " ",
|
||||
vi_mode_icon = " ",
|
||||
position_icon = " ",
|
||||
},
|
||||
|
||||
arrow = {
|
||||
left = "",
|
||||
right = "",
|
||||
main_icon = " ",
|
||||
vi_mode_icon = " ",
|
||||
position_icon = " ",
|
||||
},
|
||||
}
|
||||
|
||||
local user_statusline_style = require("utils").load_config().ui.statusline_style
|
||||
local statusline_style = icon_styles[user_statusline_style]
|
||||
|
||||
local left_separator = statusline_style.left
|
||||
local right_separator = statusline_style.right
|
||||
|
||||
gls.left[1] = {
|
||||
FirstElement = {
|
||||
provider = function()
|
||||
return "▋"
|
||||
end,
|
||||
highlight = { colors.nord_blue, colors.nord_blue },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[2] = {
|
||||
statusIcon = {
|
||||
provider = function()
|
||||
return statusline_style.main_icon
|
||||
end,
|
||||
highlight = { colors.statusline_bg, colors.nord_blue },
|
||||
separator = right_separator,
|
||||
separator_highlight = { colors.nord_blue, colors.one_bg2 },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[3] = {
|
||||
left_arow2 = {
|
||||
provider = function() end,
|
||||
separator = right_separator .. " ",
|
||||
separator_highlight = { colors.one_bg2, colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[4] = {
|
||||
FileIcon = {
|
||||
provider = "FileIcon",
|
||||
condition = condition.buffer_not_empty,
|
||||
highlight = { colors.white, colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[5] = {
|
||||
FileName = {
|
||||
provider = function()
|
||||
local fileinfo = require "galaxyline.provider_fileinfo"
|
||||
|
||||
if vim.api.nvim_buf_get_name(0):len() == 0 then
|
||||
return ""
|
||||
end
|
||||
|
||||
return fileinfo.get_current_file_name("", "")
|
||||
end,
|
||||
highlight = { colors.white, colors.lightbg },
|
||||
separator = right_separator,
|
||||
separator_highlight = { colors.lightbg, colors.lightbg2 },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[6] = {
|
||||
current_dir = {
|
||||
provider = function()
|
||||
local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||
return " " .. dir_name .. " "
|
||||
end,
|
||||
highlight = { colors.grey_fg2, colors.lightbg2 },
|
||||
separator = right_separator,
|
||||
separator_highlight = { colors.lightbg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
local checkwidth = function()
|
||||
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||
if squeeze_width > 30 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
gls.left[7] = {
|
||||
DiffAdd = {
|
||||
provider = "DiffAdd",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = { colors.white, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[8] = {
|
||||
DiffModified = {
|
||||
provider = "DiffModified",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[9] = {
|
||||
DiffRemove = {
|
||||
provider = "DiffRemove",
|
||||
condition = checkwidth,
|
||||
icon = " ",
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[10] = {
|
||||
DiagnosticError = {
|
||||
provider = "DiagnosticError",
|
||||
icon = " ",
|
||||
highlight = { colors.red, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[11] = {
|
||||
DiagnosticWarn = {
|
||||
provider = "DiagnosticWarn",
|
||||
icon = " ",
|
||||
highlight = { colors.yellow, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[1] = {
|
||||
lsp_status = {
|
||||
provider = function()
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) ~= nil then
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return " " .. " " .. " LSP"
|
||||
end
|
||||
end
|
||||
return ""
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end,
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[2] = {
|
||||
GitIcon = {
|
||||
provider = function()
|
||||
return " "
|
||||
end,
|
||||
condition = require("galaxyline.condition").check_git_workspace,
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
separator = " ",
|
||||
separator_highlight = { colors.statusline_bg, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[3] = {
|
||||
GitBranch = {
|
||||
provider = "GitBranch",
|
||||
condition = require("galaxyline.condition").check_git_workspace,
|
||||
highlight = { colors.grey_fg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
local mode_colors = {
|
||||
[110] = { "NORMAL", colors.red },
|
||||
[105] = { "INSERT", colors.dark_purple },
|
||||
[99] = { "COMMAND", colors.pink },
|
||||
[116] = { "TERMINAL", colors.green },
|
||||
[118] = { "VISUAL", colors.cyan },
|
||||
[22] = { "V-BLOCK", colors.cyan },
|
||||
[86] = { "V_LINE", colors.cyan },
|
||||
[82] = { "REPLACE", colors.orange },
|
||||
[115] = { "SELECT", colors.nord_blue },
|
||||
[83] = { "S-LINE", colors.nord_blue },
|
||||
}
|
||||
|
||||
local mode = function(n)
|
||||
return mode_colors[vim.fn.mode():byte()][n]
|
||||
end
|
||||
|
||||
gls.right[4] = {
|
||||
left_arrow = {
|
||||
provider = function() end,
|
||||
separator = " " .. left_separator,
|
||||
separator_highlight = { colors.one_bg2, colors.statusline_bg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[5] = {
|
||||
left_round = {
|
||||
provider = function()
|
||||
vim.cmd("hi Galaxyleft_round guifg=" .. mode(2))
|
||||
return left_separator
|
||||
end,
|
||||
highlight = { "GalaxyViMode", colors.one_bg2 },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[6] = {
|
||||
viMode_icon = {
|
||||
provider = function()
|
||||
vim.cmd("hi GalaxyviMode_icon guibg=" .. mode(2))
|
||||
return statusline_style.vi_mode_icon
|
||||
end,
|
||||
highlight = { colors.statusline_bg, colors.red },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[7] = {
|
||||
ViMode = {
|
||||
provider = function()
|
||||
vim.cmd("hi GalaxyViMode guifg=" .. mode(2))
|
||||
return " " .. mode(1) .. " "
|
||||
end,
|
||||
highlight = { "GalaxyViMode", colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[8] = {
|
||||
left_arrow2 = {
|
||||
provider = function() end,
|
||||
separator = left_separator,
|
||||
separator_highlight = { colors.grey, colors.lightbg },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[9] = {
|
||||
some_RoundIcon = {
|
||||
provider = function()
|
||||
return statusline_style.position_icon
|
||||
end,
|
||||
separator = left_separator,
|
||||
separator_highlight = { colors.green, colors.grey },
|
||||
highlight = { colors.lightbg, colors.green },
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[10] = {
|
||||
line_percentage = {
|
||||
provider = function()
|
||||
local current_line = vim.fn.line "."
|
||||
local total_line = vim.fn.line "$"
|
||||
|
||||
if current_line == 1 then
|
||||
return " Top "
|
||||
elseif current_line == vim.fn.line "$" then
|
||||
return " Bot "
|
||||
end
|
||||
local result, _ = math.modf((current_line / total_line) * 100)
|
||||
return " " .. result .. "% "
|
||||
end,
|
||||
highlight = { colors.green, colors.lightbg },
|
||||
},
|
||||
}
|
||||
85
nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
local present, telescope = pcall(require, "telescope")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "descending",
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
results_width = 0.8,
|
||||
},
|
||||
vertical = {
|
||||
mirror = false,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
file_sorter = require("telescope.sorters").get_fuzzy_file,
|
||||
file_ignore_patterns = {},
|
||||
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
||||
path_display = { "absolute" },
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
|
||||
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
|
||||
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = false, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
},
|
||||
media_files = {
|
||||
filetypes = { "png", "webp", "jpg", "jpeg" },
|
||||
find_cmd = "rg", -- find command (defaults to `fd`)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- NvChad pickers
|
||||
-- load the theme_switcher extension
|
||||
require("telescope").load_extension "themes"
|
||||
-- load the term_picker extension
|
||||
require("telescope").load_extension "terms"
|
||||
|
||||
if not pcall(function()
|
||||
telescope.load_extension "fzf"
|
||||
telescope.load_extension "media_files"
|
||||
end) then
|
||||
-- This should only trigger when in need of PackerSync, so better do it
|
||||
print "After completion of PackerCompile, restart neovim."
|
||||
-- Trigger packer compile on PackerComplete, so it properly waits for PackerSync
|
||||
vim.cmd 'autocmd User PackerComplete ++once lua print "Waiting for PackerCompile.." require("packer").compile()'
|
||||
vim.cmd 'autocmd User PackerCompileDone ++once echo "Packer Compile done, restart neovim."'
|
||||
require "pluginList"
|
||||
require("packer").update("telescope-fzf-native.nvim", "telescope-media-files.nvim")
|
||||
end
|
||||
15
nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
local present, ts_config = pcall(require, "nvim-treesitter.configs")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
ts_config.setup {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"lua",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
},
|
||||
}
|
||||
68
nvim/lua/plugins/zenmode.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
local present, true_zen = pcall(require, "true-zen")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
true_zen.setup {
|
||||
ui = {
|
||||
bottom = {
|
||||
laststatus = 0,
|
||||
ruler = false,
|
||||
showmode = false,
|
||||
showcmd = false,
|
||||
cmdheight = 1,
|
||||
},
|
||||
top = {
|
||||
showtabline = 0,
|
||||
},
|
||||
left = {
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "no",
|
||||
},
|
||||
},
|
||||
modes = {
|
||||
ataraxis = {
|
||||
left_padding = 32,
|
||||
right_padding = 32,
|
||||
top_padding = 1,
|
||||
bottom_padding = 1,
|
||||
ideal_writing_area_width = { 0 },
|
||||
auto_padding = true,
|
||||
keep_default_fold_fillchars = true,
|
||||
custome_bg = "",
|
||||
bg_configuration = true,
|
||||
affected_higroups = {
|
||||
NonText = {},
|
||||
FoldColumn = {},
|
||||
ColorColumn = {},
|
||||
VertSplit = {},
|
||||
StatusLine = {},
|
||||
StatusLineNC = {},
|
||||
SignColumn = {},
|
||||
},
|
||||
},
|
||||
focus = {
|
||||
margin_of_error = 5,
|
||||
focus_method = "experimental",
|
||||
},
|
||||
},
|
||||
integrations = {
|
||||
vim_gitgutter = false,
|
||||
galaxyline = true,
|
||||
tmux = false,
|
||||
gitsigns = false,
|
||||
nvim_bufferline = true,
|
||||
limelight = false,
|
||||
vim_airline = false,
|
||||
vim_powerline = false,
|
||||
vim_signify = false,
|
||||
express_line = false,
|
||||
lualine = false,
|
||||
},
|
||||
misc = {
|
||||
on_off_commands = false,
|
||||
ui_elements_commands = false,
|
||||
cursor_by_mode = false,
|
||||
},
|
||||
}
|
||||
143
nvim/lua/telescope/_extensions/terms.lua
Normal file
@@ -0,0 +1,143 @@
|
||||
-- This file can be loaded as a telescope extension
|
||||
local M = {}
|
||||
|
||||
-- Custom theme picker
|
||||
-- Most of the code is copied from telescope buffer builtin
|
||||
-- Src: https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/builtin/internal.lua
|
||||
M.term_picker = function(opts)
|
||||
local pickers, finders, previewers, make_entry, actions, action_state, utils, conf
|
||||
if pcall(require, "telescope") then
|
||||
pickers = require "telescope.pickers"
|
||||
finders = require "telescope.finders"
|
||||
previewers = require "telescope.previewers"
|
||||
|
||||
make_entry = require "telescope.make_entry"
|
||||
actions = require "telescope.actions"
|
||||
action_state = require "telescope.actions.state"
|
||||
utils = require "telescope.utils"
|
||||
conf = require("telescope.config").values
|
||||
else
|
||||
error "Cannot find telescope!"
|
||||
end
|
||||
|
||||
local filter = vim.tbl_filter
|
||||
|
||||
local local_utils = require "utils"
|
||||
|
||||
-- buffer number and name
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||
|
||||
local bufnrs = filter(function(b)
|
||||
local present_type, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(b, "term_type")
|
||||
end)
|
||||
|
||||
if not present_type then
|
||||
-- let's only terms that we created
|
||||
return false
|
||||
end
|
||||
|
||||
-- if 1 ~= vim.fn.buflisted(b) then
|
||||
-- return false
|
||||
-- end
|
||||
-- only hide unloaded buffers if opts.show_all_buffers is false, keep them listed if true or nil
|
||||
if opts.show_all_buffers == false and not vim.api.nvim_buf_is_loaded(b) then
|
||||
return false
|
||||
end
|
||||
if opts.ignore_current_buffer and b == vim.api.nvim_get_current_buf() then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end, vim.api.nvim_list_bufs())
|
||||
if not next(bufnrs) then
|
||||
return
|
||||
end
|
||||
if opts.sort_mru then
|
||||
table.sort(bufnrs, function(a, b)
|
||||
return vim.fn.getbufinfo(a)[1].lastused > vim.fn.getbufinfo(b)[1].lastused
|
||||
end)
|
||||
end
|
||||
|
||||
local buffers = {}
|
||||
local default_selection_idx = 1
|
||||
for _, bufnr in ipairs(bufnrs) do
|
||||
local flag = bufnr == vim.fn.bufnr "" and "%" or (bufnr == vim.fn.bufnr "#" and "#" or " ")
|
||||
|
||||
if opts.sort_lastused and not opts.ignore_current_buffer and flag == "#" then
|
||||
default_selection_idx = 2
|
||||
end
|
||||
|
||||
local element = {
|
||||
bufnr = bufnr,
|
||||
flag = flag,
|
||||
info = vim.fn.getbufinfo(bufnr)[1],
|
||||
}
|
||||
|
||||
if opts.sort_lastused and (flag == "#" or flag == "%") then
|
||||
local idx = ((buffers[1] ~= nil and buffers[1].flag == "%") and 2 or 1)
|
||||
table.insert(buffers, idx, element)
|
||||
else
|
||||
table.insert(buffers, element)
|
||||
end
|
||||
end
|
||||
|
||||
if not opts.bufnr_width then
|
||||
local max_bufnr = math.max(unpack(bufnrs))
|
||||
opts.bufnr_width = #tostring(max_bufnr)
|
||||
end
|
||||
|
||||
pickers.new(opts, {
|
||||
prompt_title = "Terminal buffers",
|
||||
finder = finders.new_table {
|
||||
results = buffers,
|
||||
entry_maker = opts.entry_maker or make_entry.gen_from_buffer(opts),
|
||||
},
|
||||
previewer = conf.grep_previewer(opts),
|
||||
sorter = conf.generic_sorter(opts),
|
||||
default_selection_index = default_selection_idx,
|
||||
attach_mappings = function(prompt_bufnr)
|
||||
actions.select_default:replace(function()
|
||||
local entry = action_state.get_selected_entry()
|
||||
actions.close(prompt_bufnr)
|
||||
|
||||
local buf = entry.bufnr
|
||||
|
||||
local chad_term, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
-- TODO buffer checks/error detection (make sure we do get a buf)
|
||||
|
||||
if chad_term then
|
||||
if type == "wind" then
|
||||
-- swtich to term buff & show in bufferline
|
||||
vim.cmd(string.format("b %d | setlocal bl", buf))
|
||||
-- vim.cmd('startinsert') TODO fix this
|
||||
elseif type == "vert" then
|
||||
vim.cmd(string.format("vsp #%d", buf))
|
||||
-- vim.cmd('startinsert') TODO fix this
|
||||
elseif type == "hori" then
|
||||
-- TODO change 15 to a chad config var number
|
||||
vim.cmd(string.format("15 sp #%d ", buf))
|
||||
-- vim.cmd('startinsert') TODO fix this
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
return true
|
||||
end,
|
||||
}):find()
|
||||
end
|
||||
|
||||
-- register term picker as terms to telescope
|
||||
local present, telescope = pcall(require, "telescope")
|
||||
if present then
|
||||
return telescope.register_extension {
|
||||
exports = {
|
||||
terms = M.term_picker,
|
||||
},
|
||||
}
|
||||
else
|
||||
error "Cannot find telescope!"
|
||||
end
|
||||
142
nvim/lua/telescope/_extensions/themes.lua
Normal file
@@ -0,0 +1,142 @@
|
||||
-- This file can be loaded as a telescope extension
|
||||
local M = {}
|
||||
|
||||
-- Custom theme picker
|
||||
-- Most of the code is copied from telescope colorscheme plugin, mostly for preview creation
|
||||
M.theme_switcher = function(opts)
|
||||
local pickers, finders, previewers, actions, action_state, utils, conf
|
||||
if pcall(require, "telescope") then
|
||||
pickers = require "telescope.pickers"
|
||||
finders = require "telescope.finders"
|
||||
previewers = require "telescope.previewers"
|
||||
|
||||
actions = require "telescope.actions"
|
||||
action_state = require "telescope.actions.state"
|
||||
utils = require "telescope.utils"
|
||||
conf = require("telescope.config").values
|
||||
else
|
||||
error "Cannot find telescope!"
|
||||
end
|
||||
|
||||
local local_utils = require "utils"
|
||||
local reload_theme = local_utils.reload_theme
|
||||
|
||||
-- get a table of available themes
|
||||
local themes = local_utils.list_themes()
|
||||
if next(themes) ~= nil then
|
||||
-- save this to use it for later to restore if theme not changed
|
||||
local current_theme = vim.g.nvchad_theme
|
||||
local new_theme = ""
|
||||
local change = false
|
||||
|
||||
-- buffer number and name
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||
|
||||
local previewer
|
||||
|
||||
-- in case its not a normal buffer
|
||||
if vim.fn.buflisted(bufnr) ~= 1 then
|
||||
local deleted = false
|
||||
local function del_win(win_id)
|
||||
if win_id and vim.api.nvim_win_is_valid(win_id) then
|
||||
utils.buf_delete(vim.api.nvim_win_get_buf(win_id))
|
||||
pcall(vim.api.nvim_win_close, win_id, true)
|
||||
end
|
||||
end
|
||||
|
||||
previewer = previewers.new {
|
||||
preview_fn = function(_, entry, status)
|
||||
if not deleted then
|
||||
deleted = true
|
||||
del_win(status.preview_win)
|
||||
del_win(status.preview_border_win)
|
||||
end
|
||||
reload_theme(entry.value)
|
||||
end,
|
||||
}
|
||||
else
|
||||
-- show current buffer content in previewer
|
||||
previewer = previewers.new_buffer_previewer {
|
||||
get_buffer_by_name = function()
|
||||
return bufname
|
||||
end,
|
||||
define_preview = function(self, entry)
|
||||
if vim.loop.fs_stat(bufname) then
|
||||
conf.buffer_previewer_maker(bufname, self.state.bufnr, { bufname = self.state.bufname })
|
||||
else
|
||||
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
|
||||
vim.api.nvim_buf_set_lines(self.state.bufnr, 0, -1, false, lines)
|
||||
end
|
||||
reload_theme(entry.value)
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local picker = pickers.new {
|
||||
prompt_title = "Set NvChad color",
|
||||
finder = finders.new_table(themes),
|
||||
previewer = previewer,
|
||||
sorter = conf.generic_sorter(opts),
|
||||
attach_mappings = function()
|
||||
actions.select_default:replace(
|
||||
-- if a entry is selected, change current_theme to that
|
||||
function(prompt_bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
new_theme = selection.value
|
||||
change = true
|
||||
actions.close(prompt_bufnr)
|
||||
end
|
||||
)
|
||||
return true
|
||||
end,
|
||||
}
|
||||
|
||||
-- rewrite picker.close_windows
|
||||
local close_windows = picker.close_windows
|
||||
picker.close_windows = function(status)
|
||||
close_windows(status)
|
||||
-- now apply the theme, if success, then ask for default theme change
|
||||
local final_theme
|
||||
if change then
|
||||
final_theme = new_theme
|
||||
else
|
||||
final_theme = current_theme
|
||||
end
|
||||
|
||||
if reload_theme(final_theme) then
|
||||
if change then
|
||||
-- ask for confirmation to set as default theme
|
||||
local ans = string.lower(vim.fn.input("Set " .. new_theme .. " as default theme ? [y/N] ")) == "y"
|
||||
local_utils.clear_cmdline()
|
||||
if ans then
|
||||
local_utils.change_theme(current_theme, final_theme)
|
||||
else
|
||||
-- will be used in restoring nvchad theme var
|
||||
final_theme = current_theme
|
||||
end
|
||||
end
|
||||
else
|
||||
final_theme = current_theme
|
||||
end
|
||||
-- set nvchad_theme global var
|
||||
vim.g.nvchad_theme = final_theme
|
||||
end
|
||||
-- launch the telescope picker
|
||||
picker:find()
|
||||
else
|
||||
print("No themes found in " .. vim.fn.stdpath "config" .. "/lua/themes")
|
||||
end
|
||||
end
|
||||
|
||||
-- register theme swticher as themes to telescope
|
||||
local present, telescope = pcall(require, "telescope")
|
||||
if present then
|
||||
return telescope.register_extension {
|
||||
exports = {
|
||||
themes = M.theme_switcher,
|
||||
},
|
||||
}
|
||||
else
|
||||
error "Cannot find telescope!"
|
||||
end
|
||||
12
nvim/lua/theme.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local chad_theme = require("utils").load_config().ui.theme
|
||||
vim.g.nvchad_theme = chad_theme
|
||||
|
||||
local present, base16 = pcall(require, "base16")
|
||||
|
||||
if present then
|
||||
base16(base16.themes(chad_theme), true)
|
||||
require "highlights"
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
35
nvim/lua/themes/chadracula.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#F8F8F2",
|
||||
darker_black = "#232531",
|
||||
black = "#282A3688", -- nvim bg
|
||||
black2 = "#303341",
|
||||
one_bg = "#373844", -- real bg of onedark
|
||||
one_bg2 = "#44475a",
|
||||
one_bg3 = "#565761",
|
||||
grey = "#41434f",
|
||||
grey_fg = "#5a5c68",
|
||||
grey_fg2 = "#5a5c68",
|
||||
light_grey = "#636571",
|
||||
red = "#E95678",
|
||||
baby_pink = "#DE8C92",
|
||||
pink = "#FF79C6",
|
||||
line = "#373844", -- for lines like vertsplit
|
||||
green = "#69ff94",
|
||||
vibrant_green = "#69FF94",
|
||||
nord_blue = "#b389ef",
|
||||
blue = "#BD93F9",
|
||||
yellow = "#F1FA8C",
|
||||
sun = "#FFFFA5",
|
||||
purple = "#BD93F9",
|
||||
dark_purple = "#BD93F9",
|
||||
teal = "#0088cc",
|
||||
orange = "#FFB86C",
|
||||
cyan = "#8BE9FD",
|
||||
statusline_bg = "#2b2d39",
|
||||
lightbg = "#343642",
|
||||
lightbg2 = "#2f313d",
|
||||
pmenu_bg = "#b389ef",
|
||||
folder_bg = "#BD93F9",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/everforest.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#fff9e8",
|
||||
darker_black = "#272f35",
|
||||
black = "#2b333988", -- nvim bg
|
||||
black2 = "#323a40",
|
||||
one_bg = "#333b41",
|
||||
one_bg2 = "#363e44",
|
||||
one_bg3 = "#3a4248",
|
||||
grey = "#4a5258",
|
||||
grey_fg = "#50585e",
|
||||
grey_fg2 = "#545c62",
|
||||
light_grey = "#586066",
|
||||
red = "#e67e80",
|
||||
baby_pink = "#ce8196",
|
||||
pink = "#ff75a0",
|
||||
line = "#3a4248", -- for lines like vertsplit
|
||||
green = "#83c092",
|
||||
vibrant_green = "#a7c080",
|
||||
nord_blue = "#78b4ac",
|
||||
blue = "#7fbbb3",
|
||||
yellow = "#dbbc7f",
|
||||
sun = "#d1b171",
|
||||
purple = "#b4bbc8",
|
||||
dark_purple = "#d699b6",
|
||||
teal = "#69a59d",
|
||||
orange = "#e69875",
|
||||
cyan = "#95d1c9",
|
||||
statusline_bg = "#2e363c",
|
||||
lightbg = "#3d454b",
|
||||
lightbg2 = "#333b41",
|
||||
pmenu_bg = "#83c092",
|
||||
folder_bg = "#7fbbb3",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/gruvchad.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#c7b89d",
|
||||
darker_black = "#1e2122",
|
||||
black = "#22252688", -- nvim bg
|
||||
black2 = "#26292a",
|
||||
one_bg = "#2b2e2f",
|
||||
one_bg2 = "#2f3233",
|
||||
one_bg3 = "#313435",
|
||||
grey = "#46494a",
|
||||
grey_fg = "#5d6061",
|
||||
grey_fg2 = "#5b5e5f",
|
||||
light_grey = "#585b5c",
|
||||
red = "#ec6b64",
|
||||
baby_pink = "#ce8196",
|
||||
pink = "#ff75a0",
|
||||
line = "#2c2f30", -- for lines like vertsplit
|
||||
green = "#89b482",
|
||||
vibrant_green = "#a9b665",
|
||||
nord_blue = "#6f8faf",
|
||||
blue = "#6d8dad",
|
||||
yellow = "#d6b676",
|
||||
sun = "#d1b171",
|
||||
purple = "#b4bbc8",
|
||||
dark_purple = "#cc7f94",
|
||||
teal = "#749689",
|
||||
orange = "#e78a4e",
|
||||
cyan = "#82b3a8",
|
||||
statusline_bg = "#252829",
|
||||
lightbg = "#2d3139",
|
||||
lightbg2 = "#262a32",
|
||||
pmenu_bg = "#89b482",
|
||||
folder_bg = "#6d8dad",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/javacafe.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#b5bcc9",
|
||||
darker_black = "#10171e",
|
||||
black = "#131a2188", -- nvim bg
|
||||
black2 = "#1a2128",
|
||||
one_bg = "#1e252c",
|
||||
one_bg2 = "#272e35",
|
||||
one_bg3 = "#2a3138",
|
||||
grey = "#363d44",
|
||||
grey_fg = "#4e555c",
|
||||
grey_fg2 = "#51585f",
|
||||
light_grey = "#545b62",
|
||||
red = "#ef8891",
|
||||
baby_pink = "#fca2aa",
|
||||
pink = "#fca2af",
|
||||
line = "#20272e", -- for lines like vertsplit
|
||||
green = "#9ce5c0",
|
||||
vibrant_green = "#a5d4af",
|
||||
blue = "#99aee5",
|
||||
nord_blue = "#9aa8cf",
|
||||
yellow = "#fbdf90",
|
||||
sun = "#fbdf9a",
|
||||
purple = "#d7c1ed",
|
||||
dark_purple = "#ccaced",
|
||||
teal = "#92dbb6",
|
||||
orange = "#EDA685",
|
||||
cyan = "#b5c3ea",
|
||||
statusline_bg = "#181f26",
|
||||
lightbg = "#222930",
|
||||
lightbg2 = "#1d242b",
|
||||
pmenu_bg = "#ef8891",
|
||||
folder_bg = "#99aee5",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/mountain.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#b0b0b0",
|
||||
darker_black = "#171d23",
|
||||
black = "#1a202688", -- nvim bg
|
||||
black2 = "#20262c",
|
||||
one_bg = "#242a30",
|
||||
one_bg2 = "#292f35",
|
||||
one_bg3 = "#2e343a",
|
||||
grey = "#42484e",
|
||||
grey_fg = "#474d53",
|
||||
grey_fg2 = "#50565c",
|
||||
light_grey = "#565c62",
|
||||
red = "#ac8a8c",
|
||||
baby_pink = "#de878f",
|
||||
pink = "#e89199",
|
||||
line = "#2d3339", -- for lines like vertsplit
|
||||
green = "#8aac8b",
|
||||
vibrant_green = "#9ec49f",
|
||||
blue = "#6b8bab",
|
||||
nord_blue = "#7797b7",
|
||||
yellow = "#c4c19e",
|
||||
sun = "#aca98a",
|
||||
purple = "#a39ec4",
|
||||
dark_purple = "#8f8aac",
|
||||
teal = "#7c9cbc",
|
||||
orange = "#e39a83",
|
||||
cyan = "#9aafe6",
|
||||
statusline_bg = "#1e242a",
|
||||
lightbg = "#2d3339",
|
||||
lightbg2 = "#252b31",
|
||||
pmenu_bg = "#8aac8b",
|
||||
folder_bg = "#6b8bab",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/norchad.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#abb2bf",
|
||||
darker_black = "#2a303c",
|
||||
black = "#2E3440", -- nvim bg
|
||||
black2 = "#343a46",
|
||||
one_bg = "#373d49",
|
||||
one_bg2 = "#464c58",
|
||||
one_bg3 = "#494f5b",
|
||||
grey = "#4b515d",
|
||||
grey_fg = "#565c68",
|
||||
grey_fg2 = "#606672",
|
||||
light_grey = "#646a76",
|
||||
red = "#BF616A",
|
||||
baby_pink = "#de878f",
|
||||
pink = "#d57780",
|
||||
line = "#3a404c", -- for lines like vertsplit
|
||||
green = "#A3BE8C",
|
||||
vibrant_green = "#afca98",
|
||||
blue = "#7797b7",
|
||||
nord_blue = "#81A1C1",
|
||||
yellow = "#EBCB8B",
|
||||
sun = "#e1c181",
|
||||
purple = "#aab1be",
|
||||
dark_purple = "#B48EAD",
|
||||
teal = "#6484a4",
|
||||
orange = "#e39a83",
|
||||
cyan = "#9aafe6",
|
||||
statusline_bg = "#333945",
|
||||
lightbg = "#3f4551",
|
||||
lightbg2 = "#393f4b",
|
||||
pmenu_bg = "#A3BE8C",
|
||||
folder_bg = "#7797b7",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/one-light.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#54555b",
|
||||
darker_black = "#f5f5f5",
|
||||
black = "#fafafa", -- nvim bg
|
||||
black2 = "#f1f1f1",
|
||||
one_bg = "#f0f0f0", -- real bg of onedark
|
||||
one_bg2 = "#ececec",
|
||||
one_bg3 = "#e7e7e7",
|
||||
grey = "#cbcbcb",
|
||||
grey_fg = "#c6c6c6",
|
||||
grey_fg2 = "#b7b7b7",
|
||||
light_grey = "#b7b7b7",
|
||||
red = "#e6676e",
|
||||
baby_pink = "#F07178",
|
||||
pink = "#ff75a0",
|
||||
line = "#e9e9e9", -- for lines like vertsplit
|
||||
green = "#7b90c7",
|
||||
vibrant_green = "#7eca9c",
|
||||
nord_blue = "#5e5f65",
|
||||
blue = "#28a2f4",
|
||||
yellow = "#7e7e7e",
|
||||
sun = "#dea95f",
|
||||
purple = "#a28dcd",
|
||||
dark_purple = "#8e79b9",
|
||||
teal = "#519ABA",
|
||||
orange = "#FF6A00",
|
||||
cyan = "#a3b8ef",
|
||||
statusline_bg = "#f0f0f0",
|
||||
lightbg = "#d6d6d6",
|
||||
lightbg2 = "#5e5f65",
|
||||
pmenu_bg = "#5e5f65",
|
||||
folder_bg = "#6C6C6C",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/onedark.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#abb2bf",
|
||||
darker_black = "#1b1f27",
|
||||
black = "#1e222a88", -- nvim bg
|
||||
black2 = "#252931",
|
||||
one_bg = "#282c3488", -- real bg of onedark
|
||||
one_bg2 = "#353b4588",
|
||||
one_bg3 = "#30343c88",
|
||||
grey = "#42464e",
|
||||
grey_fg = "#565c64",
|
||||
grey_fg2 = "#6f737b",
|
||||
light_grey = "#6f737b",
|
||||
red = "#d47d85",
|
||||
baby_pink = "#DE8C92",
|
||||
pink = "#ff75a0",
|
||||
line = "#2a2e36", -- for lines like vertsplit
|
||||
green = "#A3BE8C",
|
||||
vibrant_green = "#7eca9c",
|
||||
nord_blue = "#81A1C1",
|
||||
blue = "#61afef",
|
||||
yellow = "#e7c787",
|
||||
sun = "#EBCB8B",
|
||||
purple = "#b4bbc8",
|
||||
dark_purple = "#c882e7",
|
||||
teal = "#519ABA",
|
||||
orange = "#fca2aa",
|
||||
cyan = "#a3b8ef",
|
||||
statusline_bg = "#22262e",
|
||||
lightbg = "#2d3139",
|
||||
lightbg2 = "#262a32",
|
||||
pmenu_bg = "#A3BE8C",
|
||||
folder_bg = "#61afef",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/tokyonight.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#c0caf5",
|
||||
darker_black = "#151621",
|
||||
black = "#17182388", -- nvim bg
|
||||
black2 = "#20212c",
|
||||
one_bg = "#242530",
|
||||
one_bg2 = "#292a35",
|
||||
one_bg3 = "#353b45",
|
||||
grey = "#40486a",
|
||||
grey_fg = "#4a5274",
|
||||
grey_fg2 = "#4f5779",
|
||||
light_grey = "#545c7e",
|
||||
red = "#f7768e",
|
||||
baby_pink = "#DE8C92",
|
||||
pink = "#ff75a0",
|
||||
line = "#242530", -- for lines like vertsplit
|
||||
green = "#9ece6a",
|
||||
vibrant_green = "#73daca",
|
||||
nord_blue = "#80a8fd",
|
||||
blue = "#7aa2f7",
|
||||
yellow = "#e7c787",
|
||||
sun = "#EBCB8B",
|
||||
purple = "#bb9af7",
|
||||
dark_purple = "#9d7cd8",
|
||||
teal = "#0db9d7",
|
||||
orange = "#ff9e64",
|
||||
cyan = "#7dcfff",
|
||||
statusline_bg = "#1d1e29",
|
||||
lightbg = "#252631",
|
||||
lightbg2 = "#22232e",
|
||||
pmenu_bg = "#7aa2f7",
|
||||
folder_bg = "#7aa2f7",
|
||||
}
|
||||
|
||||
return colors
|
||||
35
nvim/lua/themes/tomorrow-night.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local colors = {
|
||||
white = "#C5C8C2",
|
||||
darker_black = "#191b1d",
|
||||
black = "#1d1f2188", -- nvim bg
|
||||
black2 = "#232527",
|
||||
one_bg = "#363a41",
|
||||
one_bg2 = "#353b45",
|
||||
one_bg3 = "#30343c",
|
||||
grey = "#434547",
|
||||
grey_fg = "#545B68",
|
||||
grey_fg2 = "#616875",
|
||||
light_grey = "#676e7b",
|
||||
red = "#cc6666",
|
||||
baby_pink = "#FF6E79",
|
||||
pink = "#ff9ca3",
|
||||
line = "#27292b", -- for lines like vertsplit
|
||||
green = "#a4b595",
|
||||
vibrant_green = "#a3b991",
|
||||
nord_blue = "#728da8",
|
||||
blue = "#6f8dab",
|
||||
yellow = "#d7bd8d",
|
||||
sun = "#e4c180",
|
||||
purple = "#b4bbc8",
|
||||
dark_purple = "#b290ac",
|
||||
teal = "#8abdb6",
|
||||
orange = "#DE935F",
|
||||
cyan = "#70c0b1",
|
||||
statusline_bg = "#212326",
|
||||
lightbg = "#373B41",
|
||||
lightbg2 = "#2D3035",
|
||||
pmenu_bg = "#a4b595",
|
||||
folder_bg = "#6f8dab",
|
||||
}
|
||||
|
||||
return colors
|
||||
500
nvim/lua/utils.lua
Normal file
@@ -0,0 +1,500 @@
|
||||
local M = {}
|
||||
|
||||
-- 1st arg as current theme, 2nd as new theme
|
||||
M.change_theme = function(current_theme, new_theme)
|
||||
if current_theme == nil or new_theme == nil then
|
||||
print "Error: Provide current and new theme name"
|
||||
return false
|
||||
end
|
||||
if current_theme == new_theme then
|
||||
return
|
||||
end
|
||||
|
||||
local user_config = vim.g.nvchad_user_config
|
||||
local file = vim.fn.stdpath "config" .. "/lua/" .. user_config .. ".lua"
|
||||
-- store in data variable
|
||||
local data = assert(M.file("r", file))
|
||||
-- escape characters which can be parsed as magic chars
|
||||
current_theme = current_theme:gsub("%p", "%%%0")
|
||||
new_theme = new_theme:gsub("%p", "%%%0")
|
||||
local find = "theme = .?" .. current_theme .. ".?"
|
||||
local replace = 'theme = "' .. new_theme .. '"'
|
||||
local content = string.gsub(data, find, replace)
|
||||
-- see if the find string exists in file
|
||||
if content == data then
|
||||
print("Error: Cannot change default theme with " .. new_theme .. ", edit " .. file .. " manually")
|
||||
return false
|
||||
else
|
||||
assert(M.file("w", file, content))
|
||||
end
|
||||
end
|
||||
|
||||
M.clear_cmdline = function()
|
||||
vim.defer_fn(function()
|
||||
vim.cmd "echo"
|
||||
end, 0)
|
||||
end
|
||||
|
||||
M.close_buffer = function(bufexpr, force)
|
||||
-- This is a modification of a NeoVim plugin from
|
||||
-- Author: ojroques - Olivier Roques
|
||||
-- Src: https://github.com/ojroques/nvim-bufdel
|
||||
-- (Author has okayed copy-paste)
|
||||
|
||||
-- Options
|
||||
local opts = {
|
||||
next = "cycle", -- how to retrieve the next buffer
|
||||
quit = false, -- exit when last buffer is deleted
|
||||
--TODO make this a chadrc flag/option
|
||||
}
|
||||
|
||||
-- ----------------
|
||||
-- Helper functions
|
||||
-- ----------------
|
||||
|
||||
-- Switch to buffer 'buf' on each window from list 'windows'
|
||||
local function switch_buffer(windows, buf)
|
||||
local cur_win = vim.fn.winnr()
|
||||
for _, winid in ipairs(windows) do
|
||||
vim.cmd(string.format("%d wincmd w", vim.fn.win_id2win(winid)))
|
||||
vim.cmd(string.format("buffer %d", buf))
|
||||
end
|
||||
vim.cmd(string.format("%d wincmd w", cur_win)) -- return to original window
|
||||
end
|
||||
|
||||
-- Select the first buffer with a number greater than given buffer
|
||||
local function get_next_buf(buf)
|
||||
local next = vim.fn.bufnr "#"
|
||||
if opts.next == "alternate" and vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
for i = 0, vim.fn.bufnr "$" - 1 do
|
||||
next = (buf + i) % vim.fn.bufnr "$" + 1 -- will loop back to 1
|
||||
if vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ----------------
|
||||
-- End helper functions
|
||||
-- ----------------
|
||||
|
||||
local buf = vim.fn.bufnr()
|
||||
if vim.fn.buflisted(buf) == 0 then -- exit if buffer number is invalid
|
||||
return
|
||||
end
|
||||
|
||||
if #vim.fn.getbufinfo { buflisted = 1 } < 2 then
|
||||
if opts.quit then
|
||||
-- exit when there is only one buffer left
|
||||
if force then
|
||||
vim.cmd "qall!"
|
||||
else
|
||||
vim.cmd "confirm qall"
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local chad_term, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
if chad_term then
|
||||
-- Must be a window type
|
||||
vim.cmd(string.format("setlocal nobl", buf))
|
||||
vim.cmd "enew"
|
||||
return
|
||||
end
|
||||
-- don't exit and create a new empty buffer
|
||||
vim.cmd "enew"
|
||||
vim.cmd "bp"
|
||||
end
|
||||
|
||||
local next_buf = get_next_buf(buf)
|
||||
local windows = vim.fn.getbufinfo(buf)[1].windows
|
||||
|
||||
-- force deletion of terminal buffers to avoid the prompt
|
||||
if force or vim.fn.getbufvar(buf, "&buftype") == "terminal" then
|
||||
local chad_term, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
-- TODO this scope is error prone, make resilient
|
||||
if chad_term then
|
||||
if type == "wind" then
|
||||
-- hide from bufferline
|
||||
vim.cmd(string.format("%d bufdo setlocal nobl", buf))
|
||||
-- swtich to another buff
|
||||
-- TODO switch to next bufffer, this works too
|
||||
vim.cmd "BufferLineCycleNext"
|
||||
else
|
||||
local cur_win = vim.fn.winnr()
|
||||
-- we can close this window
|
||||
vim.cmd(string.format("%d wincmd c", cur_win))
|
||||
return
|
||||
end
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("bd! %d", buf))
|
||||
end
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("silent! confirm bd %d", buf))
|
||||
end
|
||||
-- revert buffer switches if user has canceled deletion
|
||||
if vim.fn.buflisted(buf) == 1 then
|
||||
switch_buffer(windows, buf)
|
||||
end
|
||||
end
|
||||
|
||||
-- wrapper to use vim.api.nvim_echo
|
||||
-- table of {string, highlight}
|
||||
-- e.g echo({{"Hello", "Title"}, {"World"}})
|
||||
M.echo = function(opts)
|
||||
if opts == nil or type(opts) ~= "table" then
|
||||
return
|
||||
end
|
||||
vim.api.nvim_echo(opts, false, {})
|
||||
end
|
||||
|
||||
-- 1st arg - r or w
|
||||
-- 2nd arg - file path
|
||||
-- 3rd arg - content if 1st arg is w
|
||||
-- return file data on read, nothing on write
|
||||
M.file = function(mode, filepath, content)
|
||||
local data
|
||||
local fd = assert(vim.loop.fs_open(filepath, mode, 438))
|
||||
local stat = assert(vim.loop.fs_fstat(fd))
|
||||
if stat.type ~= "file" then
|
||||
data = false
|
||||
else
|
||||
if mode == "r" then
|
||||
data = assert(vim.loop.fs_read(fd, stat.size, 0))
|
||||
else
|
||||
assert(vim.loop.fs_write(fd, content, 0))
|
||||
data = true
|
||||
end
|
||||
end
|
||||
assert(vim.loop.fs_close(fd))
|
||||
return data
|
||||
end
|
||||
|
||||
-- return a table of available themes
|
||||
M.list_themes = function(return_type)
|
||||
local themes = {}
|
||||
-- folder where theme files are stored
|
||||
local themes_folder = vim.fn.stdpath "config" .. "/lua/themes"
|
||||
-- list all the contents of the folder and filter out files with .lua extension, then append to themes table
|
||||
local fd = vim.loop.fs_scandir(themes_folder)
|
||||
if fd then
|
||||
while true do
|
||||
local name, typ = vim.loop.fs_scandir_next(fd)
|
||||
if name == nil then
|
||||
break
|
||||
end
|
||||
if typ ~= "directory" and string.find(name, ".lua") then
|
||||
-- return the table values as keys if specified
|
||||
if return_type == "keys_as_value" then
|
||||
themes[vim.fn.fnamemodify(name, ":r")] = true
|
||||
else
|
||||
table.insert(themes, vim.fn.fnamemodify(name, ":r"))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return themes
|
||||
end
|
||||
|
||||
-- Base code: https://gist.github.com/revolucas/184aec7998a6be5d2f61b984fac1d7f7
|
||||
-- Changes over it: preserving table 1 contents and also update with table b, without duplicating
|
||||
-- 1st arg - base table, 2nd arg - table to merge
|
||||
M.merge_table = function(into, from)
|
||||
-- make sure both are table
|
||||
if type(into) ~= "table" or type(from) ~= "table" then
|
||||
return into
|
||||
end
|
||||
local stack, seen = {}, {}
|
||||
local table1, table2 = into, from
|
||||
while true do
|
||||
for k, v in pairs(table2) do
|
||||
if type(v) == "table" and type(table1[k]) == "table" then
|
||||
table.insert(stack, { table1[k], table2[k] })
|
||||
else
|
||||
local present = seen[v] or false
|
||||
if not present then
|
||||
if type(k) == "number" then
|
||||
-- add the value to seen table until value is found
|
||||
-- only do when key is number we just want to append to subtables
|
||||
-- todo: maybe improve this
|
||||
|
||||
for _, value in pairs(table1) do
|
||||
if value == v then
|
||||
present = true
|
||||
break
|
||||
end
|
||||
end
|
||||
seen[v] = true
|
||||
if not present then
|
||||
table1[#table1 + 1] = v
|
||||
end
|
||||
else
|
||||
table1[k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #stack > 0 then
|
||||
local t = stack[#stack]
|
||||
table1, table2 = t[1], t[2]
|
||||
stack[#stack] = nil
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
return into
|
||||
end
|
||||
|
||||
-- load config
|
||||
-- 1st arg = boolean - whether to force reload
|
||||
-- Modifies _G._NVCHAD_CONFIG global variable
|
||||
M.load_config = function(reload)
|
||||
-- only do the stuff below one time, otherwise just return the set config
|
||||
if _G._NVCHAD_CONFIG_CONTENTS ~= nil and not (reload or false) then
|
||||
return _G._NVCHAD_CONFIG_CONTENTS
|
||||
end
|
||||
|
||||
-- don't enclose in pcall, it better break when default config is faulty
|
||||
_G._NVCHAD_CONFIG_CONTENTS = require "default_config"
|
||||
|
||||
-- user config is not required to run nvchad but a optional
|
||||
-- Make sure the config doesn't break the whole system if user config is not present or in bad state or not a table
|
||||
-- print warning texts if user config file is present
|
||||
local config_name = vim.g.nvchad_user_config or "chadrc"
|
||||
local config_file = vim.fn.stdpath "config" .. "/lua/" .. config_name .. ".lua"
|
||||
-- check if the user config is present
|
||||
if vim.fn.empty(vim.fn.glob(config_file)) < 1 then
|
||||
local present, config = pcall(require, config_name)
|
||||
if present then
|
||||
-- make sure the returned value is table
|
||||
if type(config) == "table" then
|
||||
-- data = require(config_name)
|
||||
_G._NVCHAD_CONFIG_CONTENTS = require("utils").merge_table(_G._NVCHAD_CONFIG_CONTENTS, config)
|
||||
else
|
||||
print("Warning: " .. config_name .. " sourced successfully but did not return a lua table.")
|
||||
end
|
||||
else
|
||||
print("Warning: " .. config_file .. " is present but sourcing failed.")
|
||||
end
|
||||
end
|
||||
return _G._NVCHAD_CONFIG_CONTENTS
|
||||
end
|
||||
|
||||
-- reload a plugin ( will try to load even if not loaded)
|
||||
-- can take a string or list ( table )
|
||||
-- return true or false
|
||||
M.reload_plugin = function(plugins)
|
||||
local status = true
|
||||
local function _reload_plugin(plugin)
|
||||
local loaded = package.loaded[plugin]
|
||||
if loaded then
|
||||
package.loaded[plugin] = nil
|
||||
end
|
||||
if not pcall(require, plugin) then
|
||||
print("Error: Cannot load " .. plugin .. " plugin!")
|
||||
status = false
|
||||
end
|
||||
end
|
||||
|
||||
if type(plugins) == "string" then
|
||||
_reload_plugin(plugins)
|
||||
elseif type(plugins) == "table" then
|
||||
for _, plugin in ipairs(plugins) do
|
||||
_reload_plugin(plugin)
|
||||
end
|
||||
end
|
||||
return status
|
||||
end
|
||||
|
||||
-- reload themes without restarting vim
|
||||
-- if no theme name given then reload the current theme
|
||||
M.reload_theme = function(theme_name)
|
||||
local reload_plugin = require("utils").reload_plugin
|
||||
|
||||
-- if theme name is empty or nil, then reload the current theme
|
||||
if theme_name == nil or theme_name == "" then
|
||||
theme_name = vim.g.nvchad_theme
|
||||
end
|
||||
|
||||
if not pcall(require, "themes/" .. theme_name) then
|
||||
print("No such theme ( " .. theme_name .. " )")
|
||||
return false
|
||||
end
|
||||
|
||||
vim.g.nvchad_theme = theme_name
|
||||
|
||||
-- reload the base16 theme
|
||||
local ok, base16 = pcall(require, "base16")
|
||||
if not ok then
|
||||
print "Error: Cannot load base16 plugin!"
|
||||
return false
|
||||
end
|
||||
base16(base16.themes(theme_name), true)
|
||||
|
||||
if
|
||||
not reload_plugin {
|
||||
"highlights",
|
||||
"plugins.bufferline",
|
||||
"galaxyline",
|
||||
"plugins.statusline",
|
||||
}
|
||||
then
|
||||
print "Error: Not able to reload all plugins."
|
||||
return false
|
||||
end
|
||||
|
||||
-- yes, this is very hacky, but due to new_async in
|
||||
-- https://github.com/glepnir/galaxyline.nvim/blob/main/lua/galaxyline/provider.lua#L5-L36
|
||||
-- it doesn't work properly and some statusline stuff dissapears
|
||||
local vcs = require "galaxyline.provider_vcs"
|
||||
local fileinfo = require "galaxyline.provider_fileinfo"
|
||||
local buffer = require "galaxyline.provider_buffer"
|
||||
local extension = require "galaxyline.provider_extensions"
|
||||
local whitespace = require "galaxyline.provider_whitespace"
|
||||
local lspclient = require "galaxyline.provider_lsp"
|
||||
_G.galaxyline_providers = {
|
||||
BufferIcon = buffer.get_buffer_type_icon,
|
||||
BufferNumber = buffer.get_buffer_number,
|
||||
FileTypeName = buffer.get_buffer_filetype,
|
||||
GitBranch = vcs.get_git_branch,
|
||||
DiffAdd = vcs.diff_add,
|
||||
DiffModified = vcs.diff_modified,
|
||||
DiffRemove = vcs.diff_remove,
|
||||
LineColumn = fileinfo.line_column,
|
||||
FileFormat = fileinfo.get_file_format,
|
||||
FileEncode = fileinfo.get_file_encode,
|
||||
FileSize = fileinfo.get_file_size,
|
||||
FileIcon = fileinfo.get_file_icon,
|
||||
FileName = fileinfo.get_current_file_name,
|
||||
SFileName = fileinfo.filename_in_special_buffer,
|
||||
LinePercent = fileinfo.current_line_percent,
|
||||
ScrollBar = extension.scrollbar_instance,
|
||||
VistaPlugin = extension.vista_nearest,
|
||||
WhiteSpace = whitespace.get_item,
|
||||
GetLspClient = lspclient.get_lsp_client,
|
||||
}
|
||||
local diagnostic = require "galaxyline.provider_diagnostic"
|
||||
_G.galaxyline_providers.DiagnosticError = diagnostic.get_diagnostic_error
|
||||
_G.galaxyline_providers.DiagnosticWarn = diagnostic.get_diagnostic_warn
|
||||
_G.galaxyline_providers.DiagnosticHint = diagnostic.get_diagnostic_hint
|
||||
_G.galaxyline_providers.DiagnosticInfo = diagnostic.get_diagnostic_info
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- toggle between 2 themes
|
||||
-- argument should be a table with 2 theme names
|
||||
M.toggle_theme = function(themes)
|
||||
local current_theme = vim.g.current_nvchad_theme or vim.g.nvchad_theme
|
||||
for _, name in ipairs(themes) do
|
||||
if name ~= current_theme then
|
||||
if require("utils").reload_theme(name) then
|
||||
-- open a buffer and close it to reload the statusline
|
||||
vim.cmd "new|bwipeout"
|
||||
vim.g.current_nvchad_theme = name
|
||||
if M.change_theme(vim.g.nvchad_theme, name) then
|
||||
vim.g.nvchad_theme = name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- update nvchad
|
||||
M.update_nvchad = function()
|
||||
-- in all the comments below, config means user config
|
||||
local config_path = vim.fn.stdpath "config"
|
||||
local config_name = vim.g.nvchad_user_config or "chadrc"
|
||||
local config_file = config_path .. "/lua/" .. config_name .. ".lua"
|
||||
-- generate a random file name
|
||||
local config_file_backup = config_path .. "/" .. config_name .. ".lua.bak." .. math.random()
|
||||
local utils = require "utils"
|
||||
local echo = utils.echo
|
||||
local current_config = utils.load_config()
|
||||
local update_url = current_config.options.update_url or "https://github.com/NvChad/NvChad"
|
||||
local update_branch = current_config.options.update_branch or "main"
|
||||
|
||||
-- ask the user for confirmation to update because we are going to run git reset --hard
|
||||
echo { { "Url: ", "Title" }, { update_url } }
|
||||
echo { { "Branch: ", "Title" }, { update_branch } }
|
||||
echo {
|
||||
{ "\nUpdater will run", "WarningMsg" },
|
||||
{ " git reset --hard " },
|
||||
{
|
||||
"in config folder, so changes to existing repo files except ",
|
||||
"WarningMsg",
|
||||
},
|
||||
|
||||
{ config_name },
|
||||
{ " will be lost!\n\nUpdate NvChad ? [y/N]", "WarningMsg" },
|
||||
}
|
||||
|
||||
local ans = string.lower(vim.fn.input "-> ") == "y"
|
||||
utils.clear_cmdline()
|
||||
if not ans then
|
||||
echo { { "Update cancelled!", "Title" } }
|
||||
return
|
||||
end
|
||||
|
||||
-- first try to fetch contents of config, this will make sure it is readable and taking backup of its contents
|
||||
local config_contents = utils.file("r", config_file)
|
||||
-- also make a local backup in ~/.config/nvim, will be removed when config is succesfully restored
|
||||
utils.file("w", config_file_backup, config_contents)
|
||||
-- write original config file with its contents, will make sure charc is writable, this maybe overkill but a little precaution always helps
|
||||
utils.file("w", config_file, config_contents)
|
||||
|
||||
-- function that will executed when git commands are done
|
||||
local function update_exit(_, code)
|
||||
-- restore config file irrespective of whether git commands were succesfull or not
|
||||
if pcall(function()
|
||||
utils.file("w", config_file, config_contents)
|
||||
end) then
|
||||
-- config restored succesfully, remove backup file that was created
|
||||
if not pcall(os.remove, config_file_backup) then
|
||||
echo { { "Warning: Failed to remove backup chadrc, remove manually.", "WarningMsg" } }
|
||||
echo { { "Path: ", "WarningMsg" }, { config_file_backup } }
|
||||
end
|
||||
else
|
||||
echo { { "Error: Restoring " .. config_name .. " failed.\n", "ErrorMsg" } }
|
||||
echo { { "Backed up " .. config_name .. " path: " .. config_file_backup .. "\n\n", "None" } }
|
||||
end
|
||||
|
||||
-- close the terminal buffer only if update was success, as in case of error, we need the error message
|
||||
if code == 0 then
|
||||
vim.cmd "bd!"
|
||||
echo { { "NvChad succesfully updated.\n", "String" } }
|
||||
else
|
||||
echo { { "Error: NvChad Update failed.\n", "ErrorMsg" } }
|
||||
end
|
||||
end
|
||||
|
||||
-- git commands that will executed, reset in case config was modfied
|
||||
-- use --ff-only to not mess up if the local repo is outdated
|
||||
local update_script = table.concat({
|
||||
"git reset --hard && git pull --set-upstream",
|
||||
update_url,
|
||||
update_branch,
|
||||
"--ff-only",
|
||||
}, " ")
|
||||
|
||||
-- open a new buffer
|
||||
vim.cmd "new"
|
||||
-- finally open the pseudo terminal buffer
|
||||
vim.fn.termopen(update_script, {
|
||||
-- change dir to config path so we don't need to move in script
|
||||
cwd = config_path,
|
||||
on_exit = update_exit,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
458
nvim/plugin/packer_compiled.lua
Normal file
@@ -0,0 +1,458 @@
|
||||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/home/crylia/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/crylia/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/crylia/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/crylia/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/crylia/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
["AutoSave.nvim"] = {
|
||||
cond = { "\27LJ\2\n;\0\0\1\0\3\0\t6\0\0\0009\0\1\0009\0\2\0\n\0\2\0X\0\2€+\0\1\0X\1\1€+\0\2\0L\0\2\0\14auto_save\6g\bvim\0" },
|
||||
config = { "\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins.autosave\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = true,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/AutoSave.nvim",
|
||||
url = "https://github.com/Pocco81/AutoSave.nvim"
|
||||
},
|
||||
LuaSnip = {
|
||||
config = { "\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20plugins.luasnip\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip",
|
||||
wants = { "friendly-snippets" }
|
||||
},
|
||||
["TrueZen.nvim"] = {
|
||||
commands = { "TZAtaraxis", "TZMinimalist", "TZFocus" },
|
||||
config = { "\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20plugins.zenmode\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/TrueZen.nvim",
|
||||
url = "https://github.com/Pocco81/TrueZen.nvim"
|
||||
},
|
||||
["better-escape.vim"] = {
|
||||
config = { "\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vescape\19plugins.others\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/better-escape.vim",
|
||||
url = "https://github.com/jdhao/better-escape.vim"
|
||||
},
|
||||
["cheatsheet.nvim"] = {
|
||||
config = { "\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins.chadsheet\frequire\0" },
|
||||
load_after = {
|
||||
["telescope.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/cheatsheet.nvim",
|
||||
url = "https://github.com/sudormrfbin/cheatsheet.nvim"
|
||||
},
|
||||
["dashboard-nvim"] = {
|
||||
commands = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks", "SessionLoad", "SessionSave" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/dashboard-nvim",
|
||||
url = "https://github.com/glepnir/dashboard-nvim"
|
||||
},
|
||||
["friendly-snippets"] = {
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/friendly-snippets",
|
||||
url = "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
["galaxyline.nvim"] = {
|
||||
after = { "nvim-bufferline.lua" },
|
||||
config = { "\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins.statusline\frequire\0" },
|
||||
load_after = {
|
||||
["nvim-web-devicons"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/galaxyline.nvim",
|
||||
url = "https://github.com/glepnir/galaxyline.nvim"
|
||||
},
|
||||
["gitsigns.nvim"] = {
|
||||
config = { "\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins.gitsigns\frequire\0" },
|
||||
load_after = {
|
||||
["plenary.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim",
|
||||
url = "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
["indent-blankline.nvim"] = {
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim",
|
||||
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
||||
},
|
||||
["lsp_signature.nvim"] = {
|
||||
config = { "\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14signature\19plugins.others\frequire\0" },
|
||||
load_after = {
|
||||
["nvim-lspconfig"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/lsp_signature.nvim",
|
||||
url = "https://github.com/ray-x/lsp_signature.nvim"
|
||||
},
|
||||
["lspkind-nvim"] = {
|
||||
config = { "\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\flspkind\19plugins.others\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/lspkind-nvim",
|
||||
url = "https://github.com/onsails/lspkind-nvim"
|
||||
},
|
||||
neoformat = {
|
||||
commands = { "Neoformat" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/neoformat",
|
||||
url = "https://github.com/sbdchd/neoformat"
|
||||
},
|
||||
["neoscroll.nvim"] = {
|
||||
config = { "\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14neoscroll\19plugins.others\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/neoscroll.nvim",
|
||||
url = "https://github.com/karb94/neoscroll.nvim"
|
||||
},
|
||||
["nvim-autopairs"] = {
|
||||
config = { "\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins.autopairs\frequire\0" },
|
||||
load_after = {
|
||||
["nvim-compe"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-autopairs",
|
||||
url = "https://github.com/windwp/nvim-autopairs"
|
||||
},
|
||||
["nvim-base16.lua"] = {
|
||||
after = { "nvim-web-devicons" },
|
||||
config = { "\27LJ\2\n%\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\ntheme\frequire\0" },
|
||||
load_after = {
|
||||
["packer.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-base16.lua",
|
||||
url = "https://github.com/NvChad/nvim-base16.lua"
|
||||
},
|
||||
["nvim-bufferline.lua"] = {
|
||||
after = { "plenary.nvim" },
|
||||
config = { "\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins.bufferline\frequire\0" },
|
||||
load_after = {
|
||||
["galaxyline.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-bufferline.lua",
|
||||
url = "https://github.com/akinsho/nvim-bufferline.lua"
|
||||
},
|
||||
["nvim-colorizer.lua"] = {
|
||||
config = { "\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14colorizer\19plugins.others\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-colorizer.lua",
|
||||
url = "https://github.com/norcalli/nvim-colorizer.lua"
|
||||
},
|
||||
["nvim-comment"] = {
|
||||
commands = { "CommentToggle" },
|
||||
config = { "\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\fcomment\19plugins.others\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-comment",
|
||||
url = "https://github.com/terrortylor/nvim-comment"
|
||||
},
|
||||
["nvim-compe"] = {
|
||||
after = { "nvim-autopairs" },
|
||||
after_files = { "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-compe/after/plugin/compe.vim" },
|
||||
config = { "\27LJ\2\n-\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\18plugins.compe\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-compe",
|
||||
url = "https://github.com/hrsh7th/nvim-compe",
|
||||
wants = { "LuaSnip" }
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
after = { "lsp_signature.nvim" },
|
||||
config = { "\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins.lspconfig\frequire\0" },
|
||||
load_after = {
|
||||
["nvim-lspinstall"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-lspinstall"] = {
|
||||
after = { "nvim-lspconfig" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-lspinstall",
|
||||
url = "https://github.com/kabouzeid/nvim-lspinstall"
|
||||
},
|
||||
["nvim-tree.lua"] = {
|
||||
commands = { "NvimTreeToggle" },
|
||||
config = { "\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins.nvimtree\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua",
|
||||
url = "https://github.com/kyazdani42/nvim-tree.lua"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
config = { "\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins.treesitter\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
after = { "galaxyline.nvim" },
|
||||
config = { "\27LJ\2\n-\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\18plugins.icons\frequire\0" },
|
||||
load_after = {
|
||||
["nvim-base16.lua"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons",
|
||||
url = "https://github.com/kyazdani42/nvim-web-devicons"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
after = { "nvim-base16.lua" },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
["plenary.nvim"] = {
|
||||
after = { "popup.nvim", "telescope.nvim", "gitsigns.nvim" },
|
||||
load_after = {
|
||||
["nvim-bufferline.lua"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["popup.nvim"] = {
|
||||
load_after = {
|
||||
["plenary.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/popup.nvim",
|
||||
url = "https://github.com/nvim-lua/popup.nvim"
|
||||
},
|
||||
["telescope-fzf-native.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
["telescope-media-files.nvim"] = {
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/telescope-media-files.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope-media-files.nvim"
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
after = { "cheatsheet.nvim" },
|
||||
config = { "\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins.telescope\frequire\0" },
|
||||
load_after = {
|
||||
["plenary.nvim"] = true
|
||||
},
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
["vim-fugitive"] = {
|
||||
commands = { "Git" },
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/vim-fugitive",
|
||||
url = "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
["vim-matchup"] = {
|
||||
after_files = { "/home/crylia/.local/share/nvim/site/pack/packer/opt/vim-matchup/after/plugin/matchit.vim" },
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
only_cond = false,
|
||||
path = "/home/crylia/.local/share/nvim/site/pack/packer/opt/vim-matchup",
|
||||
url = "https://github.com/andymass/vim-matchup"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Setup for: telescope.nvim
|
||||
time([[Setup for telescope.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14telescope\rmappings\frequire\0", "setup", "telescope.nvim")
|
||||
time([[Setup for telescope.nvim]], false)
|
||||
-- Setup for: indent-blankline.nvim
|
||||
time([[Setup for indent-blankline.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14blankline\19plugins.others\frequire\0", "setup", "indent-blankline.nvim")
|
||||
time([[Setup for indent-blankline.nvim]], false)
|
||||
-- Setup for: neoformat
|
||||
time([[Setup for neoformat]], true)
|
||||
try_loadstring("\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14neoformat\rmappings\frequire\0", "setup", "neoformat")
|
||||
time([[Setup for neoformat]], false)
|
||||
-- Setup for: telescope-media-files.nvim
|
||||
time([[Setup for telescope-media-files.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\20telescope_media\rmappings\frequire\0", "setup", "telescope-media-files.nvim")
|
||||
time([[Setup for telescope-media-files.nvim]], false)
|
||||
time([[packadd for telescope-media-files.nvim]], true)
|
||||
vim.cmd [[packadd telescope-media-files.nvim]]
|
||||
time([[packadd for telescope-media-files.nvim]], false)
|
||||
-- Setup for: vim-fugitive
|
||||
time([[Setup for vim-fugitive]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rfugitive\rmappings\frequire\0", "setup", "vim-fugitive")
|
||||
time([[Setup for vim-fugitive]], false)
|
||||
-- Setup for: nvim-tree.lua
|
||||
time([[Setup for nvim-tree.lua]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rnvimtree\rmappings\frequire\0", "setup", "nvim-tree.lua")
|
||||
time([[Setup for nvim-tree.lua]], false)
|
||||
-- Setup for: nvim-bufferline.lua
|
||||
time([[Setup for nvim-bufferline.lua]], true)
|
||||
try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\15bufferline\rmappings\frequire\0", "setup", "nvim-bufferline.lua")
|
||||
time([[Setup for nvim-bufferline.lua]], false)
|
||||
-- Setup for: dashboard-nvim
|
||||
time([[Setup for dashboard-nvim]], true)
|
||||
try_loadstring("\27LJ\2\nX\0\0\3\0\4\0\t6\0\0\0'\2\1\0B\0\2\0016\0\0\0'\2\2\0B\0\2\0029\0\3\0B\0\1\1K\0\1\0\14dashboard\rmappings\22plugins.dashboard\frequire\0", "setup", "dashboard-nvim")
|
||||
time([[Setup for dashboard-nvim]], false)
|
||||
-- Setup for: cheatsheet.nvim
|
||||
time([[Setup for cheatsheet.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14chadsheet\rmappings\frequire\0", "setup", "cheatsheet.nvim")
|
||||
time([[Setup for cheatsheet.nvim]], false)
|
||||
-- Setup for: TrueZen.nvim
|
||||
time([[Setup for TrueZen.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\ftruezen\rmappings\frequire\0", "setup", "TrueZen.nvim")
|
||||
time([[Setup for TrueZen.nvim]], false)
|
||||
-- Setup for: nvim-comment
|
||||
time([[Setup for nvim-comment]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\17comment_nvim\rmappings\frequire\0", "setup", "nvim-comment")
|
||||
time([[Setup for nvim-comment]], false)
|
||||
-- Conditional loads
|
||||
time([[Conditional loading of AutoSave.nvim]], true)
|
||||
require("packer.load")({"AutoSave.nvim"}, {}, _G.packer_plugins)
|
||||
time([[Conditional loading of AutoSave.nvim]], false)
|
||||
|
||||
-- Command lazy-loads
|
||||
time([[Defining lazy-load commands]], true)
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Dashboard lua require("packer.load")({'dashboard-nvim'}, { cmd = "Dashboard", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardNewFile lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardNewFile", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardJumpMarks lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardJumpMarks", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SessionLoad lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionLoad", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SessionSave lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionSave", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neoformat lua require("packer.load")({'neoformat'}, { cmd = "Neoformat", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Git lua require("packer.load")({'vim-fugitive'}, { cmd = "Git", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZAtaraxis lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZAtaraxis", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZMinimalist lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZMinimalist", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZFocus lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZFocus", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
time([[Defining lazy-load commands]], false)
|
||||
|
||||
vim.cmd [[augroup packer_load_aucmds]]
|
||||
vim.cmd [[au!]]
|
||||
-- Event lazy-loads
|
||||
time([[Defining lazy-load event autocommands]], true)
|
||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'nvim-colorizer.lua', 'nvim-treesitter', 'nvim-lspinstall', 'indent-blankline.nvim'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'packer.nvim', 'cheatsheet.nvim'}, { event = "VimEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufEnter * ++once lua require("packer.load")({'lspkind-nvim'}, { event = "BufEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au InsertCharPre * ++once lua require("packer.load")({'LuaSnip', 'friendly-snippets'}, { event = "InsertCharPre *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au CursorMoved * ++once lua require("packer.load")({'vim-matchup'}, { event = "CursorMoved *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au WinScrolled * ++once lua require("packer.load")({'neoscroll.nvim'}, { event = "WinScrolled *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'better-escape.vim', 'nvim-compe'}, { event = "InsertEnter *" }, _G.packer_plugins)]]
|
||||
time([[Defining lazy-load event autocommands]], false)
|
||||
vim.cmd("augroup END")
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
error_msg = error_msg:gsub('"', '\\"')
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
||||