added nvim, swaylock config; updated river config

This commit is contained in:
Alexey 2025-06-23 18:46:36 +03:00
commit 09a12619c0
4 changed files with 133 additions and 9 deletions

View file

@ -2,9 +2,10 @@
## Packages ## Packages
``` ```
$ sudo pacman -S river lua lua-posix kanshi \ $ sudo pacman -S river lua lua-posix kanshi \
waylock swaybg alacritty wofi \ swaylock swaybg alacritty wofi \
slurp grim wl-clipboard waybar \ slurp grim wl-clipboard waybar \
mpd mpc vimix-cursors fish mpd mpc vimix-cursors fish nvim \
fetchmail procmail notmuch alot
``` ```
## Setup ## Setup
In config root directory run: In config root directory run:
@ -13,8 +14,6 @@ $ fish ./setup.fish
``` ```
This will create symlinks to config files in inner directories. This will create symlinks to config files in inner directories.
Do not move files, otherwise symlinks won't work.
To remove symlinks run: To remove symlinks run:
``` ```
$ fish ./clean.fish $ fish ./clean.fish

30
nvim/init.lua Normal file
View file

@ -0,0 +1,30 @@
vim.o.number = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true
vim.o.smartindent = true
vim.o.cursorline = true
vim.cmd( 'syntax enable' )
vim.cmd( 'filetype plugin indent on' )
vim.cmd( 'colorscheme slate' )
vim.cmd [[
highlight Normal guibg=NONE ctermbg=NONE
highlight NonText guibg=NONE ctermbg=NONE
highlight EndOfBuffer guibg=NONE ctermbg=NONE
]]
vim.cmd [[
call plug#begin()
Plug 'preservim/nerdtree'
Plug 'neovim/nvim-lspconfig'
call plug#end()
]]
vim.lsp.enable( 'lua_ls' )
vim.lsp.enable( 'rust_analyzer' )
vim.g.mapleader = ' '
vim.api.nvim_set_keymap( 'n', '<Leader>w', ':w<CR>', { noremap = true, silent = true } )

View file

@ -16,8 +16,8 @@ end
-- All the setting tables ────────────────────────────────────────────────────── -- All the setting tables ──────────────────────────────────────────────────────
local wallpapers = { local wallpapers = {
primary = '~/Pictures/wallpaper/1772658.jpg', primary = '~/Pictures/wallpaper/leafeon.jpg',
secondary = '~/Pictures/wallpaper/83D9B0BF750C2763F9126AAAEF23F3DB3D3A6328-3688606028.png' secondary = '~/Pictures/wallpaper/phoenix.png'
} }
local monitors = { local monitors = {
@ -50,6 +50,16 @@ local startup_commands = {
string.format("swaybg -o %s -i %s -o %s -i %s", string.format("swaybg -o %s -i %s -o %s -i %s",
monitors.main, wallpapers.primary, monitors.main, wallpapers.primary,
monitors.external, wallpapers.secondary) monitors.external, wallpapers.secondary)
},
-- Fetch mail
{
'fetchmail',
'-d', '600'
},
-- Update notmuch database
{
'notmuch',
'new'
} }
} }
@ -117,17 +127,29 @@ local mappings = {
key = 'Escape', key = 'Escape',
command = { 'spawn', [['wofi --show drun']] } command = { 'spawn', [['wofi --show drun']] }
}, },
-- Screenshot -- Region screenshot
{ {
mod = { 'Super', 'Shift' }, mod = { 'Super', 'Shift' },
key = 'S', key = 'S',
command = { 'spawn', [['slurp | grim -g - - | wl-copy']] } command = { 'spawn', [['slurp | grim -g - - | wl-copy']] }
}, },
-- Output screenshot
{
mod = 'None',
key = 'Print',
command = { 'spawn', [['slurp -o | grim -g - - | wl-copy']] }
},
-- Screen locker -- Screen locker
{ {
mod = 'Super', mod = 'Super',
key = 'O', key = 'O',
command = { 'spawn', [['waylock -init-color 0x352e2c -input-color 0x575e7a -fail-color 0x833b18']] } command = { 'spawn', [['swaylock -i ']] .. wallpapers.primary }
},
-- Prompt wifi ssid and attempt to connect
{
mod = { 'Super', 'Alt' },
key = 'C',
command = { 'spawn', [['gui-prompt | fish -c wlan-connect']]}
}, },
-- Close view -- Close view
{ {
@ -250,7 +272,7 @@ local mappings = {
{ {
mod = 'None', mod = 'None',
key = 'XF86AudioNext', key = 'XF86AudioNext',
command = { 'spawn', [['mpc next && mpc toggle']] } command = { 'spawn', [['mpc next']] }
}, },
{ {
mod = 'None', mod = 'None',
@ -302,6 +324,18 @@ local function tag_mappings()
os.execute(string.format('riverctl map normal Super+Shift 0 set-view-tags %s', all_tags)) os.execute(string.format('riverctl map normal Super+Shift 0 set-view-tags %s', all_tags))
end end
-- Window rules
local window_rules = {
{
app_id = "gui-prompt",
rule = "float"
},
{
app_id = "gui-prompt",
rule = "ssd"
}
}
-- Apply settings ────────────────────────────────────────────────────────────── -- Apply settings ──────────────────────────────────────────────────────────────
for _, cmd in ipairs(startup_commands) do for _, cmd in ipairs(startup_commands) do
@ -372,6 +406,19 @@ end
-- Mappings for tag management -- Mappings for tag management
tag_mappings() tag_mappings()
for _, rule in ipairs(window_rules) do
local cmd = "riverctl rule-add "
if rule.app_id ~= nil then
cmd = cmd .. "-app-id " .. rule.app_id
end
if rule.title ~= nil then
cmd = cmd .. "-title " .. rule.title
end
cmd = cmd .. " " .. rule.rule
os.execute(cmd)
end
-- Launch the layout generator as the final initial process. -- Launch the layout generator as the final initial process.
local unistd = require('posix.unistd') local unistd = require('posix.unistd')
unistd.execp('rivertile', { unistd.execp('rivertile', {

48
swaylock/config Normal file
View file

@ -0,0 +1,48 @@
ignore-empty-password
show-keyboard-layout
show-failed-attempts
indicator-caps-lock
indicator-idle-visible
indicator-radius=60
inside-color=28a09cb2
inside-clear-color=60ccd8b2
inside-caps-lock-color=ddab6cb2
inside-ver-color=ff7c77b2
inside-wrong-color=f22c57b2
key-hl-color=2ebdbb
caps-lock-key-hl-color=ffc66a
bs-hl-color=ff4772
caps-lock-bs-hl-color=ff4772
separator-color=00000000
ring-color=28a09c
ring-clear-color=5cc6d1
ring-caps-lock-color=ddab5c
ring-ver-color=df635d
ring-wrong-color=fd3762
line-color=000000b2
line-clear-color=000000b2
line-caps-lock-color=000000b2
line-ver-color=000000b2
line-wrong-color=000000b2
text-color=000000
text-clear-color=000000
text-caps-lock-color=000000
text-ver-color=000000
text-wrong-color=000000
layout-bg-color=2c3746b2
layout-border-color=81a1c1
scaling=stretch
font=SourceCodePro
font-size=18