Compare commits
10 Commits
14159884fa
...
28b8b35561
| Author | SHA1 | Date | |
|---|---|---|---|
| 28b8b35561 | |||
| d6c0cc2358 | |||
| a8452abee8 | |||
| 8fafb14b77 | |||
| c37b908c12 | |||
| 47d6d42a38 | |||
| dcfff8dbbf | |||
| b1d05220ae | |||
| b1f1ff8545 | |||
| 8129a8a2f3 |
79
.config/alacritty/alacritty.toml
Normal file
79
.config/alacritty/alacritty.toml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
[colors.bright]
|
||||||
|
black = "#6272a4"
|
||||||
|
blue = "#d6acff"
|
||||||
|
cyan = "#a4ffff"
|
||||||
|
green = "#69ff94"
|
||||||
|
magenta = "#ff92df"
|
||||||
|
red = "#ff6e6e"
|
||||||
|
white = "#ffffff"
|
||||||
|
yellow = "#ffffa5"
|
||||||
|
|
||||||
|
[colors.cursor]
|
||||||
|
cursor = "CellForeground"
|
||||||
|
text = "CellBackground"
|
||||||
|
|
||||||
|
[colors.footer_bar]
|
||||||
|
background = "#282a36"
|
||||||
|
foreground = "#f8f8f2"
|
||||||
|
|
||||||
|
[colors.hints.end]
|
||||||
|
background = "#282a36"
|
||||||
|
foreground = "#f1fa8c"
|
||||||
|
|
||||||
|
[colors.hints.start]
|
||||||
|
background = "#f1fa8c"
|
||||||
|
foreground = "#282a36"
|
||||||
|
|
||||||
|
[colors.line_indicator]
|
||||||
|
background = "None"
|
||||||
|
foreground = "None"
|
||||||
|
|
||||||
|
[colors.normal]
|
||||||
|
black = "#21222c"
|
||||||
|
blue = "#bd93f9"
|
||||||
|
cyan = "#8be9fd"
|
||||||
|
green = "#50fa7b"
|
||||||
|
magenta = "#ff79c6"
|
||||||
|
red = "#ff5555"
|
||||||
|
white = "#f8f8f2"
|
||||||
|
yellow = "#f1fa8c"
|
||||||
|
|
||||||
|
[colors.primary]
|
||||||
|
background = "#282a36"
|
||||||
|
bright_foreground = "#ffffff"
|
||||||
|
foreground = "#f8f8f2"
|
||||||
|
|
||||||
|
[colors.search.focused_match]
|
||||||
|
background = "#ffb86c"
|
||||||
|
foreground = "#44475a"
|
||||||
|
|
||||||
|
[colors.search.matches]
|
||||||
|
background = "#11aa7b"
|
||||||
|
foreground = "#44475a"
|
||||||
|
|
||||||
|
[colors.selection]
|
||||||
|
background = "#44475a"
|
||||||
|
text = "CellForeground"
|
||||||
|
|
||||||
|
[colors.vi_mode_cursor]
|
||||||
|
cursor = "CellForeground"
|
||||||
|
text = "CellBackground"
|
||||||
|
|
||||||
|
[font]
|
||||||
|
size = 10
|
||||||
|
|
||||||
|
[font.bold]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Bold"
|
||||||
|
|
||||||
|
[font.bold_italic]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Bold Italic"
|
||||||
|
|
||||||
|
[font.italic]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Italic"
|
||||||
|
|
||||||
|
[font.normal]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Regular"
|
||||||
@ -32,6 +32,9 @@ require("nvim-tree").setup({
|
|||||||
dotfiles = false,
|
dotfiles = false,
|
||||||
custom = { "^.git$" },
|
custom = { "^.git$" },
|
||||||
},
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- mason
|
-- mason
|
||||||
|
|||||||
@ -1,27 +1,41 @@
|
|||||||
-- FUNCTIONS --
|
-- FUNCTIONS --
|
||||||
|
|
||||||
-- all language functions
|
-- all language functions
|
||||||
vim.cmd [[
|
require('func.utils')
|
||||||
augroup lang_all
|
require('func.tabline')
|
||||||
autocmd!
|
require('func.popterm')
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/utils.lua
|
require('func.sessions')
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/tabline.lua
|
require('func.findfile')
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/popterm.lua
|
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/sessions.lua
|
-- vim.cmd [[
|
||||||
augroup END
|
-- augroup lang_all
|
||||||
]]
|
-- autocmd!
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/utils.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/tabline.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/popterm.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/sessions.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/findfile.lua
|
||||||
|
-- augroup END
|
||||||
|
-- ]]
|
||||||
|
|
||||||
-- puppet language keybindings
|
-- puppet language keybindings
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
augroup lang_puppet
|
augroup lang_puppet
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gg :call OpenPuppetClassOrTemplate(tab)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gg :call OpenPuppetClassOrTemplate('tab')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gt :call OpenPuppetClassOrTemplate(tab)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gt :call OpenPuppetClassOrTemplate('tab')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gh :call OpenPuppetClassOrTemplate(horizontal)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gh :call OpenPuppetClassOrTemplate('horizontal')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gv :call OpenPuppetClassOrTemplate(vertical)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gv :call OpenPuppetClassOrTemplate('vertical')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>t :call OpenPuppetTestMode()<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>t :call OpenPuppetTestMode()<CR>
|
||||||
autocmd BufNewFile site/roles/manifests/**.pp call ApplyPuppetTemplate()
|
autocmd BufNewFile site/roles/manifests/**.pp call ApplyPuppetTemplate()
|
||||||
autocmd BufNewFile site/profiles/manifests/**.pp call ApplyPuppetTemplate()
|
autocmd BufNewFile site/profiles/manifests/**.pp call ApplyPuppetTemplate()
|
||||||
augroup END
|
augroup END
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
-- erb/eruby language keybindings
|
||||||
|
vim.cmd [[
|
||||||
|
augroup lang_eruby
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType eruby nnoremap <buffer> <Leader>s :call ToggleERBSyntax()<CR>
|
||||||
|
augroup END
|
||||||
|
]]
|
||||||
|
|||||||
95
.config/nvim/lua/func/findfile.lua
Normal file
95
.config/nvim/lua/func/findfile.lua
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
let g:previous_buffer = 0
|
||||||
|
|
||||||
|
function! FindFile(searchType)
|
||||||
|
" Store the buffer number of the current window
|
||||||
|
let g:previous_buffer = bufnr('%')
|
||||||
|
|
||||||
|
" Prompt user for search pattern
|
||||||
|
let pattern = input('Enter search pattern: ')
|
||||||
|
let keywords = split(pattern)
|
||||||
|
" Construct a regex pattern for flexible matching in paths
|
||||||
|
let regex_pattern = join(map(keywords, 'escape(v:val, "\\/$.*[~")'), '.*')
|
||||||
|
|
||||||
|
" Initialize an empty list for results
|
||||||
|
let results = []
|
||||||
|
|
||||||
|
" Find in file content
|
||||||
|
if a:searchType ==# 'string' || a:searchType ==# 'all'
|
||||||
|
let cmd_content = "rg --column --no-heading --color=never -l " . shellescape(pattern)
|
||||||
|
let results_content = systemlist(cmd_content)
|
||||||
|
let results = results + results_content
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Find in file path with the constructed regex pattern
|
||||||
|
if a:searchType ==# 'path' || a:searchType ==# 'all'
|
||||||
|
" Use the regex pattern for searching in paths
|
||||||
|
let cmd_path = "rg --files | grep -P '" . regex_pattern . "'"
|
||||||
|
let results_path = systemlist(cmd_path)
|
||||||
|
let results = results + results_path
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Remove duplicates and sort the results
|
||||||
|
let results = sort(uniq(results))
|
||||||
|
|
||||||
|
if empty(results)
|
||||||
|
echo "No files found for pattern: " . pattern
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Open a new split window at the bottom
|
||||||
|
new
|
||||||
|
" Set the height of the new split window
|
||||||
|
resize 10
|
||||||
|
|
||||||
|
" Set the buffer to be unlisted, no swapfile
|
||||||
|
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
|
||||||
|
|
||||||
|
" Clear the 'readonly' option in case it's set by default
|
||||||
|
setlocal noreadonly
|
||||||
|
|
||||||
|
" Populate the buffer with the search results
|
||||||
|
call setline(1, results)
|
||||||
|
|
||||||
|
" Make the buffer read-only after populating it
|
||||||
|
setlocal readonly
|
||||||
|
|
||||||
|
" Map keys to open files in different modes
|
||||||
|
nnoremap <silent> <buffer> <CR> :call OpenFile('edit', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> v :call OpenFile('vsplit', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> h :call OpenFile('split', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> t :call OpenFile('tabedit', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> q :close<CR>
|
||||||
|
|
||||||
|
" Focus on the results window
|
||||||
|
normal! G
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! OpenFile(openType, bufnr)
|
||||||
|
" Extract the file path from the current line
|
||||||
|
let file_path = getline('.')
|
||||||
|
if filereadable(file_path)
|
||||||
|
" Save the current buffer number
|
||||||
|
let current_bufnr = bufnr('%')
|
||||||
|
" Close the search results window
|
||||||
|
bd!
|
||||||
|
" Switch to the buffer that was active before the search
|
||||||
|
execute 'buffer' g:previous_buffer
|
||||||
|
" Open the file based on the specified openType
|
||||||
|
execute a:openType . ' ' . file_path
|
||||||
|
" If opening in a new tab, switch back to the original buffer in the new tab
|
||||||
|
if a:openType == 'tabnew'
|
||||||
|
execute 'tabnext'
|
||||||
|
execute 'buffer' . current_bufnr
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
echo "File does not exist or cannot be read"
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <Leader>ff :call FindFile("string")<CR>
|
||||||
|
nnoremap <Leader>fs :call FindFile("string")<CR>
|
||||||
|
nnoremap <Leader>fp :call FindFile("path")<CR>
|
||||||
|
nnoremap <Leader>fa :call FindFile("all")<CR>
|
||||||
|
|
||||||
|
]])
|
||||||
@ -29,10 +29,10 @@ vim.cmd([[
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Define the :Popterm command to open the centered terminal
|
" Define the :Popterm command to open the centered terminal
|
||||||
command! Popterm call OpenCenteredTerminal()
|
|
||||||
highlight Terminal guibg=#000000 guifg=none
|
highlight Terminal guibg=#000000 guifg=none
|
||||||
|
"autocmd TermOpen * setlocal winhighlight=Normal:Terminal
|
||||||
|
command! Popterm call OpenCenteredTerminal()
|
||||||
nnoremap T :Popterm<CR>
|
nnoremap T :Popterm<CR>
|
||||||
autocmd TermOpen * setlocal winhighlight=Normal:Terminal
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
]])
|
]])
|
||||||
|
|||||||
@ -116,19 +116,19 @@ endfunction
|
|||||||
|
|
||||||
-- open puppet resource
|
-- open puppet resource
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
function! OpenPuppetClassOrTemplate()
|
function! OpenPuppetClassOrTemplate(layout)
|
||||||
" Get the line under the cursor
|
" Get the line under the cursor
|
||||||
let line = getline(".")
|
let line = getline(".")
|
||||||
|
|
||||||
" Check if it's a template (erb or epp)
|
" Check if it's a template (erb or epp)
|
||||||
if line =~ 'profiles\/.*\.\(erb\|epp\)'
|
if line =~ 'profiles\/.*\.\(erb\|epp\)'
|
||||||
call OpenPuppetTemplate()
|
call OpenPuppetTemplate(a:layout)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Check if it's an included class (profiles:: or roles::)
|
" Check if it's an included class (profiles:: or roles::)
|
||||||
if line =~ '\(profiles\|roles\)::'
|
if line =~ '\(profiles\|roles\)::'
|
||||||
call OpenPuppetProfileOrRole()
|
call OpenPuppetProfileOrRole(a:layout)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -187,3 +187,55 @@ function! ApplyPuppetTemplate()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
|
function! ToggleERBSyntax()
|
||||||
|
if !exists('b:original_syntax')
|
||||||
|
" If b:original_syntax is not set, default to eruby and store the current syntax
|
||||||
|
let b:original_syntax = &filetype
|
||||||
|
setlocal syntax=eruby
|
||||||
|
else
|
||||||
|
" If b:original_syntax is set, toggle the syntax based on the current setting
|
||||||
|
if &syntax == 'eruby'
|
||||||
|
" Extract the base file type from the file name
|
||||||
|
let l:filename = expand('%:t')
|
||||||
|
let l:base_filetype = matchstr(l:filename, '\v%(\.\w+)?\.erb$')
|
||||||
|
let l:base_filetype = substitute(l:base_filetype, '\.erb$', '', '')
|
||||||
|
let l:base_filetype = substitute(l:base_filetype, '^.', '', '')
|
||||||
|
|
||||||
|
" Determine the syntax based on the base file type
|
||||||
|
if l:base_filetype == 'sh'
|
||||||
|
setlocal syntax=sh
|
||||||
|
elseif l:base_filetype == 'py'
|
||||||
|
setlocal syntax=python
|
||||||
|
elseif l:base_filetype == 'pl'
|
||||||
|
setlocal syntax=perl
|
||||||
|
elseif l:base_filetype == 'yml' || l:base_filetype == 'yaml'
|
||||||
|
setlocal syntax=yaml
|
||||||
|
else
|
||||||
|
" Attempt to guess the syntax from the shebang if unknown
|
||||||
|
let l:firstline = getline(1)
|
||||||
|
if l:firstline =~# '^#!.*\/bash'
|
||||||
|
setlocal syntax=sh
|
||||||
|
elseif l:firstline =~# '^#!.*\/zsh'
|
||||||
|
setlocal syntax=sh
|
||||||
|
elseif l:firstline =~# '^#!.*\/python'
|
||||||
|
setlocal syntax=python
|
||||||
|
elseif l:firstline =~# '^#!.*\/perl'
|
||||||
|
setlocal syntax=perl
|
||||||
|
else
|
||||||
|
" Fallback to eruby syntax if no known type is found
|
||||||
|
echo "Could not swap syntax highlighter; falling back to eruby."
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" If the current syntax is not eruby, revert to the original syntax
|
||||||
|
setlocal syntax=eruby
|
||||||
|
echo "Switched back to eruby syntax."
|
||||||
|
endif
|
||||||
|
" Reset b:original_syntax to indicate the syntax has been toggled back
|
||||||
|
unlet b:original_syntax
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
]])
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
|
let g:session_dir = expand('~/.cache/nvim/sessions/')
|
||||||
|
if !isdirectory(g:session_dir)
|
||||||
|
call mkdir(g:session_dir, "p")
|
||||||
|
endif
|
||||||
|
|
||||||
command! SaveSession call SaveSession()
|
command! SaveSession call SaveSession()
|
||||||
function! SaveSession()
|
function! SaveSession()
|
||||||
let session_file = g:session_dir . GetRepositoryName() . '_' . GetCurrentGitBranch() . '.vim'
|
let session_file = g:session_dir . GetRepositoryName() . '_' . GetCurrentGitBranch() . '.vim'
|
||||||
|
|||||||
@ -48,6 +48,6 @@ map('n', 'ff', [[:Telescope find_files]], {})
|
|||||||
-- map('n', 'T', ':lua require("FTerm").toggle()<CR>', {})
|
-- map('n', 'T', ':lua require("FTerm").toggle()<CR>', {})
|
||||||
|
|
||||||
-- Open a file in a vertical split, horizontal split and move a split to a new tab
|
-- Open a file in a vertical split, horizontal split and move a split to a new tab
|
||||||
map('n', '<Leader>sv', ':vsplit ', {noremap = true, silent = false})
|
map('n', '<Leader>ov', ':vsplit ', {noremap = true, silent = false})
|
||||||
map('n', '<Leader>sh', ':split ', {noremap = true, silent = false})
|
map('n', '<Leader>oh', ':split ', {noremap = true, silent = false})
|
||||||
map('n', '<Leader>mt', ':tabedit %<CR>', {noremap = true, silent = true})
|
map('n', '<Leader>mt', ':tabedit %<CR>', {noremap = true, silent = true})
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 8bafa7394bfcb8cfbafc43190be64cee6e70aa7c
|
Subproject commit 3546217b65c837617d7bdb467054bbb4b6122a98
|
||||||
@ -14,6 +14,18 @@ fi
|
|||||||
export ANSIBLE_NOCOWS=1
|
export ANSIBLE_NOCOWS=1
|
||||||
export ANSIBLE_VAULT_PASSWORD_FILE=$HOME/.local/bin/ansible-vault-pass-client
|
export ANSIBLE_VAULT_PASSWORD_FILE=$HOME/.local/bin/ansible-vault-pass-client
|
||||||
|
|
||||||
|
# VAULT
|
||||||
|
export VAULT_ADDR=https://vault.service.consul:8200
|
||||||
|
vaultlogin () {
|
||||||
|
vault login $(pass show personal/vault/syd1/token)
|
||||||
|
}
|
||||||
|
|
||||||
|
# CONSUL: https://developer.hashicorp.com/consul/commands
|
||||||
|
export CONSUL_HTTP_ADDR=consul.service.consul
|
||||||
|
export CONSUL_HTTP_TOKEN_FILE=$HOME/.config/consul/token.secret
|
||||||
|
export CONSUL_HTTP_SSL=true
|
||||||
|
export CONSUL_HTTP_SSL_VERIFY=true
|
||||||
|
|
||||||
# set MPD host
|
# set MPD host
|
||||||
export MPD_HOST="$HOME/.config/mpd/socket"
|
export MPD_HOST="$HOME/.config/mpd/socket"
|
||||||
|
|
||||||
@ -54,6 +66,10 @@ ytpl-export () {yt-dlp -j --flat-playlist "$1" | jq -r '.id' | sed 's_^_https://
|
|||||||
# common date format
|
# common date format
|
||||||
shdate () {date +'%Y%m%d'}
|
shdate () {date +'%Y%m%d'}
|
||||||
|
|
||||||
|
ncurl() {
|
||||||
|
curl --netrc-file <(pass show personal/netrc) "$@"
|
||||||
|
}
|
||||||
|
|
||||||
# create function later:
|
# create function later:
|
||||||
# large image heavy pdf into smaller pdf
|
# large image heavy pdf into smaller pdf
|
||||||
# below will:
|
# below will:
|
||||||
|
|||||||
334
.config/sway/config
Normal file
334
.config/sway/config
Normal file
@ -0,0 +1,334 @@
|
|||||||
|
# Default config for sway
|
||||||
|
#
|
||||||
|
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||||
|
#
|
||||||
|
# Read `man 5 sway` for a complete reference.
|
||||||
|
|
||||||
|
|
||||||
|
set $mod Mod4
|
||||||
|
set $term alacritty
|
||||||
|
set $termalt xfce4-terminal
|
||||||
|
set $web firefox
|
||||||
|
set $file ranger
|
||||||
|
set $lock slock
|
||||||
|
set $code codium
|
||||||
|
set $guieditor geany
|
||||||
|
set $calc /home/ben/.local/bin/bc-launcher
|
||||||
|
set $music /home/ben/.local/bin/ncmpcpp-launcher
|
||||||
|
|
||||||
|
|
||||||
|
# Your preferred application launcher
|
||||||
|
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||||
|
# on the original workspace that the command was run on.
|
||||||
|
set $menu dmenu_path | dmenu | xargs swaymsg exec --
|
||||||
|
|
||||||
|
### Output configuration
|
||||||
|
#
|
||||||
|
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||||
|
output * bg /usr/share/backgrounds/default.png fill
|
||||||
|
|
||||||
|
|
||||||
|
### Idle configuration
|
||||||
|
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||||
|
# your displays after another 300 seconds, and turn your screens back on when
|
||||||
|
# resumed. It will also lock your screen before your computer goes to sleep.
|
||||||
|
exec swayidle -w \
|
||||||
|
timeout 300 'swaylock -f -c 000000' \
|
||||||
|
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||||
|
before-sleep 'swaylock -f -c 000000'
|
||||||
|
|
||||||
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
|
# is used in the bar {} block below.
|
||||||
|
font pango:monospace 8
|
||||||
|
|
||||||
|
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||||
|
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||||
|
#font pango:DejaVu Sans Mono 8
|
||||||
|
|
||||||
|
# network manager applet: manage wifi, ethernet and vpns
|
||||||
|
exec --no-startup-id nm-applet
|
||||||
|
|
||||||
|
# bluetooth manager applet: manage bluetooth pairing and connections
|
||||||
|
#exec --no-startup-id blueman-applet
|
||||||
|
|
||||||
|
# udiskie: manage usb storage devices
|
||||||
|
exec --no-startup-id udiskie -a -n -t
|
||||||
|
|
||||||
|
# dunst: a notification daemon
|
||||||
|
exec --no-startup-id dunst
|
||||||
|
|
||||||
|
# Audio controls
|
||||||
|
# Use pamixer to adjust volume in PulseAudio.
|
||||||
|
bindsym --locked XF86AudioRaiseVolume exec pamixer --increase 5
|
||||||
|
bindsym --locked XF86AudioLowerVolume exec pamixer --decrease 5
|
||||||
|
bindsym --locked XF86AudioMute exec pamixer --toggle-mute
|
||||||
|
bindsym XF86AudioMicMute exec pamixer --toggle-mute --default-source
|
||||||
|
bindsym --locked $mod+greater exec pamixer --increase 5
|
||||||
|
bindsym --locked $mod+less exec pamixer --decrease 5
|
||||||
|
|
||||||
|
# backlight brightness
|
||||||
|
bindsym XF86MonBrightnessDown exec brightnessctl set 5%- # decrease screen brightness
|
||||||
|
bindsym XF86MonBrightnessUp exec brightnessctl set +5% # increase screen brightness
|
||||||
|
bindsym $mod+F8 exec brightnessctl set 5-% # decrease screen brightness
|
||||||
|
bindsym $mod+F9 exec brightnessctl set +5% # increase screen brightness
|
||||||
|
|
||||||
|
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||||
|
floating_modifier $mod
|
||||||
|
|
||||||
|
# start a terminal
|
||||||
|
bindsym $mod+Return exec $term
|
||||||
|
bindsym $mod+Shift+Return exec $termalt
|
||||||
|
|
||||||
|
# start a web browser
|
||||||
|
bindsym $mod+F1 exec $web
|
||||||
|
|
||||||
|
# start a file manager
|
||||||
|
bindsym $mod+F2 exec $file
|
||||||
|
|
||||||
|
# start an ide
|
||||||
|
bindsym $mod+F3 exec $code
|
||||||
|
|
||||||
|
# start a gui notepad
|
||||||
|
bindsym $mod+F4 exec $guieditor
|
||||||
|
|
||||||
|
# kill focused window
|
||||||
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
|
# start rofi in drun mode (a program launcher)
|
||||||
|
bindsym $mod+d exec --no-startup-id "rofi -show drun -font \\"DejaVu 9\\" -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
|
||||||
|
#bindsym $mod+shift+d exec selected=$(ls ~/rdp/ntschools/|rofi -dmenu -p "Run: ")&&zsh ~/rdp/ntschools/$selected
|
||||||
|
|
||||||
|
|
||||||
|
# A more modern dmenu replacement is rofi:
|
||||||
|
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
|
||||||
|
# There also is i3-dmenu-desktop which only displays applications shipping a
|
||||||
|
# .desktop file. It is a wrapper around dmenu, so you need that installed.
|
||||||
|
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
|
||||||
|
|
||||||
|
# change focus
|
||||||
|
bindsym $mod+Left focus left
|
||||||
|
bindsym $mod+Down focus down
|
||||||
|
bindsym $mod+Up focus up
|
||||||
|
bindsym $mod+Right focus right
|
||||||
|
|
||||||
|
# move focused window
|
||||||
|
bindsym $mod+Shift+Left move left
|
||||||
|
bindsym $mod+Shift+Down move down
|
||||||
|
bindsym $mod+Shift+Up move up
|
||||||
|
bindsym $mod+Shift+Right move right
|
||||||
|
|
||||||
|
# split in horizontal orientation
|
||||||
|
bindsym $mod+h split v ;; exec $term
|
||||||
|
|
||||||
|
# split in vertical orientation
|
||||||
|
bindsym $mod+v split h ;; exec $term
|
||||||
|
|
||||||
|
# enter fullscreen mode for the focused container
|
||||||
|
bindsym $mod+f fullscreen toggle
|
||||||
|
|
||||||
|
# change container layout (stacked, tabbed, toggle split)
|
||||||
|
bindsym $mod+s layout stacking
|
||||||
|
bindsym $mod+w layout tabbed
|
||||||
|
bindsym $mod+e layout toggle split
|
||||||
|
|
||||||
|
# toggle tiling / floating
|
||||||
|
bindsym $mod+Shift+space floating toggle
|
||||||
|
|
||||||
|
# change focus between tiling / floating windows
|
||||||
|
bindsym $mod+space focus mode_toggle
|
||||||
|
|
||||||
|
# focus the parent container
|
||||||
|
bindsym $mod+a focus parent
|
||||||
|
|
||||||
|
# focus the child container
|
||||||
|
bindsym $mod+Shift+a focus child
|
||||||
|
|
||||||
|
# calculator scratchpad
|
||||||
|
bindsym $mod+c [title="calc-launcher"] scratchpad show; [title="calc-launcher"] move position center
|
||||||
|
for_window [title="calc-launcher"] floating enable
|
||||||
|
for_window [title="calc-launcher"] resize set 800 600
|
||||||
|
for_window [title="calc-launcher"] move scratchpad
|
||||||
|
for_window [title="calc-launcher"] border pixel 5
|
||||||
|
exec --no-startup-id $term -T "calc-launcher" -e "$calc"
|
||||||
|
|
||||||
|
# dropdown scratchpad
|
||||||
|
bindsym $mod+x [title="dropdown"] scratchpad show; [title="dropdown"] move position center
|
||||||
|
for_window [title="dropdown"] floating enable
|
||||||
|
for_window [title="dropdown"] resize set 1280 800
|
||||||
|
for_window [title="dropdown"] move scratchpad
|
||||||
|
for_window [title="dropdown"] border pixel 5
|
||||||
|
exec --no-startup-id $term -T "dropdown"
|
||||||
|
|
||||||
|
# music scratchpad
|
||||||
|
bindsym $mod+m [title="music-launcher"] scratchpad show; [title="music-launcher"] move position center
|
||||||
|
for_window [title="music-launcher"] floating enable
|
||||||
|
for_window [title="music-launcher"] resize set 800 600
|
||||||
|
for_window [title="music-launcher"] move scratchpad
|
||||||
|
for_window [title="music-launcher"] border pixel 5
|
||||||
|
exec --no-startup-id $term -T "music-launcher" -e "$music"
|
||||||
|
|
||||||
|
# f5vpn scratchpad
|
||||||
|
bindsym $mod+F10 [title="F5 VPN"] scratchpad show; [title="F5 VPN"] move position center
|
||||||
|
for_window [title="F5 VPN"] floating enable
|
||||||
|
for_window [title="F5 VPN"] resize set 800 600
|
||||||
|
for_window [title="F5 VPN"] move scratchpad
|
||||||
|
for_window [title="F5 VPN"] border pixel 5
|
||||||
|
|
||||||
|
# restore scratchpads
|
||||||
|
bindsym $mod+F11 exec --no-startup-id $term -T "music-launcher" -e "$music"
|
||||||
|
bindsym $mod+F12 exec --no-startup-id $term -T "calc-launcher" -e "$calc"
|
||||||
|
|
||||||
|
# mpd/mpc commands
|
||||||
|
bindsym $mod+p exec mpc --host $HOME/.config/mpd/socket toggle
|
||||||
|
|
||||||
|
# Define names for default workspaces for which we configure key bindings later on.
|
||||||
|
# We use variables to avoid repeating the names in multiple places.
|
||||||
|
set $ws1 "1: shell"
|
||||||
|
set $ws2 "2: web"
|
||||||
|
set $ws3 "3: code"
|
||||||
|
set $ws4 "4: lab"
|
||||||
|
set $ws5 "5: games"
|
||||||
|
set $ws6 "6"
|
||||||
|
set $ws7 "7"
|
||||||
|
set $ws8 "8"
|
||||||
|
set $ws9 "9"
|
||||||
|
set $ws10 "10"
|
||||||
|
|
||||||
|
# switch to workspace
|
||||||
|
bindsym $mod+1 workspace $ws1
|
||||||
|
bindsym $mod+2 workspace $ws2; layout tabbed
|
||||||
|
bindsym $mod+3 workspace $ws3; layout tabbed
|
||||||
|
bindsym $mod+4 workspace $ws4
|
||||||
|
bindsym $mod+5 workspace $ws5
|
||||||
|
bindsym $mod+6 workspace $ws6
|
||||||
|
bindsym $mod+7 workspace $ws7
|
||||||
|
bindsym $mod+8 workspace $ws8
|
||||||
|
bindsym $mod+9 workspace $ws9
|
||||||
|
bindsym $mod+0 workspace $ws10
|
||||||
|
|
||||||
|
# move focused container to workspace
|
||||||
|
bindsym $mod+Shift+1 move container to workspace $ws1
|
||||||
|
bindsym $mod+Shift+2 move container to workspace $ws2
|
||||||
|
bindsym $mod+Shift+3 move container to workspace $ws3
|
||||||
|
bindsym $mod+Shift+4 move container to workspace $ws4
|
||||||
|
bindsym $mod+Shift+5 move container to workspace $ws5
|
||||||
|
bindsym $mod+Shift+6 move container to workspace $ws6
|
||||||
|
bindsym $mod+Shift+7 move container to workspace $ws7
|
||||||
|
bindsym $mod+Shift+8 move container to workspace $ws8
|
||||||
|
bindsym $mod+Shift+9 move container to workspace $ws9
|
||||||
|
bindsym $mod+Shift+0 move container to workspace $ws10
|
||||||
|
|
||||||
|
# move focused workspace between monitors
|
||||||
|
bindsym $mod+Ctrl+greater move workspace to output right
|
||||||
|
bindsym $mod+Ctrl+less move workspace to output left
|
||||||
|
|
||||||
|
# print screen
|
||||||
|
bindsym --release Print exec grim
|
||||||
|
bindsym --release $mod+Print exec grim -g "$(slurp)" $HOME/Pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png
|
||||||
|
bindsym --release $mod+Shift+Print exec grim -g "$(slurp)" - | wl-copy
|
||||||
|
bindsym --release $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy
|
||||||
|
|
||||||
|
# lock screen
|
||||||
|
#bindsym $mod+l --release exec $lock
|
||||||
|
bindsym $mod+l exec swaylock --image Pictures/1920x1200/tux-text-1920x1200.png
|
||||||
|
|
||||||
|
# reload the configuration file
|
||||||
|
bindsym $mod+Shift+c reload
|
||||||
|
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||||
|
bindsym $mod+Shift+r restart
|
||||||
|
# exit sway (logs you out of your wayland session)
|
||||||
|
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
|
||||||
|
|
||||||
|
# for_windows settings
|
||||||
|
for_window [class="urxvt"] border pixel 5
|
||||||
|
for_window [title="Mozilla Firefox"] move container to workspace $ws2
|
||||||
|
for_window [title="Chromium"] move container to workspace $ws2
|
||||||
|
for_window [class="VSCodium"] move container to workspace $ws3
|
||||||
|
for_window [title="Visual Studio Code"] move container to workspace $ws3
|
||||||
|
for_window [class="xfreerdp"] floating disable move container to workspace $ws4
|
||||||
|
for_window [title="Picture-in-Picture"] sticky enable
|
||||||
|
for_window [title="noVNC"] sticky enable floating enable
|
||||||
|
for_window [title="Proxmox Console"] sticky enable floating enable
|
||||||
|
for_window [title="feh"] sticky enable floating enable
|
||||||
|
for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable, resize set width 1030 height 710
|
||||||
|
|
||||||
|
# waylan = app_id
|
||||||
|
for_window [app_id="mpv"] inhibit_idle fullscreen
|
||||||
|
|
||||||
|
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
|
||||||
|
for_window [class="^Steam$"] floating disable move container to workspace $ws5
|
||||||
|
for_window [instance="steamwebhelper"] floating disable move container to workspace $ws5
|
||||||
|
for_window [class="^Steam$" title="^Friends$"] floating enable
|
||||||
|
for_window [class="^Steam$" title="Steam - News"] floating enable
|
||||||
|
for_window [class="^Steam$" title=".* - Chat"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Settings$"] floating enable
|
||||||
|
for_window [class="^Steam$" title=".* - event started"] floating enable
|
||||||
|
for_window [class="^Steam$" title=".* CD key"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable
|
||||||
|
for_window [title="^Steam Keyboard$"] floating enable
|
||||||
|
|
||||||
|
# resize window (you can also use the mouse for that)
|
||||||
|
mode "resize" {
|
||||||
|
# These bindings trigger as soon as you enter the resize mode
|
||||||
|
|
||||||
|
# Pressing left will shrink the window’s width.
|
||||||
|
# Pressing right will grow the window’s width.
|
||||||
|
# Pressing up will shrink the window’s height.
|
||||||
|
# Pressing down will grow the window’s height.
|
||||||
|
bindsym j resize shrink width 10 px or 10 ppt
|
||||||
|
bindsym k resize grow height 10 px or 10 ppt
|
||||||
|
bindsym l resize shrink height 10 px or 10 ppt
|
||||||
|
bindsym semicolon resize grow width 10 px or 10 ppt
|
||||||
|
|
||||||
|
# same bindings, but for the arrow keys
|
||||||
|
bindsym Left resize shrink width 10 px or 10 ppt
|
||||||
|
bindsym Down resize grow height 10 px or 10 ppt
|
||||||
|
bindsym Up resize shrink height 10 px or 10 ppt
|
||||||
|
bindsym Right resize grow width 10 px or 10 ppt
|
||||||
|
|
||||||
|
# back to normal: Enter or Escape or $mod+r
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
bindsym $mod+r mode "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
|
# monitor-mode settings
|
||||||
|
# use "swaymsg -t get_outputs" to list outputs
|
||||||
|
set $laptop eDP-1
|
||||||
|
set $dell1 'Dell Inc. DELL U2713HM GK0KD357412L'
|
||||||
|
set $dell2 'Dell Inc. DELL U2713HM GK0KD357413L'
|
||||||
|
bindswitch --reload --locked lid:on output $laptop disable
|
||||||
|
bindswitch --reload --locked lid:off output $laptop enable
|
||||||
|
output $laptop resolution 1920x1080 position 0,0
|
||||||
|
output $dell1 resolution 2560x1440@59.951Hz position 0,660 transform normal
|
||||||
|
output $dell2 resolution 2560x1440@59.951Hz position 2560,0 transform 270
|
||||||
|
|
||||||
|
# class border bground text indicator child_border
|
||||||
|
client.focused #6272A4 #6272A4 #F8F8F2 #6272A4 #6272A4
|
||||||
|
client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A
|
||||||
|
client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36
|
||||||
|
client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555
|
||||||
|
client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36
|
||||||
|
|
||||||
|
client.background #F8F8F2
|
||||||
|
|
||||||
|
|
||||||
|
#exec_always --no-startup-id $HOME/.config/polybar/start
|
||||||
|
bar {
|
||||||
|
swaybar_command waybar
|
||||||
|
colors {
|
||||||
|
background #282A36
|
||||||
|
statusline #F8F8F2
|
||||||
|
separator #44475A
|
||||||
|
|
||||||
|
focused_workspace #44475A #44475A #F8F8F2
|
||||||
|
active_workspace #282A36 #44475A #F8F8F2
|
||||||
|
inactive_workspace #282A36 #282A36 #BFBFBF
|
||||||
|
urgent_workspace #FF5555 #FF5555 #F8F8F2
|
||||||
|
binding_mode #FF5555 #FF5555 #F8F8F2
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user