This commit is contained in:
2024-11-14 00:01:56 +01:00
parent ec6813dfb6
commit 004d646182
4 changed files with 235 additions and 187 deletions
+76 -71
View File
@@ -14,6 +14,8 @@
hypridle
hyprpaper
hyprland-protocols
inputs.hyprsunset
# inputs.hyprsysteminfo
# hyprpolkit -- not in nixpkgs yet
];
@@ -350,78 +352,81 @@
};
lib.inputMethod.fcitx5.waylandFrontend = true;
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
hide_cursor = true;
no_fade_in = false;
programs = {
hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
hide_cursor = true;
no_fade_in = false;
};
background = [
{
path = "~/pictures/.wallpapers/bloody_snow.jpg";
blur_passes = 2;
blur_size = 8;
}
];
input-field = [
{
monitor = "";
size = "200, 30";
outline_thickness = 3;
dots_size = 0.33;
dots_spacing = 0.15;
dots_center = false;
outer_color = "#fe0b00";
inner_color = "#0c0c0c";
font_color = "#efefef";
fade_on_empty = true;
check_color = "#0eff0d";
fail_color = "#ff009e";
capslock_color = "#bb00ee";
placeholder_text = "<i>Input Password...</i>";
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
}
];
label = [
{
monitor = "";
text = "$TIME";
text_align = "center";
color = "#ffffee";
font_size = 28;
font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif;
position = "0, 80";
halign = "center";
valign = "center";
}
{
monitor = "";
text = "cmd[update:1000] echo \" <span foreground='##ffffee'>$(date +'%A, %b %d %Y')</span>\"";
text_align = "center";
color = "#ffffee";
font_size = 18;
font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif;
position = "80, 80";
halign = "left";
valign = "bottom";
}
{
monitor = "";
text = "cmd[update:1000] echo \"<span foreground='##feffee'>󰁿$(cat /sys/class/power_supply/BAT0/capacity)</span>\"";
text_align = "center";
color = "#ffffee";
font_size = 18;
font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif;
position = "80, 80";
halign = "right";
valign = "bottom";
}
];
};
background = [
{
path = "~/pictures/.wallpapers/bloody_snow.jpg";
blur_passes = 2;
blur_size = 8;
}
];
input-field = [
{
monitor = "";
size = "200, 30";
outline_thickness = 3;
dots_size = 0.33;
dots_spacing = 0.15;
dots_center = false;
outer_color = "#fe0b00";
inner_color = "#0c0c0c";
font_color = "#efefef";
fade_on_empty = true;
check_color = "#0eff0d";
fail_color = "#ff009e";
capslock_color = "#bb00ee";
placeholder_text = "<i>Input Password...</i>";
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
}
];
label = [
{
monitor = "";
text = "$TIME";
text_align = "center";
color = "#ffffee";
font_size = 28;
font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif;
position = "0, 80";
halign = "center";
valign = "center";
}
{
monitor = "";
text = "cmd[update:1000] echo \" <span foreground='##ffffee'>$(date +'%A, %b %d %Y')</span>\"";
text_align = "center";
color = "#ffffee";
font_size = 18;
font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif;
position = "80, 80";
halign = "left";
valign = "bottom";
}
{
monitor = "";
text = "cmd[update:1000] echo \"<span foreground='##feffee'>󰁿$(cat /sys/class/power_supply/BAT0/capacity)</span>\"";
text_align = "center";
color = "#ffffee";
font_size = 18;
font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif;
position = "80, 80";
halign = "right";
valign = "bottom";
}
];
};
};
+52 -1
View File
@@ -25,6 +25,58 @@ vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", {silent = true})
vim.keymap.set("n", "<leader>bg", "<C-z>")
-- BUILD SCRIPT INVOKATIONS
-- generic build function
local function set(list)
local _set = {}
for _, l in ipairs(list) do
_set[l] = true
end
return _set
end
-- TODO: add support for passing flags
function Build()
local out_buf = vim.api.nvim_create_buf(false, true)
local build_scripts = set(vim.fs.find({ "build.sh", "build.zig", "build.bat" }, { upward = true, type = "file", path = "." }))
local output = "[No Build Output]"
if build_scripts['build.zig'] then
vim.cmd('echo "Running build.zig"')
output = vim.fn.system({ 'zig', 'build' })
else
if jit.os == 'Windows' and build_scripts['build.bat'] then
output = vim.fn.system({ 'build', '' })
elseif build_scripts['build.sh'] then
output = vim.fn.system({ './build.sh', '' })
else
end
end
vim.api.nvim_buf_set_lines(out_buf, -1, -1, true, {"[ Build Output ]"})
vim.api.nvim_buf_set_lines(out_buf, -1, -1, true, vim.split(output, '\n'))
local window = vim.api.nvim_open_win(out_buf, false, {
split = 'right',
win = 0,
width = math.floor(vim.o.columns * 0.35),
style = 'minimal',
})
vim.api.nvim_set_current_win(window)
-- Keybind to close the window on pressing Enter
vim.api.nvim_buf_set_keymap(out_buf, 'n', '<CR>', '', {
noremap = true,
silent = true,
callback = function()
vim.api.nvim_win_close(window, true)
end
})
end
-- TODO: add support for passing flags
vim.keymap.set("n", "<leader>bs", ":lua Build()<CR>")
-- specific build scipt options
-- `build.sh` script binds
-- non-interactive binds
@@ -63,7 +115,6 @@ vim.keymap.set("n", "<leader>zboRr" , ":!zig build run -Doptimize=ReleaseSafe ")
vim.keymap.set("n", "<leader>zboRsr", ":!zig build run -Doptimize=ReleaseSmall ")
vim.keymap.set("n", "<leader>zboRfr", ":!zig build run -Doptimize=ReleaseFast ")
-- emacs-inspired binds
-- all <C-w> can be done w spacebar-w
vim.keymap.set("n", "<leader>w", "<C-w>")