Compare commits

..

4 Commits

Author SHA1 Message Date
Trevor Vallender 2a80731f4a Many updates 2024-07-23 11:19:57 +01:00
Trevor Vallender e39921edc1 Updates 2024-06-05 18:44:12 +01:00
Trevor Vallender d7d155178c Miscellany 2024-04-30 08:49:51 +01:00
Trevor Vallender 5d76b8ce01 Setup SSH Agent 2024-03-26 11:47:24 +00:00
17 changed files with 135 additions and 171 deletions

View File

@ -16,3 +16,6 @@ CFLAGS="-Wall -Werror -Wextra"
alias cc="gcc ${CFLAGS}"
alias update_ruby_build="git -C "$(rbenv root)"/plugins/ruby-build pull"
alias irc="ssh kernighan -t tmux attach -t irc"
alias krc="kamal app exec -i --reuse 'bin/rails c'"
alias krd="kamal app exec -i --reuse 'bin/rails dbconsole'"
alias krb="kamal app exec -i --reuse 'bash'"

View File

@ -7,10 +7,10 @@ XDG_STATE_HOME=$HOME/.state
LC_ALL="en_GB.UTF-8"
DIP=false
HYPRSHOT_DIR=/home/tsv/img/screenshots
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openssl-1.0.2u/lib
XDG_DOWNLOAD_DIR=$HOME/downloads
XDG_PICTURES_DIR=$HOME/img
HYPRSHOT_DIR=$XDG_PICTURES_DIR/screenshots
# Sane defaults for history
HISTFILE=$XDG_STATE_HOME/.bash_history
@ -104,6 +104,6 @@ if ! shopt -oq posix; then
fi
fi
eval "$(rbenv init - bash)"
eval "$(~/.rbenv/bin/rbenv init - bash)"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

View File

@ -18,6 +18,7 @@ padding = { x = 20, y = 20 }
dynamic_padding = true
opacity = 0.95
# Gruvbox dark
[colors.primary]
background = '#282828'
foreground = '#ebdbb2'
@ -39,3 +40,34 @@ blue = '#83a598'
magenta = '#d3869b'
cyan = '#8ec07c'
white = '#ebdbb2'
# Gruvbox light
# # Default colors
# [colors.primary]
# # hard contrast background = = '#f9f5d7'
# background = '#fbf1c7'
# # soft contrast background = = '#f2e5bc'
# foreground = '#3c3836'
#
# # Normal colors
# [colors.normal]
# black = '#fbf1c7'
# red = '#cc241d'
# green = '#98971a'
# yellow = '#d79921'
# blue = '#458588'
# magenta = '#b16286'
# cyan = '#689d6a'
# white = '#7c6f64'
#
# # Bright colors
# [colors.bright]
# black = '#928374'
# red = '#9d0006'
# green = '#79740e'
# yellow = '#b57614'
# blue = '#076678'
# magenta = '#8f3f71'
# cyan = '#427b58'
# white = '#3c3836'

View File

@ -45,7 +45,3 @@
.current {
color: #D65D0E;
}
.battery, .ram, .disk {
padding-right: 20px;
}

View File

