1
0
Fork 0

Compare commits

...

8 Commits

Author SHA1 Message Date
urosm 9a9eef9224 update `README.md` 2024-07-07 22:14:32 +02:00
urosm 120aea982e update `.profile` 2024-07-07 22:14:04 +02:00
urosm a8d4b9fac5 update `.bashrc` 2024-07-07 22:13:55 +02:00
urosm 5ecc028ff9 update scripts 2024-07-07 22:10:54 +02:00
urosm bacf5509bf update `nftables` config 2024-07-07 22:10:41 +02:00
urosm 08ad90ad3d update `sway` config 2024-07-07 22:10:30 +02:00
urosm 7ba07ed004 update `nvim` 2024-07-05 17:00:27 +02:00
urosm 1f12d578b5 remove `mako` config 2024-07-05 16:20:01 +02:00
13 changed files with 320 additions and 305 deletions

48
.bashrc
View File

@ -3,27 +3,33 @@
# if not running interactively, don't do anything # if not running interactively, don't do anything
[ -z "$PS1" ] && return [ -z "$PS1" ] && return
# history
HISTFILESIZE=-1
HISTCONTROL=ignoredups:erasedups
trap "history -n; history -w; history -c; history -r;" EXIT
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
# readline # readline
bind "set editing-mode vi" set -o vi
bind "set keyseq-timeout 0" bind 'set show-mode-in-prompt on'
bind "set show-mode-in-prompt on" bind 'set vi-ins-mode-string \1\e[01;35m\2+\1\e[0m\2'
bind "set vi-ins-mode-string \1\e[01;35m\2+\1\e[0m\2" bind 'set vi-cmd-mode-string :'
bind "set vi-cmd-mode-string :" bind 'set keyseq-timeout 0'
bind "set keymap vi-command" bind 'set keymap vi-command'
bind "j:history-substring-search-forward" bind 'j:history-search-forward'
bind "k:history-substring-search-backward" bind 'k:history-search-backward'
bind "set keymap vi-insert" bind 'set keymap vi-insert'
bind '"\e[A":history-substring-search-backward' bind '"\e[A":history-search-backward'
bind '"\e[B":history-substring-search-forward' bind '"\e[B":history-search-forward'
bind "set show-all-if-ambiguous on" bind 'set show-all-if-ambiguous on'
bind "set completion-display-width 0" bind 'set completion-display-width 0'
bind "set colored-stats on" bind 'set colored-stats on'
bind "set visible-stats on" bind 'set visible-stats on'
# prompt # prompt
PS1="\[\e[1m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\[\e[1m\]\$\[\e[0m\] " PS1="\[\033[01m\]\u@\h:\[\e[01;34m\]\w\[\e[37m\]\$\[\e[00m\] "
# title # title
PS1="\[\e]0;\u@\h:\w\a\]$PS1" PS1="\[\e]0;\u@\h:\w\a\]$PS1"
@ -35,13 +41,7 @@ alias grep="grep --color=auto"
alias ls="ls --color=auto" alias ls="ls --color=auto"
alias ll="ls -AF1" alias ll="ls -AF1"
alias lll="ls -AFlh" alias lll="ls -AFlh"
alias ff="find 2>/dev/null"
# history
shopt -u histappend
HISTSIZE=-1
HISTFILESIZE=-1
HISTIGNORE='exit:q:ls:ll:lll'
HISTCONTROL='ignoreboth:erasedups'
# bash completion # bash completion
if ! shopt -oq posix; then if ! shopt -oq posix; then
@ -67,4 +67,4 @@ osc7_cwd() {
done done
printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}" printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}"
} }
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }osc7_cwd PROMPT_COMMAND="osc7_cwd; $PROMPT_COMMAND"

View File

@ -1 +0,0 @@
invisible=1

View File

@ -4,14 +4,13 @@ flush ruleset
table inet filter { table inet filter {
chain input { chain input {
type filter hook input priority filter; policy drop; type filter hook input priority 0; policy drop;
iif lo accept comment "Accept localhost traffic" iif lo accept comment "Accept any localhost traffic"
ct state invalid drop comment "Drop invalid connections" ct state established,related accept comment "Accept trafic originated from us"
ct state established,related accept comment "Accept established and related connections"
meta l4proto { icmp, ipv6-icmp } accept comment "Accept ICMP/ICMPv6 traffic"
ip protocol igmp accept comment "Accept IGMP traffic"
meta l4proto { icmp, icmpv6 } accept comment "Accept ICMP/ICMPv6 traffic"
udp dport mdns accept comment "Accept mDNS" udp dport mdns accept comment "Accept mDNS"
tcp dport ipp accept comment "Accept IPP"
} }
} }

View File

@ -0,0 +1,2 @@
-- treesitter
vim.treesitter.start()

View File

@ -1,6 +1,7 @@
local optl = vim.opt_local local optl = vim.opt_local
-- options -- options
optl.omnifunc = "v:lua.vim.lua_omnifunc"
optl.tabstop = 2 optl.tabstop = 2
optl.shiftwidth = 2 optl.shiftwidth = 2
optl.expandtab = true optl.expandtab = true

View File

