Skip to content

Commit

Permalink
Current
Browse files Browse the repository at this point in the history
  • Loading branch information
rockerBOO committed Nov 2, 2024
1 parent ad8c4c4 commit df73970
Show file tree
Hide file tree
Showing 63 changed files with 2,181 additions and 1,262 deletions.
11 changes: 11 additions & 0 deletions bin/print_colors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

#!/usr/bin/env sh

printf "|039| \033[39mDefault \033[m |049| \033[49mDefault \033[m |037| \033[37mLight gray \033[m |047| \033[47mLight gray \033[m\n"
printf "|030| \033[30mBlack \033[m |040| \033[40mBlack \033[m |090| \033[90mDark gray \033[m |100| \033[100mDark gray \033[m\n"
printf "|031| \033[31mRed \033[m |041| \033[41mRed \033[m |091| \033[91mLight red \033[m |101| \033[101mLight red \033[m\n"
printf "|032| \033[32mGreen \033[m |042| \033[42mGreen \033[m |092| \033[92mLight green \033[m |102| \033[102mLight green \033[m\n"
printf "|033| \033[33mYellow \033[m |043| \033[43mYellow \033[m |093| \033[93mLight yellow \033[m |103| \033[103mLight yellow \033[m\n"
printf "|034| \033[34mBlue \033[m |044| \033[44mBlue \033[m |094| \033[94mLight blue \033[m |104| \033[104mLight blue \033[m\n"
printf "|035| \033[35mMagenta \033[m |045| \033[45mMagenta \033[m |095| \033[95mLight magenta \033[m |105| \033[105mLight magenta \033[m\n"
printf "|036| \033[36mCyan \033[m |046| \033[46mCyan \033[m |096| \033[96mLight cyan \033[m |106| \033[106mLight cyan \033[m\n"
41 changes: 41 additions & 0 deletions bin/random_swaybg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# Directory containing images
image_dir=$1

shopt -s nullglob
# Get a list of image files in the directory
images="$image_dir/*.{png,jpg,jpeg,gif}"
# Initialize the images array
images=()