@ -6,15 +6,15 @@
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(box :class "battery" :orientation "h" :space-evenly false
{battery != "" ? "󰁹 ${battery}" : ""})
(box :class "ram" :orientation "h"
"󰍛 ${ram}%")
(box :class "disk" :orientation "h"
" ${disk}")
(metric :label "󰕾"
:value { volume * 100 }
:onchange "VOL=$(bc -l <<<\"scale=2; {} / 100\") ; wpctl set-volume @DEFAULT_AUDIO_SINK@ $VOL")
(metric :label "󰍛"
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label ""
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
@ -61,15 +61,6 @@
(defpoll volume :interval "1s"
"scripts/getvol")
(defpoll battery :interval "1s"
"upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}'")
(defpoll ram :interval "1s"
"MEM=$(free | grep Mem | awk '{print $3/$2 * 100.0}') ; echo \${MEM%.*}")
(defpoll disk :interval "1s"
"df | grep '/$' | awk '{print $5}'")
(defpoll time :interval "10s"
"date '+%H:%M %F'")

View File

@ -2,5 +2,4 @@
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'
socat -u UNIX-CONNECT:/run/user/$UID/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'

View File

@ -1,10 +1,8 @@
[user]
name = Trevor Vallender
email = trevor@tsvallender.co.uk
[includeIf "gitdir:~/foxsoft/"]
path = ~/.config/git/config_foxsoft
[includeIf "gitdir:~/fs/"]
path = ~/.config/git/config_foxsoft
[includeIf "gitdir:~/boxstuff/"]
path = ~/.config/git/config_boxstuff
[core]
autocrlf = input
safecrlf = true
@ -19,8 +17,8 @@
br = branch
cb = clone --bare
cp = cherry-pick
# Show all commits on the current branch but not develop
curr = "!git log --no-merges \"$(git rev-parse --abbrev-ref HEAD)\" ^develop"
# Show all commits on the current branch but not main
curr = "!git log --no-merges \"$(git rev-parse --abbrev-ref HEAD)\" ^main"
co = checkout
cm = commit
cma = commit --amend

View File

@ -1,4 +1,2 @@
[user]
email = trevor@foxsoft.co.uk
[commit]
template = ~/foxsoft/git_template
email = trevor.vallender@boxstuff.com

View File

@ -1,23 +1,23 @@
monitor=,preferred,auto,1
monitor=,preferred,auto,auto
windowrule = workspace 1, alacritty
windowrule = workspace 2, firefox
windowrule = workspace 2, qutebrowser
windowrule = workspace 2, ^(.*)(Chrom)(.*)$
windowrule = workspace 1, firefox
windowrule = workspace 2, thunderbird
windowrule = workspace 2, ^(.*)(potify)(.*)$
exec-once = eww daemon && eww open bar
exec-once = qutebrowser
exec-once = firefox
exec-once = thunderbird
exec-once = dunst & hyprpaper & alacritty
exec-once = flatpak run com.spotify.Client
$terminal = alacritty
$menu = wofi --show drun
$browser = qutebrowser
$browser = firefox
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
env = SSH_AUTH_SOCK,$XDG_RUNTIME_DIR/ssh-agent.socket
input {
kb_layout = us
@ -71,10 +71,6 @@ dwindle {
preserve_split = yes # you probably want this
}
master {
new_is_master = true
}
gestures {
workspace_swipe = off
}

View File

@ -1,42 +1,38 @@
{
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-tmux": { "branch": "main", "commit": "95b1b921802e6f60627b3e76afb9380fddd87f9a" },
"cmp-treesitter": { "branch": "master", "commit": "13e4ef8f4dd5639fca2eb9150e68f47639a9b37d" },
"cmp_kitty": { "branch": "main", "commit": "a0716db2efb4c452600ef1e4a3ca610889279118" },
"codeium.vim": { "branch": "main", "commit": "f2d90dedb45e35f7563d2ce3a31c6928f79de678" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" },
"codeium.vim": { "branch": "main", "commit": "e0342fde9474fdd0a36ff9692fe0031b7611a19f" },
"git-messenger.vim": { "branch": "master", "commit": "8a61bdfa351d4df9a9118ee1d3f45edbed617072" },
"go.nvim": { "branch": "master", "commit": "9ac3e6faa32d01479973f4ca368d00b7ae328646" },
"gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" },
"guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" },
"lazy.nvim": { "branch": "main", "commit": "3132d7d27d56d6bb4bdd0a09623d162b3cf1c588" },
"go.nvim": { "branch": "master", "commit": "033344ddfa3cd5cfd55037903264b2bb86691619" },
"gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" },
"guihua.lua": { "branch": "master", "commit": "225db770e36aae6a1e9e3a65578095c8eb4038d3" },
"indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" },
"lazy.nvim": { "branch": "main", "commit": "839f9e78e78dc935b1188fb16583365991739c51" },
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "82c7cb08ddb836ad938b2708e50085f12a8825d2" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"nui.nvim": { "branch": "main", "commit": "fbb139c6f14896b434d0229099e1acd863ae6bec" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" },
"nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" },
"nvim-html-css": { "branch": "main", "commit": "c072b05c56a40d3ec7874fa487723e6bef5d97f8" },
"nvim-lspconfig": { "branch": "master", "commit": "7f5cf1121f772850a30bdaf83fb448e88846aa58" },
"nvim-nio": { "branch": "master", "commit": "ed70af8ad9d4dafdb55539ed2b4454aac2a2a0c3" },
"nvim-tree.lua": { "branch": "master", "commit": "efafd73efa9bc8c26282aed563ba0f01c7465b06" },
"nvim-treesitter": { "branch": "master", "commit": "70f03829afa31f8b619b56296cdcaa921118d912" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "60e8c288e011403f248b5f6478dde12bed8a6c55" },
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "58bc9119ca273c0ce5a66fad1927ef0f617bd81b" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"noice.nvim": { "branch": "main", "commit": "dd7363eae290ecdb9d6a2db6e0f59527df79edd6" },
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
"nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" },
"nvim-dap": { "branch": "master", "commit": "bc03b83c94d0375145ff5ac6a6dcf28c1241e06f" },
"nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" },
"nvim-html-css": { "branch": "main", "commit": "c514bd27ad560636ed39dea3e370b3103754e244" },
"nvim-lspconfig": { "branch": "master", "commit": "fa6c2a64100c6f692bbec29bbbc8ec2663c9e869" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-tree.lua": { "branch": "master", "commit": "4e396b26244444c911b73e9f2f40ae0115351fd1" },
"nvim-treesitter": { "branch": "master", "commit": "9d252d00210ed8d43197ef048daa94e6dc821bd6" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
"nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"repl.nvim": { "branch": "master", "commit": "ec202eb5786b305c7d73b8cab5ee8fe69a2534a7" },
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
"vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" },
"vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" },
"vim-rails": { "branch": "master", "commit": "3a155462d1c346e291595400ca238037d02a357f" },
"vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" },
"vim-rails": { "branch": "master", "commit": "2fba7907f585819a8653f0bc7dd7f437a822d9c6" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-wordmotion": { "branch": "master", "commit": "81d9bd298376ab0dc465c85d55afa4cb8d5f47a1" },
"zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
"zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }
}