@ -1,4 +1,3 @@
local api = vim.api
local optl = vim.opt_local local optl = vim.opt_local
-- options -- options
@ -8,20 +7,5 @@ optl.expandtab = true
-- keymaps -- keymaps
local keymap_set = vim.keymap.set local keymap_set = vim.keymap.set
keymap_set("n", "]h", "/\\_^#.*\\ze\\n\\{2}<esc>") keymap_set({ "n", "v" }, "]h", "/\\_^#.*\\ze\\n\\{2}<esc>")
keymap_set("n", "[h", "?\\_^#.*\\ze\\n\\{2}<esc>") keymap_set({ "n", "v" }, "[h", "?\\_^#.*\\ze\\n\\{2}<esc>")
-- buffer completion
optl.completeopt:append("noselect")
api.nvim_create_autocmd("TextChangedI", {
group = api.nvim_create_augroup("Markdown buffer autocomplete", {}),
buffer = 0,
desc = "Buffer autocomplete on TextChangedI",
callback = function ()
local col = api.nvim_win_get_cursor(0)[2]
local char = api.nvim_get_current_line():sub(col,col)
if char:match("%w") then
api.nvim_input("<c-x><c-n>")
end
end
})

View File

@ -0,0 +1,3 @@
local keymap_set = vim.keymap.set
keymap_set("n", "<esc>", "<cmd>Rexplore<cr>", { buffer = true})
keymap_set("n", "<leader>.", "<cmd>Rexplore<cr>", { buffer = true })

View File