# Collect images with specific extensions
for ext in png jpg jpeg gif; do
images+=("$image_dir"/*."$ext")
done

# Check if the directory contains images
if [ ${#images[@]} -eq 0 ]; then
echo "No image files found in $image_dir"
exit 1
fi


# Pick a random image
random_image="${images[RANDOM % ${#images[@]}]}"

# Get the connected outputs from wlr-randr
outputs=$(wlr-randr | rg 'HDMI|DP' | awk '{print $1}')

# Prepare the swaybg command
swaybg_cmd="/usr/bin/swaybg --mode fill"

# Add each output to the command
for output in $outputs; do
swaybg_cmd+=" --output $output --image \"$random_image\""
done

set -x

# Execute the command
eval "$swaybg_cmd"
138 changes: 138 additions & 0 deletions config/fontconfig/fonts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,142 @@
<family>Space Mono</family>
</prefer>
</alias>
<match target="pattern">
<edit name="dpi" mode="assign">
<double>92.0</double>
</edit>
</match>
<match target="font">
<edit name="iswindowsfont" mode="assign">
<or>
<eq>
<name>family</name>
<string>Arial</string>
</eq>
<eq>
<name>family</name>
<string>Arial Black</string>
</eq>
<eq>
<name>family</name>
<string>Calibri</string>
</eq>
<eq>
<name>family</name>
<string>Calibri Light</string>
</eq>
<eq>
<name>family</name>
<string>Cambria</string>
</eq>
<eq>
<name>family</name>
<string>Cambria Math</string>
</eq>
<eq>
<name>family</name>
<string>Comic Sans MS</string>
</eq>
<eq>
<name>family</name>
<string>Consolas</string>
</eq>
<eq>
<name>family</name>
<string>Georgia</string>
</eq>
<eq>
<name>family</name>
<string>Impact</string>
</eq>
<eq>
<name>family</name>
<string>Javanese Text</string>
</eq>
<eq>
<name>family</name>
<string>Segoe Print</string>
</eq>
<eq>
<name>family</name>
<string>Segoe Script</string></eq>
<eq>
<name>family</name>
<string>Segoe UI</string>
</eq>
<eq>
<name>family</name>
<string>Segoe UI Emoji</string>
</eq>
<eq>
<name>family</name>
<string>Segoe UI Historic</string>
</eq>
<eq>
<name>family</name>
<string>Segoe UI Black</string>
</eq>
<eq>
<name>family</name>
<string>Segoe UI Light</string>
</eq>
<eq>
<name>family</name>
<string>Segoe UI Semibold</string>
</eq>
<eq>
<name>family</name>
<string>Segoe UI Semilight</string>
</eq>
<eq>
<name>family</name>
<string>Segoe UI Symbol</string>
</eq>
<eq>
<name>family</name>
<string>Tahoma</string>
</eq>
<eq>
<name>family</name>
<string>Times New Roman</string>
</eq>
<eq>
<name>family</name>
<string>Trebuchet MS</string>
</eq>
<eq>
<name>family</name>
<string>Verdana</string>
</eq>
<eq>
<name>family</name>
<string>Webdings</string>
</eq>
<eq>
<name>family</name>
<string>Wingdings</string>
</eq>
</or>
</edit>
</match>
<match target="font">
<test name="iswindowsfont" compare="eq">
<bool>true</bool>
</test>
<edit mode="assign" name="hinting">
<bool>false</bool>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit mode="assign" name="hintstyle">
<const>hintnone</const>
</edit>
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
</fontconfig>
4 changes: 2 additions & 2 deletions config/mpv/mpv.conf
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ hwdec=auto
#sharpen=5
sub-auto=all

osd-font='Iosevka Custom'
sub-font='Iosevka Custom'
osd-font='Iosevka Custom,monospace'
sub-font='Iosevka Custom,monospace'

# sub-ass-force-style='FontName=Isoevka Custom,Default.Bold=1'
sub-ass-hinting='normal'
Expand Down
1 change: 1 addition & 0 deletions config/nvim/after/ftdetect/gotmpl.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
" autocmd BufNewFile,BufRead * if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif
Empty file.
70 changes: 70 additions & 0 deletions config/nvim/after/ftplugin/elixir.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
local set = vim.keymap.set
local silent = { silent = true }
local n = "n"

local add_newline = function(data)
if type(data) == "table" then
if data[#data] ~= "" then
table.insert(data, "")
end
elseif type(data) == "string" then
if data:sub(-1) ~= "\n" then
data = data .. "\n"
end
end
return data
end

local skip_blank_lines = function(data)
if type(data) == "string" then
data = vim.fn.split(data, "\n")
end
return vim.tbl_filter(function(line)
return line ~= ""
end, data)
end

local unindent = function(data)
if type(data) == "string" then
data = vim.fn.split(data, "\n")
end
return vim.tbl_map(vim.fn.trim, data)
end

vim.keymap.set(
n,
"<leader>tt",
-- "<cmd>:sp<CR>:term python %<CR>",
"<cmd>:sp<CR>:term mix test %<CR>",
silent
)

vim.keymap.set(n, "<leader>tr", function()
local position = vim.api.nvim_win_get_cursor(0)
vim.print(position)

local name = vim.api.nvim_buf_get_name(0)

local buf = vim.api.nvim_create_buf(false, false)
local winid = vim.api.nvim_open_win(buf, true, { split = "below" })
local chan = vim.api.nvim_open_term(buf, {})
local cmd = { "mix test --include line:" .. position[1] .. " " .. name }

cmd = unindent(cmd)
cmd = skip_blank_lines(cmd)
cmd = add_newline(cmd)
vim.api.nvim_chan_send(
chan,
vim.iter(cmd):fold("", function(acc, v)
return acc .. v
end)
)
-- "<cmd>:sp<CR>:term mix test %<CR>",
end, silent)

-- get the test blocks in elixir using treesitter
-- (call
-- target: (identifier) @block
-- (arguments) @t
-- (do_block) @b)

-- local capabilities = require("cmp_nvim_lsp").update_capabilities(
-- vim.lsp.protocol.make_client_capabilities()
-- )
Expand Down
3 changes: 3 additions & 0 deletions config/nvim/after/ftplugin/gdscript.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vim.opt.expandtab = false
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
7 changes: 7 additions & 0 deletions config/nvim/after/ftplugin/gleam.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
vim.keymap.set("n", "<leader>rr", function()
vim.cmd("new")

vim.cmd("terminal /home/rockerboo/code/others/gleam/target/release/gleam run")
-- vim.api.nvim_feedkeys("i", "n", false)
end, { desc = "Run a gleam program" })

8 changes: 8 additions & 0 deletions config/nvim/after/ftplugin/javascript.lua
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
require("plugin.jester").mappings()

vim.keymap.set("n", "<leader>rr", function()
local file = vim.fn.expand("%") -- Get the current file name
local escaped_file = vim.fn.shellescape(file)
vim.cmd("new")
vim.cmd("terminal node " .. escaped_file)
vim.api.nvim_feedkeys("i", "n", false)
end, { desc = "Execute javascript file with nodejs" })
20 changes: 20 additions & 0 deletions config/nvim/after/ftplugin/python.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- vim.keymap.set(
-- "n",
-- "<leader>rr",
-- -- "<cmd>:sp<CR>:term python %<CR>",
-- "<cmd>:sp<CR>:term poetry run python %<CR>",
-- { silent = true }
-- )

vim.keymap.set("n", "<leader>rr", function()
local file = vim.fn.expand("%") -- Get the current file name
local escaped_file = vim.fn.shellescape(file)
vim.cmd("new")
vim.cmd("terminal source .env && python " .. escaped_file)
vim.api.nvim_feedkeys("i", "n", false)
end, { desc = "Execute python file with .env" })

vim.keymap.set("n", "<leader>ra", function()
vim.cmd(":sp<CR>")
vim.cmd(":term accelerate launch %<CR>")
end, {})
2 changes: 1 addition & 1 deletion config/nvim/after/ftplugin/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ setlocal colorcolumn=80
setlocal path=.,**,tests,bin/**
setlocal wildignore=*/__pycache__/*,*.pyc

nnoremap <leader>tt <cmd>sp<cr>:term pytest %<cr>
" nnoremap <leader>tt <cmd>sp<cr>:term pytest %<cr>
9 changes: 9 additions & 0 deletions config/nvim/after/ftplugin/text.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local n = "n"
local v = "v"

local voices = require("rockerboo.voices")

local silent = { silent = true }

vim.keymap.set(n, "<leader>tr", voices.voices)
vim.keymap.set(n, "<leader>ss", voices.save_voice)
Loading

0 comments on commit df73970

Please sign in to comment.