View File

@ -1,13 +1,9 @@
local set = vim.opt
set.autoindent = true
set.tabstop = 2
set.shiftwidth = 2
set.softtabstop = 2
set.expandtab = true
set.number = true
set.relativenumber = true
set.cursorline = true
set.termguicolors = true
set.grepprg = 'rg --vimgrep --smart-case'
-- Improve terminal setup
vim.api.nvim_command("autocmd TermOpen * startinsert")
@ -15,6 +11,32 @@ vim.api.nvim_command("autocmd TermOpen * setlocal nonumber norelativenumber")
vim.api.nvim_command("autocmd TermEnter * setlocal signcolumn=no")
vim.keymap.set('t', '<esc>', "<C-\\><C-n>")
set.autoindent = true
set.expandtab = true
set.tabstop = 2
set.shiftwidth = 2
set.softtabstop = 2
vim.keymap.set('n', 'qq',
function()
vim.opt.autoindent = not vim.opt.autoindent:get()
vim.opt.expandtab = not vim.opt.expandtab:get()
if vim.opt.tabstop:get() == 2 then
vim.opt.tabstop = vim.opt.tabstop._info.default
else
vim.opt.tabstop = 2
end
if vim.opt.shiftwidth:get() == 2 then
vim.opt.shiftwidth = vim.opt.shiftwidth._info.default
else
vim.opt.shiftwidth = 2
end
if vim.opt.softtabstop:get() == 2 then
vim.opt.softtabstop = vim.opt.softtabstop._info.default
else
vim.opt.softtabstop = 2
end
end
)
-- Strip trailing spaces on save
vim.api.nvim_create_autocmd({"BufWritePre"}, {
pattern = { "*" },

View File

@ -4,9 +4,4 @@ return {
"hrsh7th/cmp-nvim-lsp-document-symbol",
"hrsh7th/cmp-nvim-lsp-signature-help",
"ray-x/cmp-treesitter",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"andersevenrud/cmp-tmux",
"garyhurtz/cmp_kitty",
"kdheepak/cmp-latex-symbols",
}

View File

@ -0,0 +1,6 @@
return {
"lukas-reineke/indent-blankline.nvim",
config = function()
require'ibl'.setup()
end
}

View File

@ -5,87 +5,6 @@ return {
"williamboman/mason-lspconfig.nvim",
},
config = function()
-- textDocument/diagnostic support until 0.10.0 is released
_timers = {}
local function setup_diagnostics(client, buffer)
if require("vim.lsp.diagnostic")._enable then
return
end
local diagnostic_handler = function()
local params = vim.lsp.util.make_text_document_params(buffer)
client.request("textDocument/diagnostic", { textDocument = params }, function(err, result)
if err then
local err_msg = string.format("diagnostics error - %s", vim.inspect(err))
vim.lsp.log.error(err_msg)
end
local diagnostic_items = {}
if result then
diagnostic_items = result.items
end
vim.lsp.diagnostic.on_publish_diagnostics(
nil,
vim.tbl_extend("keep", params, { diagnostics = diagnostic_items }),
{ client_id = client.id }
)
end)
end
diagnostic_handler() -- to request diagnostics on buffer when first attaching
vim.api.nvim_buf_attach(buffer, false, {
on_lines = function()
if _timers[buffer] then
vim.fn.timer_stop(_timers[buffer])
end
_timers[buffer] = vim.fn.timer_start(200, diagnostic_handler)
end,
on_detach = function()
if _timers[buffer] then
vim.fn.timer_stop(_timers[buffer])
end
end,
})
end
-- adds ShowRubyDeps command to show dependencies in the quickfix list.
-- add the `all` argument to show indirect dependencies as well
local function add_ruby_deps_command(client, bufnr)
vim.api.nvim_buf_create_user_command(bufnr, "ShowRubyDeps",
function(opts)
local params = vim.lsp.util.make_text_document_params()
local showAll = opts.args == "all"
client.request("rubyLsp/workspace/dependencies", params,
function(error, result)
if error then
print("Error showing deps: " .. error)
return
end
local qf_list = {}
for _, item in ipairs(result) do
if showAll or item.dependency then
table.insert(qf_list, {
text = string.format("%s (%s) - %s",
item.name,
item.version,
item.dependency),
filename = item.path
})
end
end
vim.fn.setqflist(qf_list)
vim.cmd('copen')
end, bufnr)
end, {nargs = "?", complete = function()
return {"all"}
end})
end
require("mason").setup()
require("mason-lspconfig").setup({
automatic_installation = true,
@ -94,8 +13,9 @@ end
function(server_name)
require("lspconfig")[server_name].setup({})
end,
["ruby_ls"] = function()
require("lspconfig").ruby_ls.setup({
["ruby_lsp"] = function()
require("lspconfig").ruby_lsp.setup({
cmd = {"/home/tsv/.rbenv/shims/ruby-lsp"},
on_attach = function(client, buffer)
setup_diagnostics(client, buffer)
add_ruby_deps_command(client, buffer)

View File

@ -1,5 +1,6 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require'nvim-treesitter.configs'.setup({
sync_install = false,

View File

@ -1 +0,0 @@
/home/tsv/.config/systemd/user/syncthing.service

View File

@ -0,0 +1,12 @@
[Unit]
Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
# DISPLAY required for ssh-askpass to work
Environment=DISPLAY=:0
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target