Compare commits

...

4 Commits

4 changed files with 81 additions and 54 deletions

View File

@ -4,7 +4,7 @@
local function clamp(x, min, max) return math.max(math.min(x, max), min) end
local function get_random_image()
images = {
local images = {
{
[[██╗ █████╗ ██████╗██╗ ██╗███████╗]],
[[██║ ██╔══██╗██╔════╝██║ ██║██╔════╝]],
@ -29,21 +29,53 @@ local function get_random_image()
[[██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║]],
[[██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║]],
[[╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]]
},
{
[[ ▄ ]],
[[ ▟█▙ ]],
[[ ▟███▙ ]],
[[ ▟█████▙ ]],
[[ ▟███████▙ ]],
[[ ▂▔▀▜██████▙ ]],
[[ ▟██▅▂▝▜█████▙ ]],
[[ ▟█████████████▙ ]],
[[ ▟███████████████▙ ]],
[[ ▟█████████████████▙ ]],
[[ ▟███████████████████▙ ]],
[[ ▟█████████▛▀▀▜████████▙ ]],
[[ ▟████████▛ ▜███████▙ ]],
[[ ▟█████████ ████████▙ ]],
[[ ▟██████████ █████▆▅▄▃▂ ]],
[[ ▟██████████▛ ▜█████████▙ ]],
[[ ▟██████▀▀▀ ▀▀██████▙ ]],
[[ ▟███▀▘ ▝▀███▙ ]],
[[▟▛▀ ▀▜▙]],
[[ btw ]]
}
}
local i = 3
local pmf = {0.25, 0.25, 0.25, 0.25}
local cdf = {}
math.randomseed(os.time())
if math.fmod(math.random(100), 5) == 0 then
if math.random(0, 1) == 0 then
i = 1
else
i = 2
end
cdf[1] = 0
for j = 2, #pmf+1 do
cdf[j] = cdf[j - 1] + pmf[j - 1]
end
return images[i]
if math.abs(cdf[#cdf] - 1) > 0.01 then
error("Probabilities do not add up to 1")
elseif #images ~= #pmf then
error("Number of images and probabilities do not match")
end
math.randomseed(os.time())
local r = math.random(100)
for j = 2, #cdf do
if r <= cdf[j] * 100 then
return images[j-1]
end
end
end
-----------------

View File

@ -1,7 +1,7 @@
return {
{
"folke/trouble.nvim",
tag="v3.3.0",
tag="v3.4.1",
dependencies = {
{
"nvim-tree/nvim-web-devicons"
@ -13,45 +13,39 @@ return {
'nvim-telescope/telescope.nvim'
}
},
cmd = {
"Trouble",
"TroubleClose",
"TroubleToggle",
"TroubleRefresh"
opts = {},
cmd = "Trouble",
keys = {
{
"<leader>xw",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>xd",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>xs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
-- {
-- "<leader>cl",
-- "<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
-- desc = "LSP Definitions / references / ... (Trouble)",
-- },
-- {
-- "<leader>xl",
-- "<cmd>Trouble loclist toggle<cr>",
-- desc = "Location List (Trouble)",
-- },
{
"<leader>xq",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
init = function()
vim.keymap.set("n", "<leader>xx", function() require("trouble").toggle() end, {
desc = "Toggle"
})
vim.keymap.set("n", "<leader>xd", function() require("trouble").toggle("diagnostics") end, {
desc = "Diagnostics"
})
vim.keymap.set("n", "<leader>xq", function() require("trouble").toggle("quickfix") end, {
desc = "Quickfix"
})
vim.keymap.set("n", "<leader>xl", function() require("trouble").toggle("loclist") end, {
desc = "Loclist"
})
-- vim.keymap.set("n", "<leader>xr", function() require("trouble").toggle("lsp_references") end, {
-- desc = "LSP references"
-- })
end,
config = function()
local trouble_provider = require("trouble.sources.telescope")
local telescope = require("telescope")
telescope.setup {
defaults = {
mappings = {
i = {
["<c-t>"] = trouble_provider.open
},
n = {
["<c-t>"] = trouble_provider.open
}
}
}
}
end
}
}

View File

@ -40,10 +40,10 @@ exec i3-msg 'workspace $ws2; exec firefox'
## Multiple monitors
#
workspace $ws1 output DP-3 eDP-1
workspace $ws2 output eDP-1 DP-3
workspace $ws3 output eDP-1 DP-3
workspace $ws4 output DP-3 eDP-1
workspace $ws1 output DP-11 eDP-1
workspace $ws2 output eDP-1 DP-11
workspace $ws3 output eDP-1 DP-11
workspace $ws4 output DP-11 eDP-1
workspace $ws5 output eDP-1
workspace $ws6 output eDP-1
workspace $ws7 output eDP-1

View File

@ -39,6 +39,7 @@ export EDITOR=nvim
alias get-idf='. $HOME/ext_sw/esp-idf/export.sh'
alias c='z ~/.dotfiles'
alias sc='z ~/.config/sway'
alias nc='z ~/.config/nvim'
alias ezc='nvim ~/.zshrc'