@ -1,7 +1,19 @@
-- basic neovim colorscheme template -- Name: basic
-- -- Description: a basic colorscheme
-- A simple neovim colorscheme template that defines highlight groups -- Author: urosm <urosm@kompot.si>
-- from a list of 8 colors. -- Maintainer: urosm <https://git.kompot.si/urosm/dot/src/branch/main/.config/nvim/colors/basic.lua>
-- Website: https://git.kompot.si/urosm/dot/src/branch/main/.config/nvim/colors/basic.lua
-- License: Same as Vim
-- Last Updated: 2024 Jun 19
-- A simple neovim colorscheme that defines highlight groups from a list of 8
-- colors.
-- init ------------------------------------------------------------------------
vim.cmd.highlight("clear")
vim.g.colors_name = "basic"
local hi = function(name, val) vim.api.nvim_set_hl(0, name, val) end
-- colors ---------------------------------------------------------------------- -- colors ----------------------------------------------------------------------
local C = { local C = {
@ -23,65 +35,38 @@ local C = {
bright_white = { cterm = 15, gui = "#ffffff" }, bright_white = { cterm = 15, gui = "#ffffff" },
} }
vim.g.terminal_color_0 = "#000000"
vim.g.terminal_color_1 = "#fa3500"
vim.g.terminal_color_2 = "#009843"
vim.g.terminal_color_3 = "#d06600"
vim.g.terminal_color_4 = "#856cff"
vim.g.terminal_color_5 = "#ff1170"
vim.g.terminal_color_6 = "#008cca"
vim.g.terminal_color_7 = "#e2e2e2"
vim.g.terminal_color_8 = "#848484"
vim.g.terminal_color_9 = "#ff888e"
vim.g.terminal_color_10 = "#00c55b"
vim.g.terminal_color_11 = "#ff8d48"
vim.g.terminal_color_12 = "#ac9fff"
vim.g.terminal_color_13 = "#ffb1c0"
vim.g.terminal_color_14 = "#92ccff"
vim.g.terminal_color_15 = "#ffffff"
-- init ------------------------------------------------------------------------
vim.cmd.highlight("clear")
if vim.fn.exists("syntax_on") then
vim.cmd.syntax("reset")
end
vim.opt.background = "dark"
vim.g.colors_name = "basic"
-- highlights ------------------------------------------------------------------ -- highlights ------------------------------------------------------------------
local fg = C.white local fg = C.white
local bg = C.black local bg = C.black
local accent = C.magenta local accent = C.magenta
local dimmed = C.blue local dimmed = C.blue
local nvim_set_hl = vim.api.nvim_set_hl
local function set_hl(group, def) nvim_set_hl(0, group, def) end
-- normal ---------------------------------------------------------------------- -- normal ----------------------------------------------------------------------
local normal_h = {} local normal_h = {}
set_hl("Normal", normal_h) hi("Normal", normal_h)
set_hl("NormalNC", normal_h) hi("NormalNC", normal_h)
-- tui ------------------------------------------------------------------------- -- tui -------------------------------------------------------------------------
local tui_normal_h = {} local tui_normal_h = {}
local tui_accent_h = { ctermfg = accent.cterm, fg = accent.gui } local tui_accent_h = { ctermfg = accent.cterm, fg = accent.gui }
local tui_dimmed_h = { ctermfg = dimmed.cterm, fg = dimmed.gui } local tui_dimmed_h = { ctermfg = dimmed.cterm, fg = dimmed.gui }
set_hl("StatusLine", tui_dimmed_h) hi("StatusLine", tui_dimmed_h)
set_hl("StatusLineNC", tui_dimmed_h) hi("StatusLineNC", tui_dimmed_h)
set_hl("TabLine", tui_dimmed_h) hi("TabLine", tui_dimmed_h)
set_hl("TabLineFill", tui_dimmed_h) hi("TabLineFill", tui_dimmed_h)
set_hl("TabLineSel", tui_accent_h) hi("TabLineSel", tui_accent_h)
set_hl("WinBar", tui_accent_h) hi("WinBar", tui_accent_h)
set_hl("WinBarNC", tui_dimmed_h) hi("WinBarNC", tui_dimmed_h)
set_hl("WinSeparator", tui_dimmed_h) hi("WinSeparator", tui_dimmed_h)
set_hl("LineNr", tui_accent_h) hi("LineNr", tui_accent_h)
set_hl("LineNrAbove", tui_dimmed_h) hi("LineNrAbove", tui_dimmed_h)
set_hl("LineNrBelow", tui_dimmed_h) hi("LineNrBelow", tui_dimmed_h)
set_hl("SignColumn", tui_dimmed_h) hi("SignColumn", tui_dimmed_h)
set_hl("FoldColumn", tui_dimmed_h) hi("FoldColumn", tui_dimmed_h)
set_hl("WildMenu", tui_accent_h) hi("WildMenu", tui_accent_h)
-- float ----------------------------------------------------------------------- -- float -----------------------------------------------------------------------
local float_normal_h = { ctermfg = bg.cterm, local float_normal_h = { ctermfg = bg.cterm,
@ -97,9 +82,9 @@ local float_accent_h = { ctermfg = accent.cterm,
ctermbg = fg.cterm, ctermbg = fg.cterm,
bg = fg.gui } bg = fg.gui }
set_hl("NormalFloat", float_normal_h) hi("NormalFloat", float_normal_h)
set_hl("FloatBorder", float_dimmed_h) hi("FloatBorder", float_dimmed_h)
set_hl("FloatTitle", float_accent_h) hi("FloatTitle", float_accent_h)
-- menu ------------------------------------------------------------------------ -- menu ------------------------------------------------------------------------
local menu_normal_h = { ctermfg = accent.cterm, local menu_normal_h = { ctermfg = accent.cterm,
@ -112,14 +97,14 @@ local menu_accent_h = { ctermfg = accent.cterm,
bg = fg.gui, bg = fg.gui,
reverse = true } reverse = true }
set_hl("Pmenu", menu_normal_h) hi("Pmenu", menu_normal_h)
set_hl("PmenuSel", menu_accent_h) hi("PmenuSel", menu_accent_h)
set_hl("PmenuKind", menu_normal_h) hi("PmenuKind", menu_normal_h)
set_hl("PmenuKindSel", menu_accent_h) hi("PmenuKindSel", menu_accent_h)
set_hl("PmenuExtra", menu_normal_h) hi("PmenuExtra", menu_normal_h)
set_hl("PmenuExtraSel", menu_accent_h) hi("PmenuExtraSel", menu_accent_h)
set_hl("PmenuSbar", menu_normal_h) hi("PmenuSbar", menu_normal_h)
set_hl("PmenuThumb", menu_accent_h) hi("PmenuThumb", menu_accent_h)
-- messages -------------------------------------------------------------------- -- messages --------------------------------------------------------------------
local message_normal_h = {} local message_normal_h = {}
@ -127,14 +112,14 @@ local message_accent_h = { ctermfg = accent.cterm, fg = accent.gui }
local message_error_h = { ctermfg = C.red.cterm, fg = C.red.gui } local message_error_h = { ctermfg = C.red.cterm, fg = C.red.gui }
local message_warn_h = { ctermfg = C.orange.cterm, fg = C.orange.gui } local message_warn_h = { ctermfg = C.orange.cterm, fg = C.orange.gui }
set_hl("MsgArea", message_normal_h) hi("MsgArea", message_normal_h)
set_hl("MsgSeparator", message_normal_h) hi("MsgSeparator", message_normal_h)
set_hl("ModeMsg", message_accent_h) hi("ModeMsg", message_accent_h)
set_hl("MoreMsg", message_accent_h) hi("MoreMsg", message_accent_h)
set_hl("WarningMsg", message_warn_h) hi("WarningMsg", message_warn_h)
set_hl("ErrorMsg", message_error_h) hi("ErrorMsg", message_error_h)
set_hl("Question", message_accent_h) hi("Question", message_accent_h)
set_hl("Title", message_accent_h) hi("Title", message_accent_h)
-- buffer ---------------------------------------------------------------------- -- buffer ----------------------------------------------------------------------
local buffer_dimmed_h = { ctermfg = dimmed.cterm, local buffer_dimmed_h = { ctermfg = dimmed.cterm,
@ -145,28 +130,28 @@ local buffer_dimmed_reverse_h = { ctermfg = dimmed.cterm,
local buffer_accent_h = { ctermfg = accent.cterm, local buffer_accent_h = { ctermfg = accent.cterm,
fg = accent.gui } fg = accent.gui }
set_hl("Conceal", buffer_dimmed_h) hi("Conceal", buffer_dimmed_h)
set_hl("NonText", buffer_dimmed_h) hi("NonText", buffer_dimmed_h)
set_hl("EndOfBuffer", buffer_dimmed_h) hi("EndOfBuffer", buffer_dimmed_h)
set_hl("Whitespace", buffer_dimmed_h) hi("Whitespace", buffer_dimmed_h)
set_hl("Folded", buffer_dimmed_h) hi("Folded", buffer_dimmed_h)
set_hl("SpecialKey", buffer_accent_h) hi("SpecialKey", buffer_accent_h)
set_hl("ColorColumn", buffer_dimmed_reverse_h) hi("ColorColumn", buffer_dimmed_reverse_h)
-- cursor ---------------------------------------------------------------------- -- cursor ----------------------------------------------------------------------
local cursor_normal_h = { reverse = true } local cursor_normal_h = { reverse = true }
set_hl("CursorLine", cursor_normal_h) hi("CursorLine", cursor_normal_h)
set_hl("CursorLineNr", cursor_normal_h) hi("CursorLineNr", cursor_normal_h)
set_hl("CursorLineSign", cursor_normal_h) hi("CursorLineSign", cursor_normal_h)
set_hl("CursorLineFold", cursor_normal_h) hi("CursorLineFold", cursor_normal_h)
set_hl("CursorColumn", cursor_normal_h) hi("CursorColumn", cursor_normal_h)
set_hl("QuickFixLine", cursor_normal_h) hi("QuickFixLine", cursor_normal_h)
set_hl("Cursor", cursor_normal_h) hi("Cursor", cursor_normal_h)
set_hl("lCursor", cursor_normal_h) hi("lCursor", cursor_normal_h)
set_hl("CursorIM", cursor_normal_h) hi("CursorIM", cursor_normal_h)
set_hl("TermCursor", cursor_normal_h) hi("TermCursor", cursor_normal_h)
set_hl("TermCursorNC", cursor_normal_h) hi("TermCursorNC", cursor_normal_h)
-- match ----------------------------------------------------------------------- -- match -----------------------------------------------------------------------
local match_normal_h = { ctermfg = C.black.cterm, local match_normal_h = { ctermfg = C.black.cterm,
@ -182,11 +167,11 @@ local match_parens_h = { ctermfg = C.magenta.cterm,
ctermbg = C.white.cterm, ctermbg = C.white.cterm,
bg = C.white.gui } bg = C.white.gui }
set_hl("Search", match_normal_h) hi("Search", match_normal_h)
set_hl("Substitute", match_normal_h) hi("Substitute", match_normal_h)
set_hl("IncSearch", match_accent_h) hi("IncSearch", match_accent_h)
set_hl("CurSearch", match_accent_h) hi("CurSearch", match_accent_h)
set_hl("MatchParen", match_parens_h) hi("MatchParen", match_parens_h)
-- selection ------------------------------------------------------------------- -- selection -------------------------------------------------------------------
local selection_normal_h = { ctermfg = C.black.cterm, local selection_normal_h = { ctermfg = C.black.cterm,
@ -194,8 +179,8 @@ local selection_normal_h = { ctermfg = C.black.cterm,
ctermbg = C.blue.cterm, ctermbg = C.blue.cterm,
bg = C.blue.gui } bg = C.blue.gui }
set_hl("Visual", selection_normal_h) hi("Visual", selection_normal_h)
set_hl("Visualnos", selection_normal_h) hi("Visualnos", selection_normal_h)
-- diff ------------------------------------------------------------------------ -- diff ------------------------------------------------------------------------
local diff_add_h = { ctermfg = C.green.cterm, local diff_add_h = { ctermfg = C.green.cterm,
@ -208,10 +193,10 @@ local diff_text_h = { ctermfg = C.orange.cterm,
fg = C.orange.gui, fg = C.orange.gui,
underline = true } underline = true }
set_hl("DiffAdd", diff_add_h) hi("DiffAdd", diff_add_h)
set_hl("DiffChange", diff_change_h) hi("DiffChange", diff_change_h)
set_hl("DiffDelete", diff_delete_h) hi("DiffDelete", diff_delete_h)
set_hl("DiffText", diff_text_h) hi("DiffText", diff_text_h)
-- spell ----------------------------------------------------------------------- -- spell -----------------------------------------------------------------------
local spell_error_h = { ctermfg = C.red.cterm, local spell_error_h = { ctermfg = C.red.cterm,
@ -221,10 +206,10 @@ local spell_warn_h = { ctermfg = C.orange.cterm,
fg = C.orange.gui, fg = C.orange.gui,
underline = true } underline = true }
set_hl("SpellBad", spell_error_h) hi("SpellBad", spell_error_h)
set_hl("SpellCap", spell_warn_h) hi("SpellCap", spell_warn_h)
set_hl("SpellLocal", spell_warn_h) hi("SpellLocal", spell_warn_h)
set_hl("SpellRare", spell_warn_h) hi("SpellRare", spell_warn_h)
-- diagnostic ------------------------------------------------------------------ -- diagnostic ------------------------------------------------------------------
local diagnostic_error_h = { ctermfg = C.red.cterm, local diagnostic_error_h = { ctermfg = C.red.cterm,
@ -253,36 +238,36 @@ local diagnostic_ok_u_h = { ctermfg = C.green.cterm,
fg = C.green.gui, fg = C.green.gui,
underline = true } underline = true }
set_hl("DiagnosticError", diagnostic_error_h) hi("DiagnosticError", diagnostic_error_h)
set_hl("DiagnosticWarn", diagnostic_warn_h) hi("DiagnosticWarn", diagnostic_warn_h)
set_hl("DiagnosticInfo", diagnostic_info_h) hi("DiagnosticInfo", diagnostic_info_h)
set_hl("DiagnosticHint", diagnostic_hint_h) hi("DiagnosticHint", diagnostic_hint_h)
set_hl("DiagnosticOk", diagnostic_ok_h) hi("DiagnosticOk", diagnostic_ok_h)
set_hl("DiagnosticVirtualError", diagnostic_error_h) hi("DiagnosticVirtualError", diagnostic_error_h)
set_hl("DiagnosticVirtualWarn", diagnostic_warn_h) hi("DiagnosticVirtualWarn", diagnostic_warn_h)
set_hl("DiagnosticVirtualInfo", diagnostic_info_h) hi("DiagnosticVirtualInfo", diagnostic_info_h)
set_hl("DiagnosticVirtualHint", diagnostic_hint_h) hi("DiagnosticVirtualHint", diagnostic_hint_h)
set_hl("DiagnosticVirtualOk", diagnostic_ok_h) hi("DiagnosticVirtualOk", diagnostic_ok_h)
set_hl("DiagnosticUnderlineError", diagnostic_error_u_h) hi("DiagnosticUnderlineError", diagnostic_error_u_h)
set_hl("DiagnosticUnderlineWarn", diagnostic_warn_u_h) hi("DiagnosticUnderlineWarn", diagnostic_warn_u_h)
set_hl("DiagnosticUnderlineInfo", diagnostic_info_u_h) hi("DiagnosticUnderlineInfo", diagnostic_info_u_h)
set_hl("DiagnosticUnderlineHint", diagnostic_hint_u_h) hi("DiagnosticUnderlineHint", diagnostic_hint_u_h)
set_hl("DiagnosticUnderlineOk", diagnostic_ok_u_h) hi("DiagnosticUnderlineOk", diagnostic_ok_u_h)
set_hl("DiagnosticFloatingError", diagnostic_error_h) hi("DiagnosticFloatingError", diagnostic_error_h)
set_hl("DiagnosticFloatingWarn", diagnostic_warn_h) hi("DiagnosticFloatingWarn", diagnostic_warn_h)
set_hl("DiagnosticFloatingInfo", diagnostic_info_h) hi("DiagnosticFloatingInfo", diagnostic_info_h)
set_hl("DiagnosticFloatingHint", diagnostic_hint_h) hi("DiagnosticFloatingHint", diagnostic_hint_h)
set_hl("DiagnosticFloatingOk", diagnostic_ok_h) hi("DiagnosticFloatingOk", diagnostic_ok_h)
set_hl("DiagnosticSingError", diagnostic_error_h) hi("DiagnosticSingError", diagnostic_error_h)
set_hl("DiagnosticSingWarn", diagnostic_warn_h) hi("DiagnosticSingWarn", diagnostic_warn_h)
set_hl("DiagnosticSingInfo", diagnostic_info_h) hi("DiagnosticSingInfo", diagnostic_info_h)
set_hl("DiagnosticSingHint", diagnostic_hint_h) hi("DiagnosticSingHint", diagnostic_hint_h)
set_hl("DiagnosticSingOk", diagnostic_ok_h) hi("DiagnosticSingOk", diagnostic_ok_h)
set_hl("DiagnosticDeprecated", diagnostic_hint_u_h) hi("DiagnosticDeprecated", diagnostic_hint_u_h)
set_hl("DiagnosticUnnecessary", diagnostic_hint_u_h) hi("DiagnosticUnnecessary", diagnostic_hint_u_h)
-- misc ------------------------------------------------------------------------ -- misc ------------------------------------------------------------------------
set_hl("Directory", { ctermfg = C.blue.cterm, fg = C.blue.gui }) hi("Directory", { ctermfg = C.blue.cterm, fg = C.blue.gui })
-- syntax ---------------------------------------------------------------------- -- syntax ----------------------------------------------------------------------
local syntax_normal_h = {} local syntax_normal_h = {}
@ -316,46 +301,46 @@ local syntax_bolditalic_h = { bold = true,
italic = true } italic = true }
local syntax_strike_h = { strikethrough = true } local syntax_strike_h = { strikethrough = true }
set_hl("Comment", syntax_comment_h) hi("Comment", syntax_comment_h)
set_hl("Constant", syntax_constant_h) hi("Constant", syntax_constant_h)
set_hl("String", syntax_constant_h) hi("String", syntax_constant_h)
set_hl("Character", syntax_constant_h) hi("Character", syntax_constant_h)
set_hl("Number", syntax_constant_h) hi("Number", syntax_constant_h)
set_hl("Boolean", syntax_constant_h) hi("Boolean", syntax_constant_h)
set_hl("Float", syntax_constant_h) hi("Float", syntax_constant_h)
set_hl("Identifier", syntax_identifier_h) hi("Identifier", syntax_identifier_h)
set_hl("Function", syntax_identifier_h) hi("Function", syntax_identifier_h)
set_hl("Statement", syntax_statement_h) hi("Statement", syntax_statement_h)
set_hl("Conditional", syntax_statement_h) hi("Conditional", syntax_statement_h)
set_hl("Repeat", syntax_statement_h) hi("Repeat", syntax_statement_h)
set_hl("Label", syntax_statement_h) hi("Label", syntax_statement_h)
set_hl("Operator", syntax_statement_h) hi("Operator", syntax_statement_h)
set_hl("Keyword", syntax_statement_h) hi("Keyword", syntax_statement_h)
set_hl("Exception", syntax_statement_h) hi("Exception", syntax_statement_h)
set_hl("PreProc", syntax_preproc_h) hi("PreProc", syntax_preproc_h)
set_hl("Include", syntax_preproc_h) hi("Include", syntax_preproc_h)
set_hl("Define", syntax_preproc_h) hi("Define", syntax_preproc_h)
set_hl("Macro", syntax_preproc_h) hi("Macro", syntax_preproc_h)
set_hl("PreCondit", syntax_preproc_h) hi("PreCondit", syntax_preproc_h)
set_hl("Type", syntax_type_h) hi("Type", syntax_type_h)
set_hl("StorageClass", syntax_type_h) hi("StorageClass", syntax_type_h)
set_hl("Structure", syntax_type_h) hi("Structure", syntax_type_h)
set_hl("Typedef", syntax_type_h) hi("Typedef", syntax_type_h)
set_hl("Special", syntax_special_h) hi("Special", syntax_special_h)
set_hl("SpecialChar", syntax_special_h) hi("SpecialChar", syntax_special_h)
set_hl("Tag", syntax_special_h) hi("Tag", syntax_special_h)
set_hl("Delimiter", syntax_special_h) hi("Delimiter", syntax_special_h)
set_hl("SpecialComment", syntax_special_h) hi("SpecialComment", syntax_special_h)
set_hl("Debug", syntax_special_h) hi("Debug", syntax_special_h)
set_hl("Underlined", syntax_underline_h) hi("Underlined", syntax_underline_h)
set_hl("Ignore", syntax_ignore_h) hi("Ignore", syntax_ignore_h)
set_hl("Error", syntax_error_h) hi("Error", syntax_error_h)
set_hl("Todo", syntax_warn_h) hi("Todo", syntax_warn_h)
set_hl("Italic", syntax_italic_h) hi("Italic", syntax_italic_h)
set_hl("Bold", syntax_bold_h) hi("Bold", syntax_bold_h)
set_hl("BoldItalic", syntax_bolditalic_h) hi("BoldItalic", syntax_bolditalic_h)
set_hl("Strike", syntax_strike_h) hi("Strike", syntax_strike_h)
-- markdown -------------------------------------------------------------------- -- markdown --------------------------------------------------------------------
local markdown_label_h = { ctermfg = C.magenta.cterm, local markdown_label_h = { ctermfg = C.magenta.cterm,
@ -366,17 +351,17 @@ local markdown_underline_h = { ctermfg = C.blue.cterm,
fg = C.blue.gui, fg = C.blue.gui,
underline = true } underline = true }
set_hl("markdownLabel", markdown_label_h) hi("markdownLabel", markdown_label_h)
set_hl("markdownHeadingDelimiter", markdown_delimiter_h) hi("markdownHeadingDelimiter", markdown_delimiter_h)
set_hl("markdownItalicDelimiter", markdown_delimiter_h) hi("markdownItalicDelimiter", markdown_delimiter_h)
set_hl("markdownBoldDelimiter", markdown_delimiter_h) hi("markdownBoldDelimiter", markdown_delimiter_h)
set_hl("markdownBoldItalicDelimiter", markdown_delimiter_h) hi("markdownBoldItalicDelimiter", markdown_delimiter_h)
set_hl("markdownStrikeDelimiter", markdown_delimiter_h) hi("markdownStrikeDelimiter", markdown_delimiter_h)
set_hl("markdownCodeDelimiter", markdown_delimiter_h) hi("markdownCodeDelimiter", markdown_delimiter_h)
set_hl("markdownLinkTextDelimiter", markdown_delimiter_h) hi("markdownLinkTextDelimiter", markdown_delimiter_h)
set_hl("markdownLinkDelimiter", markdown_delimiter_h) hi("markdownLinkDelimiter", markdown_delimiter_h)
set_hl("markdownUrl", markdown_delimiter_h) hi("markdownUrl", markdown_delimiter_h)
-- yaml ------------------------------------------------------------------------ -- yaml ------------------------------------------------------------------------
set_hl("yamlBlockMappingKey", syntax_comment_h) hi("yamlBlockMappingKey", syntax_comment_h)
set_hl("yamlPlainScalar", syntax_constant_h) hi("yamlPlainScalar", syntax_constant_h)

View File

@ -1,55 +1,81 @@
local opt, api, cmd = vim.opt, vim.api, vim.cmd local opt, cmd, api = vim.opt, vim.cmd, vim.api
local fn, ui = vim.fn, vim.ui local fn = vim.fn
local v, g = vim.v, vim.g
-- colorscheme ----------------------------------------------------------------- -- colorscheme -----------------------------------------------------------------
cmd.colorscheme("basic") cmd.colorscheme("basic")
-- options ---------------------------------------------------------------------
opt.undofile = true
opt.backup = false
opt.writebackup = false
opt.mouse = "nvi"
opt.title = true
opt.shortmess:append({ I = true })
opt.number = true
opt.relativenumber = true
opt.signcolumn = "number"
opt.textwidth = 80
opt.colorcolumn = "+1"
opt.expandtab = true
opt.tabstop = 4
opt.shiftwidth = 4
opt.softtabstop = -1
opt.smarttab = true
opt.showtabline = 2
opt.winbar = "%f%( %h%m%r%y%)"
opt.laststatus = 3
opt.ignorecase = true
opt.infercase = true
opt.smartcase = true
opt.smartindent = true
opt.clipboard = "unnamedplus"
opt.wildoptions = { "fuzzy" }
opt.wildignorecase = true
opt.path = ".,,**"
opt.completeopt = { "menuone", "preview" }
opt.scrolloff = 10
-- statusline ------------------------------------------------------------------ -- statusline ------------------------------------------------------------------
function _G.statusline() function Statusline()
local wordcount = fn.wordcount() local wordcount = fn.wordcount()
return table.concat({ return table.concat({
fn.pathshorten(fn.getcwd()), fn.pathshorten(fn.getcwd()),
" %=", " %=",
" <%b> ", " <%b>",
wordcount.visual_chars or wordcount.cursor_chars, "/", wordcount.chars, " ", " ", wordcount.visual_chars or wordcount.cursor_chars, "/", wordcount.chars,
wordcount.visual_words or wordcount.cursor_words, "/", wordcount.words " ", wordcount.visual_words or wordcount.cursor_words, "/", wordcount.words,
" %l/%L",
" %c"
}) })
end end
opt.statusline = "%!v:lua.statusline()"
-- options ---------------------------------------------------------------------
-- moving around, searching and patterns
opt.path = {".", "", "**"}
opt.ignorecase = true
opt.smartcase = true
-- displaying text
opt.scrolloff = 10
opt.breakindent = true
opt.showbreak = "+++ "
opt.number = true
opt.relativenumber = true
opt.colorcolumn = "+1"
-- multiple windows
opt.laststatus = 3
opt.statusline = "%!v:lua.Statusline()"
-- multiple tab pages
opt.showtabline = 2
-- terminal
opt.title = true
-- messages and info
opt.shortmess:append({ I = true })
-- selecting text
opt.clipboard = "unnamedplus"
-- editing text
opt.undofile = true
opt.textwidth = 80
opt.completeopt = { "menuone", "preview", "noselect" }
-- tabs and indenting
opt.tabstop = 4
opt.shiftwidth = 4
opt.smarttab = true
opt.softtabstop = -1
opt.expandtab = true
opt.smartindent = true
-- reading and writing files
opt.writebackup = false
opt.backup = false
-- command line editing
opt.wildignorecase = true
-- various
opt.signcolumn = "number"
opt.winbar = "%f%( %h%m%r%y%)"
opt.wildoptions = { "fuzzy" }
-- keymaps --------------------------------------------------------------------- -- keymaps ---------------------------------------------------------------------
@ -84,4 +110,17 @@ keymap_set("n", "<c-h>", "<c-w>h")
keymap_set("n", "<c-j>", "<c-w>j") keymap_set("n", "<c-j>", "<c-w>j")
keymap_set("n", "<c-k>", "<c-w>k") keymap_set("n", "<c-k>", "<c-w>k")
keymap_set("n", "<c-l>", "<c-w>l") keymap_set("n", "<c-l>", "<c-w>l")
keymap_set("n", "<leader>.", "<cmd>e.<cr>") keymap_set("n", "<leader>.", "<cmd>edit.<cr>")
-- buffer autocomplete ---------------------------------------------------------
api.nvim_create_autocmd("InsertCharPre", {
group = api.nvim_create_augroup("Buffer autocompletion", {}),
desc = "Buffer autocomplete on InsertCharPre",
callback = function ()
if fn.pumvisible() == 0 and v.char:find("%w") then
api.nvim_input("<c-n>")
end
end
})

View File

@ -46,6 +46,10 @@ set $swaylock swaylock -f \
--text-ver-color=#00000000 \ --text-ver-color=#00000000 \
--text-wrong-color=#00000000 --text-wrong-color=#00000000
# strings
set $mounted "Mounted %f at %d"
set $unmounted "Unmounted %s"
# bar ########################################################################## # bar ##########################################################################
bar { bar {
separator_symbol " | " separator_symbol " | "
@ -142,10 +146,10 @@ bindsym {
XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
XF86MonBrightnessUp exec brightnessctl set "+1%", exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" XF86MonBrightnessUp exec brightnessctl -n set +1%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86MonBrightnessDown exec brightnessctl set "1%-", exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" XF86MonBrightnessDown exec brightnessctl -n set 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessUp exec brightnessctl set "+10%", exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" shift+XF86MonBrightnessUp exec brightnessctl -n set +10%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessDown exec brightnessctl set "10%-", exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" shift+XF86MonBrightnessDown exec brightnessctl -n set 10%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
} }
# resize # resize
@ -188,8 +192,9 @@ default_floating_border normal 0
# exec ######################################################################### # exec #########################################################################
exec { exec {
# systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
# dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
swayidle -w \ swayidle -w \
timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \ timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \
timeout 600 '$swaylock' \ timeout 600 '$swaylock' \
@ -197,10 +202,10 @@ exec {
timeout 1800 'systemctl suspend-then-hibernate' \ timeout 1800 'systemctl suspend-then-hibernate' \
before-sleep '$swaylock' before-sleep '$swaylock'
wlsunset -l 45 -L 15 wlsunset -l 45 -L 15
mako mako --max-visible=0
devmon \ devmon \
--exec-on-drive "notify-send 'Mounted %f at %d'" \ --exec-on-drive 'notify-send "Mounted %f at %d"' \
--exec-on-unmount "notify-send 'Unmounted %s'" --exec-on-unmount 'notify-send "Unmounted %f"'
foot -s foot -s
} }
@ -215,7 +220,7 @@ font monospace 13
# keyboard # keyboard
input "type:keyboard" { input "type:keyboard" {
xkb_layout us,si xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle xkb_options caps:escape,grp:alt_shift_toggle,compose:ralt
repeat_delay 200 repeat_delay 200
repeat_rate 30 repeat_rate 30
} }

View File

@ -4,39 +4,33 @@ printf "{\"version\":1}\n"
printf "[\n" printf "[\n"
if ! command -v jq >/dev/null; then if ! command -v jq >/dev/null; then
while true; do while :; do
printf '[{ "full_text":"jq: command not found", "urgent":true },],' printf '[{ "full_text":"jq: command not found", "urgent":true },],'
sleep 1 sleep 60
done done
fi fi
while true; do while :; do
printf "[" printf "["
# keyboard layout # keyboard layout
swaymsg -t get_inputs | jq -Mcj '[.[] | select(.type=="keyboard")][0] | swaymsg -t get_inputs | jq -Mcj '[.[] | select(.type=="keyboard")][0] | {
{
"full_text":.xkb_active_layout_name, "full_text":.xkb_active_layout_name,
"urgent":.xkb_active_layout_index, "urgent":.xkb_active_layout_index,
}, ","' }, ","'
# battery # battery
# shellcheck disable=SC2002 # shellcheck disable=SC2002
cat /sys/class/power_supply/BAT0/capacity | jq -Mcj ' cat /sys/class/power_supply/BAT0/capacity | jq -Mcj '
if .<20 then if .<20 then {
{
"full_text":([.," %"]|join("")), "full_text":([.," %"]|join("")),
"urgent":true, "urgent":true,
} } else {
else
{
"full_text":([.," %"]|join("")), "full_text":([.," %"]|join("")),
} } end, ","'
end, ","'
# date # date
date +%c | jq -RMcj '{ "full_text":., }, ","' date +%c | jq -RMcj '{ "full_text":., }, ","'
# scratchpad # scratchpad
swaymsg -t get_tree | jq -Mcj '.nodes[] | select(.name=="__i3").nodes[] | swaymsg -t get_tree | jq -Mcj '.nodes[] | select(.name=="__i3").nodes[] |
select(.name=="__i3_scratch").floating_nodes | select(.name=="__i3_scratch").floating_nodes | {
{
"full_text":length, "full_text":length,
"urgent":length, "urgent":length,
}, ","' }, ","'
@ -46,9 +40,10 @@ while true; do
"full_text":(["(",length,") ",.[0].summary.data]|join("")), "full_text":(["(",length,") ",.[0].summary.data]|join("")),
"urgent":(.[0].urgency.data==2), "urgent":(.[0].urgency.data==2),
} else { } else {
"full_text":(["(",length,")"]|join("")), "full_text":"(0)",
} end, ","' } end, ","'
printf "]," printf "],"
# timeout # timeout
timeout 1 swaymsg -t subscribe '["input","binding"]' >/dev/null timeout 1 swaymsg -t subscribe '["input","binding"]' >/dev/null
sleep 0.02
done done

View File

@ -19,15 +19,15 @@ if [ -d "$HOME/.local/bin" ]; then
fi fi
# xdg base directory specification # xdg base directory specification
export XDG_CONFIG_HOME=$HOME/.config export XDG_CONFIG_HOME="$HOME"/.config
export XDG_CACHE_HOME=$HOME/.cache export XDG_CACHE_HOME="$HOME"/.cache
export XDG_DATA_HOME=$HOME/.local/share export XDG_DATA_HOME="$HOME"/.local/share
export XDG_STATE_HOME=$HOME/.local/state export XDG_STATE_HOME="$HOME"/.local/state
export XDG_DATA_DIRS=/usr/local/share:/usr/share export XDG_DATA_DIRS=/usr/local/share:/usr/share
export XDG_CONFIG_DIRS=/etc/xdg export XDG_CONFIG_DIRS=/etc/xdg
# .bash_history # .bash_history
export HISTFILE=$XDG_STATE_HOME/bash/history export HISTFILE="$XDG_STATE_HOME"/bash/history
if [ ! -d "$(dirname "${HISTFILE}")" ]; then if [ ! -d "$(dirname "${HISTFILE}")" ]; then
mkdir -p "$(dirname "${HISTFILE}")" mkdir -p "$(dirname "${HISTFILE}")"
fi fi
@ -45,5 +45,6 @@ if [ "$(tty)" = "/dev/tty1" ] && command -v sway >/dev/null; then
export BROWSER=firefox export BROWSER=firefox
# run sway # run sway
export XDG_CURRENT_DESKTOP=sway export XDG_CURRENT_DESKTOP=sway
export WLR_RENDERER=vulkan
exec systemd-cat --identifier sway sway exec systemd-cat --identifier sway sway
fi fi

View File

@ -23,16 +23,16 @@ rm .sudo_as_admin_successful
sudo cp -ri .config/apt /etc/ sudo cp -ri .config/apt /etc/
sudo apt update sudo apt update
sudo apt full-upgrade sudo apt full-upgrade
# reconfigure locales
sudo dpkg-reconfigure locales
# configure and start firewall # configure and start firewall
sudo cp -ri .config/nftables.conf /etc/ sudo cp -ri .config/nftables.conf /etc/
systemctl enable --now nftables systemctl enable --now nftables
# configure and install networking # configure and install networking
sudo apt install network-manager sudo apt install network-manager
# install utils # install utils
sudo apt install git
sudo apt install udevil sudo apt install udevil
sudo apt install jq sudo apt install jq
sudo apt install tlp
sudo apt install neovim wl-clipboard sudo apt install neovim wl-clipboard
# install desktop packages # install desktop packages
sudo apt install sway swayidle swaylock sudo apt install sway swayidle swaylock
@ -42,16 +42,18 @@ sudo apt install mako-notifier libnotify-bin
sudo apt install fonts-agave sudo apt install fonts-agave
sudo apt install pipewire-audio sudo apt install pipewire-audio
systemctl --user enable --now wireplumber systemctl --user enable --now wireplumber
# install office packages
sudo apt install libreoffice libreoffice-gtk3
sudo apt install aspell-sl hunspell-sl hyphen-sl mythes-sl
# install web packages # install web packages
sudo apt install firefox sudo apt install firefox
sudo apt install thunderbird sudo apt install thunderbird
# install office packages
sudo apt install libreoffice libreoffice-gtk3
sudo apt install aspell-sl hunspell-sl hyphen-sl mythes-sl
# install media packages # install media packages
sudo apt install mpv sudo apt install mpv
sudo apt install zathura sudo apt install zathura
sudo apt install inkscape sudo apt install inkscape
sudo apt install blender
sudo apt install scribus
# install rdp packages # install rdp packages
sudo apt install remmina sudo apt install remmina
# install printing and scanning packages # install printing and scanning packages
@ -61,8 +63,8 @@ sudo apt install simple-scan
# install writing packages # install writing packages
sudo apt install make sudo apt install make
sudo apt install pandoc sudo apt install pandoc
sudo apt install texlive-latex-extra #sudo apt install texlive-latex-extra
sudo apt install texlive-lang-european #sudo apt install texlive-lang-european
# install pdf processing packages # install pdf processing packages
sudo apt install qpdf ocrmypdf #sudo apt install qpdf ocrmypdf
``` ```